diff --git a/.crumb b/.crumb index 239ac3e3..29c9d186 100644 --- a/.crumb +++ b/.crumb @@ -22,44 +22,44 @@ "children": [ { "digest": "fc491bf9ab591bdc2065379f71a34d4a572d866f7225e74745dcaf73c773bac7", - "last_commit": "5e0c797", + "last_commit": "7e5c1f8f", "name": "crates", "purpose": "Directory crates. Purpose not yet described by a human." }, { - "digest": "a59c8f9ed7fc2e2b7479b0f27b51563d256adfd2e2399cef59af0f055419c21e", - "last_commit": "5e0c797", + "digest": "35d5555ff4f23d370106e874ec0d5f9aa4f7d87e37c9589d1dbbcd5bd533640d", + "last_commit": "432c9447", "name": "docs", "purpose": "Directory docs. Purpose not yet described by a human." }, { - "digest": "45c897a7055a0c25a1ee482e5dd8674f527bc91d12bae901c9e73ed3ada3d7d2", - "last_commit": "5e0c797", + "digest": "773512413893fb607ea2e93c237b7ec15c3c55d8c656e8224a42b92b6bf0a6e5", + "last_commit": "a14aa34c", "name": "native", "purpose": "Directory native. Purpose not yet described by a human." }, { "digest": "57b4d8b99549c2e7921fb7d62b2dd99a1e6a4d9607d5c7604d83ab397effd1b9", - "last_commit": "5e0c797", + "last_commit": "5e0c7970", "name": "scripts", "purpose": "Directory scripts. Purpose not yet described by a human." }, { "digest": "e891c078bec120c3fdb14e13b7dd25d69054f608c2ea632adf2fd2b6e45d8fa1", - "last_commit": "29e884d", + "last_commit": "29e884d5", "name": "tools", "purpose": "First-party host artifact preparation tools" } ], - "children_root": "sha256:6b121afe0e7bc6ab5114ae4880e57aae282a8df324ba86582fc88ae21dedd7a5", - "compiled_at": "2026-11-06T14:27:34Z", + "children_root": "sha256:a3a646af619fe37df90fe0a2f31bb24001a00dc3b3df2586c0b3ee62d63e5fb9", + "compiled_at": "2026-11-06T15:04:49Z", "compiler": "crumb-compile/1", - "digest": "sha256:496b6e4c7536b56a766b0a7fd834a4e6609e37c053ebdac83776fa2f4e1fc3aa", - "evidence_files": 392, - "evidence_root": "sha256:21295040af737637275f8863f93700421b9552286e96e613ae8de21f7ad8d6c1", - "files": 4150, - "generated_at_commit": "6b4712e54f53ba3c2d0cd3c3f085802846f54fa6", - "source_tree": "sha256:ae21d112bdcaf36f03a56f61a4357b8dde8b276504bfa4e76ed7987d6d6e2b34" + "digest": "sha256:c39e5b525ec642c343546c7150304feba2adb0dc4f6138b060d4f68106dce3b3", + "evidence_files": 1474, + "evidence_root": "sha256:c9bebaaf662519bc6f3e7d03368e629ad54c8af2005adc6984363ed5b004a6e9", + "files": 5355, + "generated_at_commit": "a14aa34c9249188cc771a2a565494b5ce61ad432", + "source_tree": "sha256:2992687a070375993f346cda9f9eb9577ab8e6f4dd588056e36858fa08e6b837" }, "owner_lane": "", "provenance": { diff --git a/docs/.crumb b/docs/.crumb index f420829b..9581644f 100644 --- a/docs/.crumb +++ b/docs/.crumb @@ -30,14 +30,14 @@ } ], "children_root": "sha256:efb4a0449db172a441d8663f55ab48d6d81405e011961fd54213541c119b6852", - "compiled_at": "2026-11-06T12:57:47Z", + "compiled_at": "2026-11-06T14:13:40Z", "compiler": "crumb-compile/1", - "digest": "sha256:a59c8f9ed7fc2e2b7479b0f27b51563d256adfd2e2399cef59af0f055419c21e", + "digest": "sha256:35d5555ff4f23d370106e874ec0d5f9aa4f7d87e37c9589d1dbbcd5bd533640d", "evidence_files": 3, "evidence_root": "sha256:dc6e023412ded01aca886a94dc13859cb37ae664a28cff201db34893e3fab9ee", - "files": 319, - "generated_at_commit": "f26a7a2fe1dbd0632b1b9fcaeacb6d18ec8707e8", - "source_tree": "sha256:7e5a28140bdcda9e128acb2a57f22e16478fba1b791d12fecc129c9a23a4d69a" + "files": 323, + "generated_at_commit": "432c9447df58c134b21be92447164f33f92e70b2", + "source_tree": "sha256:9f0c276b6ee819366889a290556874f77bc3875493eb828705c1b3878f4d7122" }, "owner_lane": "", "provenance": { diff --git a/docs/superpowers/plans/2026-10-23-allen-omega-implementation.md b/docs/superpowers/plans/2026-10-23-allen-omega-implementation.md new file mode 100644 index 00000000..5fe64ffa --- /dev/null +++ b/docs/superpowers/plans/2026-10-23-allen-omega-implementation.md @@ -0,0 +1,16 @@ +# L694 implementation checkpoints + +1. Verify immutable compiler hash and compile/execute minimal probe. Freeze grammar + from pinned omc.om and founding OMEGESE language decisions. +2. Runtime state with behavioral RED stubs, native GREEN, rejection/recovery and + stale-ID mutant. Commit/push executable checkpoint evidence. +3. CODE and courier protocol, independently frozen exact fixtures, partial/reorder/ + loss/duplicate/session/capacity cases. No transport claim. +4. Import pinned native SHA core. Memory/note codecs and simulated two-copy fault + transactions. Compare independently produced golden bytes. Never equate SHA + with keyed authentication or rollback freshness. +5. Code rows, scene/state and native buffer rendering receipts. Record limits of + full visual equivalence and device integration. +6. Fresh source replay, behavioral mutants, strict repository gate, hashes and + committed evidence closure. Push exact branch and verify remote. WIP until + target gates; do not close L694. diff --git a/docs/superpowers/plans/2026-10-23-allen-portable-build.md b/docs/superpowers/plans/2026-10-23-allen-portable-build.md new file mode 100644 index 00000000..b623a987 --- /dev/null +++ b/docs/superpowers/plans/2026-10-23-allen-portable-build.md @@ -0,0 +1,21 @@ +# Allen portable seeded build + +This continues the existing Alpha delivery contract in `native/omega/allen/ALPHA.md`. +It removes one acquisition blocker, not the unfinished hosted/iMac qualification. + +1. Reproduce the private compiler-path dependency with the real pinned compiler + copied to a fresh directory. Add build-orchestration checks for a changed + compiler, invalid source, existing output and dangling output links. +2. Let `build-one.sh` select `OMEGA_COMPILER`, defaulting to the repository-local + `build/allen-toolchain/build/bootstrap/omc`. Retain the fixed compiler digest. + Publish an executable only after successful compilation and ELF inspection; + never replace an existing output, including a dangling link. +3. Document source-only reconstruction of omega-bridge commit + `0fc7d8662cb799e7c206b17c18ea4c3ec2b8fea9`. Rebuild from its Git archive and + verify the existing compiler digest before executing the complete Allen gate + from a clean source export outside the developer checkout. +4. Record actual results and remaining launch gates. Push the tested candidate + through the existing publication desk; do not label this a public alpha. + +No compiler implementation, product runtime, identity, memory or service changes. +Shell remains external build/test orchestration; all compiled probes are Omega. diff --git a/docs/superpowers/specs/2026-10-23-allen-omega-design.md b/docs/superpowers/specs/2026-10-23-allen-omega-design.md new file mode 100644 index 00000000..27227490 --- /dev/null +++ b/docs/superpowers/specs/2026-10-23-allen-omega-design.md @@ -0,0 +1,45 @@ +# L694 Allen Omega contract freeze (WIP) + +Approved authority: /home/drakestapleton/handoffs/briefs/L694-allen-omega.md. +Baseline da55660ea7337f2b6a42095fcd1fb6ddebe1cc7c. No master sequencing change. + +All new implementation and test programs are handwritten seeded Omega. Shell, +Git, sed, cat, sha256sum, readelf and quiet-build are external development tools. +No foreign runtime, generated C, compiler edits, service changes or deployment. + +## Contract and source map + +* svc/allen_intent.c: JOB/SAY/WAIT, code and code-more vs ordinary model chat. +* x86/kmain_x86.c code_request/courier_step: one outstanding job, immediate code + acknowledgment, stale sequence rejection, 20s slow and 30s silence timeout. +* svc/allen_code.c: 32768 bytes, 128-byte pieces, 256 slots, IEEE CRC32, 800 + lines, escaped newline/backslash. Complete code alone becomes displayable. +* x86/courier_udp{.h,_x86.c}: ALLEN-COURIER v=1, 16 lowercase hex session, + 1000-byte JOB pieces, 4096-byte job; ordered LINE delivery, duplicate GOT, + wrong-session refusal. Protocol core only; no socket attachment. +* svc/allen_memory.c: AIENALM1, versions 2/3/4; payload 40 + 113*nfacts + + (v>=3 ? 24 : 0) + (v>=4 ? 12 : 0). Header64, generation64 at16, + SHA256(header[0:32] || payload), zero header24:32 and trailing unit bytes. + Facts32 maximum, notes512. AIENNOT1 note length1..127; index, start, gone. + Two-copy save writes older, flushes, reads back, then publishes generation. +* svc/allen_scene.h, docs/ALLEN_CANVAS.md and ui/allen_ui.c: bounded scene, + calm sky/presence, no traditional desktop; code row wrapping and scrolling. + +## Boundary and intentional changes + +Fixed pools, explicit lengths, no pointer/heap/OS provider. Runtime caller supplies +monotonic milliseconds and session; identity remains Allen unless restored. +Overflow rejects whole operation rather than silently truncating user/model text. +Request IDs never reused across reset. Duplicate conflicting pieces rejected; +malformed numeric overflow rejected. No checksum claimed to authenticate a sender. +Disk tests use fixed buffers and injected failures, never a physical disk. SHA +integrity, keyed authorization, and freshness are independent; latter two are +unimplemented here and are never inferred from a successful SHA check. + +## Required unclosed gates + +Full legacy semantic/UI equivalence, transcript persistence, qualified native +provider integration, x86 EFI image, MMIO/interrupt/keyboard/framebuffer/disk/NIC, +iMac QEMU chat/keyboard/bootdisk and signed physical trial. Seed compiler currently +emits Linux AArch64 only. FR1/8/9/16 remain with L408; no C bridge may satisfy them. +Hermes JSON/WebSocket/admission belongs to L690 and is not reimplemented here. diff --git a/docs/superpowers/specs/2026-10-23-allen-omega-platform-gates.md b/docs/superpowers/specs/2026-10-23-allen-omega-platform-gates.md new file mode 100644 index 00000000..7630e503 --- /dev/null +++ b/docs/superpowers/specs/2026-10-23-allen-omega-platform-gates.md @@ -0,0 +1,31 @@ +# L694 required provider handoff, WIP + +No new compiler request or owner. Existing FR1/8/9/16 stay with L408. +L690's gateway implementation is untouched. No deployment is authorized here. + +Verified immutable compiler source at omega-bridge-native-development +0fc7d8662cb799e7c206b17c18ea4c3ec2b8fea9, seed/omc/omc.om: +vs_fd/vs_arr/vs_off/vs_end implement Linux read/write, main startup exits via93; +elfhdr fixes ELF AArch64 and program headers. No x86/EFI codegen, MMIO, +interrupt, disk, socket or clock API is present at this checkpoint. This is an +inspection of the actual pinned compiler, not an inference from an old roadmap. +The fresh source-native bootstrap reproduces hash191b776e. There are no compiler +edits here and no foreign wrapper may substitute for the missing target. + +| Existing dependency | Actual L694 entry/state to bind | Smallest qualification receipt needed | +| --- | --- | --- | +| FR9 x86 EFI/native target | same handwritten runtime/probe and tests | Source-only compiler pin produces nonempty PE32+ AMD64 EFI image with inspected headers, native marker in isolated iMac QEMU; then same behavioral gates on that target. Current ELF is not EFI. | +| FR8 privileged/device interfaces | Frame192x128, render/glow; start/heard/tick milliseconds | Native typed MMIO/port/IRQ/monotonic interface with bounds/refusals; keyboard event changes Prompt, frame buffer observes native pixels, monotonic timeout test. No C/asm wrapper to count as Omega product implementation. | +| FR1 durable storage provider | Enc4096, Unit4096; Tx target/generation, txwrite/txflush/txread; nwrite/nflush/nread | Native block read/write/flush on isolated disposable simulated/QEMU disk,512B and4KB geometry, fault at each phase, restart chooses valid newest; old copy bytes unchanged. Hash integrity, keyed authorization and anti-rollback each report separately. | +| FR16 bounded transport | In/Inlen, packet Outb/Outlen, qreceive/qtake | Immutable native socket/readiness/close API, isolated loopback recorded datagrams, partial writes/reads, EOF/error/timeout, malformed and session mismatch. No production endpoint. | +| iMac execution | cohesive runtime plus qualified providers | Existing iMac QEMU boot/chat/keyboard/bootdisk gates with complete Omega execution closure; then parent-signed physical trial. All remain NOT_RUN. | + +Exact provider API names are not invented here: no qualified interface for these +features is supplied by the pinned compiler. The owner must hand off its actual +immutable signatures and executable receipts. L694's fixed-pool entry points +above define the consumer side, not an alternate socket or driver implementation. + +Independent portable work remains in native/omega/allen/README.md. In particular, +a component render is not full visual parity and state restoration is not actual +durable transcript continuity. These are implementation gaps beyond platform +blocking and must remain visible to the parent. L694 is not closed or READY. diff --git a/evidence/allen-omega-L694/CLOSURE.md b/evidence/allen-omega-L694/CLOSURE.md new file mode 100644 index 00000000..fe056a16 --- /dev/null +++ b/evidence/allen-omega-L694/CLOSURE.md @@ -0,0 +1,46 @@ +# Immutable-source acceptance closure, WIP + +Implementation source commit: a19ed49 (full ID in handoff). +Reconstructed through `git archive a19ed49 native/omega/allen` plus committed +wire/stdio fixtures into fresh target/allen-omega-L694/immutable-source. +No inherited binary or receipt was treated as fresh acceptance. + +Executed command: + +```sh +quiet-build target/allen-omega-L694/immutable-source/native/omega/allen/gate.sh \ + /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1 +``` + +Exit0. All13 test/render/fixture programs and the standalone Allen executable +compile successfully to nonempty static Linux AArch64 ELF before execution. +879 native behavioral checks,0 failed. Memory golden comparison0; stdio golden +comparison0; actual native rendering exit0. Five compiled mutants fail the original +gates with exits3/2/2/7/1. final/ contains exact per-check outputs and SHA256s of +all executable and source inputs. source-closure.log verifies the archived inputs +also match the current implementation. No code changed after source commit. + +Source-only compiler bootstrap at pinned bridge0fc7d866 succeeds, exit0, +stage1==stage2 and supplied compiler hash==rebuilt hash191b776e. bootstrap.log and +compiler.sha256 preserve the result. Shell/readelf/hash tools are external tools, +not a product runtime or a compiler implementation fallback. + +Strict repository verification exit101: four unchanged Rust courier tests require +loopback sockets prohibited by the sandbox. Formatting passed. Separate +`cargo clippy --offline --all-targets -- -D warnings` exit0, zero warnings. +Strict suite is FAIL, not waived, not an Omega gate. + +Publishing: original worktree Git metadata cannot be written under managed +permissions. A bare publication metadata directory was initialized in the permitted +handoff root from the baseline, using the existing worktree as its explicit +--work-tree. No second worktree or worker was created. Implementation commit and +closure commit are recorded there on feat/allen-omega-L694. Origin is the original +`git@github.com:aien-dev/aienux.git`. Push exit128 because github.com does not +resolve; push.log preserves it. Remote exact hash verification is unavailable. +A prerequisite-based Git bundle permits parent publication without rewriting the +implementation. No PR, merge, issue closure, service or deployment action occurred. + +Required target and remaining portable gates: +[provider handoff](../../docs/superpowers/specs/2026-10-23-allen-omega-platform-gates.md), +[module limits](../../native/omega/allen/README.md). Verdict WIP / TARGET NOT_RUN / +REMOTE PUBLICATION BLOCKED. This is neither whole Allen replacement nor live. diff --git a/evidence/allen-omega-L694/L722/L719-original-review.md b/evidence/allen-omega-L694/L722/L719-original-review.md new file mode 100644 index 00000000..2e45d9b5 --- /dev/null +++ b/evidence/allen-omega-L694/L722/L719-original-review.md @@ -0,0 +1,17 @@ +# L719 independent review — L694 native Allen milestone + +**Reviewed source:** `8049f5ddbfb3284498e54ed582768a399dcc99d5` (baseline `da55660ea7337f2b6a42095fcd1fb6ddebe1cc7c`). Exported the source/docs and committed evidence into private `~/handoffs/L719-review`; production/source/worktree and ledgers were not modified. Pinned compiler SHA-256 verified as `191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9`. + +## Finding + +**Medium — oversized stdio command lines are silently discarded instead of refused.** `native/omega/allen/main.om:135-140` sets `Lstate[1]` when the 8192-byte line buffer fills, but on newline `main.om:123-133` takes the `else` branch, clears the overflow flag and line length, and continues without reporting an error or terminating. This contradicts the stated whole-operation overflow refusal (`native/omega/allen/README.md:66-70`) at the actual standalone integration boundary. + +**Reproduction:** compiled the unmodified concatenated Omega core + `main.om` using the pinned compiler via `build-one.sh`; nonempty static AArch64 ELF check passed. Fed `ASK ` + 8189 `x` bytes (8193-byte line, one byte beyond the 8192-byte line buffer) + newline, then `ASK hi\n`. The process exited `0`, stderr was empty, and stdout was 473 bytes containing a `JOB 1 chat ...` packet ending with `the person said something in passing.\thi\n`. Thus the oversized first line was silently skipped and the next command was processed; the caller receives no refusal/error for the dropped command. Probe ELF SHA-256: `c22923a20f4bd9f30a3bc8e51544b10533a7c0a20bc65856a107a163362312e8`; stdout SHA-256: `52777ab25b070876095242a799846ece3098d472751e98e33c0eac18ffaa9477`; stderr SHA-256: `e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855`. Probe artifacts are under `~/handoffs/L719-review/probe-output/`. + +## Evidence checked / limits + +- `evidence/allen-omega-L694/CLOSURE.md` says the exact immutable replay compiled 13 Omega test/render/fixture programs plus standalone Allen, ran 879 checks, compared the 4096-byte memory golden, and exercised five compiled behavioral mutants. The committed per-test logs have the claimed line counts (runtime 28, CODE 23, courier 24, memory 79, edges 352, short 20, long 292); `final-replay.log` records the same mutant exits and `target=NOT_RUN; live=NOT_RUN`. +- The gate does not test stdio overflow: `gate.sh:33-37` exercises only the canned `stdio-input.txt` and compares its two golden outputs. `main.om` is separately compiled and run in that path, but has no direct oversized-line case in the committed test sources. +- Known missing iMac/provider/UI/scene parity and non-qualification are explicitly disclosed in the README/design/platform gates and are not reported as newly discovered defects. I did not rerun the parent-owned broad gate or alter any production files. + +**Disposition:** one concrete boundary defect reproduced; no conclusion of full Allen qualification. Target, live attachment, iMac/platform parity, and the broader strict suite remain outside this review's verified scope (the saved closure separately records four sandbox-denied socket tests in the strict Rust suite). diff --git a/evidence/allen-omega-L694/L722/README.md b/evidence/allen-omega-L694/L722/README.md new file mode 100644 index 00000000..14410c6b --- /dev/null +++ b/evidence/allen-omega-L694/L722/README.md @@ -0,0 +1,5 @@ +# L722 correction of L719 stdio overflow + +Original8049f5d executable received an Omega-generated8201-byte input:8193-byte ASK line, newline, valid ASK hi. Actual RED exit0 with473 stdout bytes proves silent loss and subsequent job execution. After correction the standalone input loop returns65 as soon as a byte exceeds capacity; subsequent commands are not dispatched. The public gate requires exit65 and both outputs empty. All879 existing native checks and5 compiled behavioral mutants still pass their original expectations, memory and stdio goldens unchanged. Review source and reproduction are retained, not replaced by a no-findings claim. + +Independent corrective review pending. Whole portability/full repository/iMac acceptance remains open. diff --git a/evidence/allen-omega-L694/L722/binaries.sha256 b/evidence/allen-omega-L694/L722/binaries.sha256 new file mode 100644 index 00000000..b2fd7b35 --- /dev/null +++ b/evidence/allen-omega-L694/L722/binaries.sha256 @@ -0,0 +1,20 @@ +da36a1ca8ceb536ad5e831560c10ef2f4e995e256f9525fb256470109d840810 /home/drakestapleton/handoffs/allen-omega-L694/L722/green/readback-mutant +798543784942f29bc405e5a560a73ec50025553d5190f0d00fc59aa8e5376c69 /home/drakestapleton/handoffs/allen-omega-L694/L722/green/view +be4ff5265e6e46962c9a35008bcf8a9127c7d9fbcc00db58f9a40c8a4008fb5d /home/drakestapleton/handoffs/allen-omega-L694/L722/green/allen +ac0bc89319605462156184f3f39e62e7cc12e2748d8feb3d39c80e91d383dbef /home/drakestapleton/handoffs/allen-omega-L694/L722/green/reply +f75db42bc8ee80899ccfda45022a6be3d80c439922edd6c36eee2c36de30ffec /home/drakestapleton/handoffs/allen-omega-L694/L722/green/hash-mutant +0039a6d288e11ec70b12b1af15909bb308c6b72f08cb39c51fe06aad245e2690 /home/drakestapleton/handoffs/allen-omega-L694/L722/green/golden +d3ed86f446ac73fc813f8cb905e0fa30e8fc26d9984c3e47ced86424690fc3d9 /home/drakestapleton/handoffs/allen-omega-L694/L722/green/session-mutant +bb17eefbb058191b0669ab15529051c5de99e0f25448e05501d8fc7f9532b3af /home/drakestapleton/handoffs/allen-omega-L694/L722/green/intent +9bbf95a44321be8d57043d5daa68f4945d2eac63be7e5befa260db79a6defea8 /home/drakestapleton/handoffs/allen-omega-L694/L722/green/fixture +52f05863a960da4e021bae3eecb161792663ce3dfcc701a685a9f93b65570ff7 /home/drakestapleton/handoffs/allen-omega-L694/L722/green/runtime +b6d231c1a1b1cb2fcdea6fcbbc3419aa5aec92ff9fc9984d261dcbc26943b737 /home/drakestapleton/handoffs/allen-omega-L694/L722/green/code +d30797bb341012516081fb6620ec21c6e3f428194ab9968b2181f8074786eba6 /home/drakestapleton/handoffs/allen-omega-L694/L722/green/edges +87676023c7d49e5ea9346f84c71aed4511046bd29f76ed91eea3fd727660ad8d /home/drakestapleton/handoffs/allen-omega-L694/L722/green/render +7391168db6c88324a04881498ad7b671fd306226921e050d9777e090d0e6cc6e /home/drakestapleton/handoffs/allen-omega-L694/L722/green/stale-mutant +3031d8376ce13d13b8ff55005600e36caf14ac4a59362611f2f5aefd639fe238 /home/drakestapleton/handoffs/allen-omega-L694/L722/green/courier +44601a3b526c1e799b908342454f1fd3992ac70b83a396a04f2daef8e06ef21c /home/drakestapleton/handoffs/allen-omega-L694/L722/green/scene +fd080b24d5b5833f70237e966c4bc8688dc4aadba8486b739dc7694fcaf99f6d /home/drakestapleton/handoffs/allen-omega-L694/L722/green/paint +0e1de4f532b286d8a0fe320bb9b9d61a0724b545e65d27e1fc43e497fac2ec7f /home/drakestapleton/handoffs/allen-omega-L694/L722/green/crc-mutant +71f99242bcad6ede239b240602470fcf3d5da3267eb47a1ad522241958222367 /home/drakestapleton/handoffs/allen-omega-L694/L722/green/stdio-overflow-input +1a210071b068ef5e527dc66651ab635c53971add8b9cfab09c2fdff2290ff6dd /home/drakestapleton/handoffs/allen-omega-L694/L722/green/memory diff --git a/evidence/allen-omega-L694/L722/code.log b/evidence/allen-omega-L694/L722/code.log new file mode 100644 index 00000000..e7e197b7 --- /dev/null +++ b/evidence/allen-omega-L694/L722/code.log @@ -0,0 +1,23 @@ +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 diff --git a/evidence/allen-omega-L694/L722/corrective-review/exact-boundary.in b/evidence/allen-omega-L694/L722/corrective-review/exact-boundary.in new file mode 100644 index 00000000..a4f3dd77 --- /dev/null +++ b/evidence/allen-omega-L694/L722/corrective-review/exact-boundary.in @@ -0,0 +1,2 @@ +ASK xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +ASK hi diff --git a/evidence/allen-omega-L694/L722/corrective-review/exact-boundary.om b/evidence/allen-omega-L694/L722/corrective-review/exact-boundary.om new file mode 100644 index 00000000..9a0fc255 --- /dev/null +++ b/evidence/allen-omega-L694/L722/corrective-review/exact-boundary.om @@ -0,0 +1,29 @@ +note L723 independent exact-capacity command followed by valid positive control. +global Bytes uchar 8192 +text Tail "\nASK hi\n" +fn main to int +for i ulong len Bytes +put Bytes i 120 +end +put Bytes 0 65 +put Bytes 1 83 +put Bytes 2 75 +put Bytes 3 32 +sent = ulong 0 +while lt sent len Bytes +n = write 1 Bytes sent sub len Bytes sent +if le n 0 +ret 2 +end +sent = add sent ulong n +end +sent = ulong 0 +while lt sent len Tail +n = write 1 Tail sent sub len Tail sent +if le n 0 +ret 2 +end +sent = add sent ulong n +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L722/corrective-review/exact-boundary.stderr b/evidence/allen-omega-L694/L722/corrective-review/exact-boundary.stderr new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L722/corrective-review/exact-boundary.stdout b/evidence/allen-omega-L694/L722/corrective-review/exact-boundary.stdout new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L722/corrective-review/overflow.in b/evidence/allen-omega-L694/L722/corrective-review/overflow.in new file mode 100644 index 00000000..6103faf0 --- /dev/null +++ b/evidence/allen-omega-L694/L722/corrective-review/overflow.in @@ -0,0 +1,2 @@ +ASK xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +ASK hi diff --git a/evidence/allen-omega-L694/L722/corrective-review/overflow.stderr b/evidence/allen-omega-L694/L722/corrective-review/overflow.stderr new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L722/corrective-review/overflow.stdout b/evidence/allen-omega-L694/L722/corrective-review/overflow.stdout new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L722/corrective-review/oversize-eof.in b/evidence/allen-omega-L694/L722/corrective-review/oversize-eof.in new file mode 100644 index 00000000..b21a8d65 --- /dev/null +++ b/evidence/allen-omega-L694/L722/corrective-review/oversize-eof.in @@ -0,0 +1 @@ +ASK xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx \ No newline at end of file diff --git a/evidence/allen-omega-L694/L722/corrective-review/oversize-eof.om b/evidence/allen-omega-L694/L722/corrective-review/oversize-eof.om new file mode 100644 index 00000000..7de23b0e --- /dev/null +++ b/evidence/allen-omega-L694/L722/corrective-review/oversize-eof.om @@ -0,0 +1,20 @@ +note L723 independent over-capacity line terminated by EOF, no newline. +global Bytes uchar 8193 +fn main to int +for i ulong len Bytes +put Bytes i 120 +end +put Bytes 0 65 +put Bytes 1 83 +put Bytes 2 75 +put Bytes 3 32 +sent = ulong 0 +while lt sent len Bytes +n = write 1 Bytes sent sub len Bytes sent +if le n 0 +ret 2 +end +sent = add sent ulong n +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L722/corrective-review/oversize-eof.stderr b/evidence/allen-omega-L694/L722/corrective-review/oversize-eof.stderr new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L722/corrective-review/oversize-eof.stdout b/evidence/allen-omega-L694/L722/corrective-review/oversize-eof.stdout new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L722/corrective-review/parent-verification.json b/evidence/allen-omega-L694/L722/corrective-review/parent-verification.json new file mode 100644 index 00000000..fe4bb353 --- /dev/null +++ b/evidence/allen-omega-L694/L722/corrective-review/parent-verification.json @@ -0,0 +1,29 @@ +{ + "source": "13d02ab4b7145579f6d3faa53442167bfcdcd7bc", + "source_closure_match": true, + "binary_sha256": "be4ff5265e6e46962c9a35008bcf8a9127c7d9fbcc00db58f9a40c8a4008fb5d", + "probes": { + "overflow": { + "exit": 65, + "stdout_bytes": 0, + "stderr_bytes": 0, + "input_bytes": 8201 + }, + "oversize-eof": { + "exit": 65, + "stdout_bytes": 0, + "stderr_bytes": 0, + "input_bytes": 8193 + }, + "exact-boundary": { + "exit": 65, + "stdout_bytes": 0, + "stderr_bytes": 0, + "input_bytes": 8200 + }, + "positive": { + "exit": 0, + "golden_cmp": 0 + } + } +} diff --git a/evidence/allen-omega-L694/L722/corrective-review/positive.stderr b/evidence/allen-omega-L694/L722/corrective-review/positive.stderr new file mode 100644 index 00000000..7d40356d --- /dev/null +++ b/evidence/allen-omega-L694/L722/corrective-review/positive.stderr @@ -0,0 +1,2 @@ +I need to code that. Let me send it off to the Spark. +Code ready. diff --git a/evidence/allen-omega-L694/L722/corrective-review/positive.stdout b/evidence/allen-omega-L694/L722/corrective-review/positive.stdout new file mode 100644 index 00000000..db964ea1 --- /dev/null +++ b/evidence/allen-omega-L694/L722/corrective-review/positive.stdout @@ -0,0 +1 @@ +JOB 1 code the person asked Allen for code. make me a calculator diff --git a/evidence/allen-omega-L694/L722/corrective-review/report.md b/evidence/allen-omega-L694/L722/corrective-review/report.md new file mode 100644 index 00000000..cddafe43 --- /dev/null +++ b/evidence/allen-omega-L694/L722/corrective-review/report.md @@ -0,0 +1,19 @@ +# L723 independent corrective review — L722 stdio overflow + +**Result: no findings in the scoped correction.** Reviewed exact commit `13d02ab4b7145579f6d3faa53442167bfcdcd7bc` against parent `7f4cb7aa54164f71e2e26b0b834119af3e3839e5`. Checkout was clean and at the requested commit. The runtime change replaces the overflow-flag set with immediate status `65`; therefore neither newline handling nor any subsequent command can clear the condition and continue dispatching. The gate adds a generated 8193-byte command followed by `ASK hi`, requiring status 65 and empty stdout/stderr. No unrelated behavior or production files were changed in this review. + +## Independent rebuild and probes + +Rebuilt standalone `main.om` plus the exact pinned core at commit source with pinned `omc` SHA-256 `191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9`. `build-one.sh` succeeded; ELF was static AArch64 EXEC. Rebuilt executable SHA-256: `be4ff5265e6e46962c9a35008bcf8a9127c7d9fbcc00db58f9a40c8a4008fb5d`. + +- **8193-byte line + newline + later valid command:** independently compiled the committed Omega input generator and ran it through the rebuilt executable. Input was 8201 bytes total; process returned `65`, stdout `0` bytes, stderr `0` bytes. The later `ASK hi` was not dispatched. +- **8193-byte line ending at EOF (no newline):** independently authored/compiled an Omega generator. Input was 8193 bytes; process returned `65`, stdout/stderr each `0` bytes. +- **8192-byte line boundary, followed by newline and valid command:** independently authored/compiled an Omega generator. Input was 8200 bytes and spans the runtime's 8192-byte read buffer boundary. Process returned `65`, stdout/stderr each `0` bytes. This establishes refusal at the exact-size line boundary case, but does not distinguish overflow detection from downstream refusal of the extremely long `ASK` payload; no stronger interpretation is claimed. +- **Positive control:** ran the established valid stdio fixture through the rebuilt executable; returned `0` and stdout/stderr matched their committed goldens byte-for-byte (`cmp` passed). + +The first two overflow cases directly exercise the immediate-return branch, including a subsequent command in the newline case. Exact-source broad suite was not duplicated; parent brief records its existing 879-check/five-mutant run. No iMac, target, live-service, or full qualification claim is made. + +## Artifacts + +Review report: `~/handoffs/L723-review/report.md`. +Independent sources, generated fixtures, rebuilt executable, and captured outputs: `~/handoffs/L723-review/rebuild/`. These are review artifacts only; no source-tree edits were made. diff --git a/evidence/allen-omega-L694/L722/courier.log b/evidence/allen-omega-L694/L722/courier.log new file mode 100644 index 00000000..8402df49 --- /dev/null +++ b/evidence/allen-omega-L694/L722/courier.log @@ -0,0 +1,24 @@ +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 diff --git a/evidence/allen-omega-L694/L722/edges.log b/evidence/allen-omega-L694/L722/edges.log new file mode 100644 index 00000000..e8d0deea --- /dev/null +++ b/evidence/allen-omega-L694/L722/edges.log @@ -0,0 +1,352 @@ +1201 0 +1202 0 +1203 0 +1204 0 +1205 0 +1206 0 +1207 0 +1208 0 +1209 0 +1210 0 +1211 0 +1212 0 +1213 0 +1214 0 +1220 0 +1221 0 +1222 0 +1223 0 +1224 0 +1225 0 +1226 0 +1227 0 +1228 0 +1229 0 +1230 0 +1231 0 +1232 0 +1233 0 +1234 0 +1235 0 +1236 0 +1237 0 +1238 0 +1239 0 +1240 0 +1241 0 +1242 0 +1243 0 +1244 0 +1245 0 +1246 0 +1247 0 +1248 0 +1249 0 +1250 0 +1251 0 +1252 0 +1253 0 +1254 0 +1255 0 +1256 0 +1257 0 +1258 0 +1259 0 +1260 0 +1261 0 +1262 0 +1301 0 +1302 0 +1303 0 +1304 0 +1305 0 +1306 0 +1310 0 +1311 0 +1312 0 +1313 0 +1314 0 +1315 0 +1316 0 +1317 0 +1318 0 +1319 0 +1320 0 +1321 0 +1322 0 +1323 0 +1324 0 +1325 0 +1326 0 +1327 0 +1328 0 +1329 0 +1330 0 +1331 0 +1332 0 +1333 0 +1334 0 +1335 0 +1336 0 +1337 0 +1338 0 +1339 0 +1340 0 +1341 0 +1342 0 +1343 0 +1344 0 +1345 0 +1346 0 +1347 0 +1348 0 +1349 0 +1350 0 +1351 0 +1352 0 +1353 0 +1354 0 +1355 0 +1356 0 +1357 0 +1358 0 +1359 0 +1360 0 +1361 0 +1362 0 +1363 0 +1364 0 +1365 0 +1366 0 +1367 0 +1368 0 +1369 0 +1370 0 +1371 0 +1372 0 +1373 0 +1374 0 +1375 0 +1376 0 +1377 0 +1378 0 +1379 0 +1380 0 +1381 0 +1382 0 +1383 0 +1384 0 +1385 0 +1386 0 +1387 0 +1388 0 +1389 0 +1390 0 +1391 0 +1392 0 +1393 0 +1394 0 +1395 0 +1396 0 +1397 0 +1398 0 +1399 0 +1400 0 +1401 0 +1402 0 +1403 0 +1404 0 +1405 0 +1406 0 +1407 0 +1408 0 +1409 0 +1410 0 +1411 0 +1412 0 +1413 0 +1414 0 +1415 0 +1416 0 +1417 0 +1418 0 +1419 0 +1420 0 +1421 0 +1422 0 +1423 0 +1424 0 +1425 0 +1426 0 +1427 0 +1428 0 +1429 0 +1430 0 +1431 0 +1432 0 +1433 0 +1434 0 +1435 0 +1436 0 +1437 0 +1438 0 +1439 0 +1440 0 +1441 0 +1442 0 +1443 0 +1444 0 +1445 0 +1446 0 +1447 0 +1448 0 +1449 0 +1450 0 +1451 0 +1452 0 +1453 0 +1454 0 +1455 0 +1456 0 +1457 0 +1458 0 +1459 0 +1460 0 +1461 0 +1462 0 +1463 0 +1464 0 +1465 0 +1466 0 +1467 0 +1468 0 +1469 0 +1470 0 +1471 0 +1472 0 +1473 0 +1474 0 +1475 0 +1476 0 +1477 0 +1478 0 +1479 0 +1480 0 +1481 0 +1482 0 +1483 0 +1484 0 +1485 0 +1486 0 +1487 0 +1488 0 +1489 0 +1490 0 +1491 0 +1492 0 +1493 0 +1494 0 +1495 0 +1496 0 +1497 0 +1498 0 +1499 0 +1500 0 +1501 0 +1502 0 +1503 0 +1504 0 +1505 0 +1506 0 +1507 0 +1508 0 +1509 0 +1510 0 +1511 0 +1512 0 +1513 0 +1514 0 +1515 0 +1516 0 +1517 0 +1518 0 +1519 0 +1520 0 +1521 0 +1522 0 +1523 0 +1524 0 +1525 0 +1526 0 +1527 0 +1528 0 +1529 0 +1530 0 +1531 0 +1532 0 +1533 0 +1534 0 +1535 0 +1536 0 +1537 0 +1538 0 +1539 0 +1540 0 +1541 0 +1542 0 +1543 0 +1544 0 +1545 0 +1546 0 +1547 0 +1548 0 +1549 0 +1550 0 +1551 0 +1552 0 +1553 0 +1554 0 +1555 0 +1556 0 +1557 0 +1558 0 +1559 0 +1560 0 +1561 0 +1562 0 +1563 0 +1564 0 +1565 0 +1570 0 +1571 0 +1572 0 +1575 0 +1573 0 +1574 0 +1600 0 +1601 0 +1602 0 +1603 0 +1604 0 +1605 0 +1606 0 +1607 0 +1610 0 +1611 0 +1612 0 +1613 0 +1614 0 +1615 0 +1616 0 +1617 0 +1701 0 +1702 0 +1703 0 +1704 0 +1705 0 +1706 0 +1707 0 +1708 0 +1709 0 +1710 0 +1711 0 diff --git a/evidence/allen-omega-L694/L722/green.exit b/evidence/allen-omega-L694/L722/green.exit new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/L722/green.exit @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/L722/green.log b/evidence/allen-omega-L694/L722/green.log new file mode 100644 index 00000000..d6630414 --- /dev/null +++ b/evidence/allen-omega-L694/L722/green.log @@ -0,0 +1,21 @@ +runtime compile=0 native-exit=0 +code compile=0 native-exit=0 +courier compile=0 native-exit=0 +memory compile=0 native-exit=0 +intent compile=0 native-exit=0 +reply compile=0 native-exit=0 +view compile=0 native-exit=0 +scene compile=0 native-exit=0 +paint compile=0 native-exit=0 +edges compile=0 native-exit=0 +fixture compile=0 native-exit=0 +golden compile=0 native-exit=0 +render compile=0 native-exit=0 +stdio native-exit=0 golden-cmp=0 +stdio overflow native-exit=65 no-later-command=PASS +stale mutant compile=0 rejected-exit=3 +crc mutant compile=0 rejected-exit=2 +hash mutant compile=0 rejected-exit=2 +readback mutant compile=0 rejected-exit=7 +session mutant compile=0 rejected-exit=1 +ALLEN_OMEGA_HOST: PASS; target=NOT_RUN; live=NOT_RUN diff --git a/evidence/allen-omega-L694/L722/input.txt b/evidence/allen-omega-L694/L722/input.txt new file mode 100644 index 00000000..6103faf0 --- /dev/null +++ b/evidence/allen-omega-L694/L722/input.txt @@ -0,0 +1,2 @@ +ASK xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +ASK hi diff --git a/evidence/allen-omega-L694/L722/intent.log b/evidence/allen-omega-L694/L722/intent.log new file mode 100644 index 00000000..5371bd36 --- /dev/null +++ b/evidence/allen-omega-L694/L722/intent.log @@ -0,0 +1,8 @@ +501 0 +502 0 +503 0 +504 0 +505 0 +506 0 +507 0 +508 0 diff --git a/evidence/allen-omega-L694/L722/long.log b/evidence/allen-omega-L694/L722/long.log new file mode 100644 index 00000000..0a060bc8 --- /dev/null +++ b/evidence/allen-omega-L694/L722/long.log @@ -0,0 +1,292 @@ +401 0 +410 0 +411 0 +412 0 +413 0 +414 0 +415 0 +416 0 +417 0 +418 0 +419 0 +420 0 +421 0 +422 0 +423 0 +424 0 +425 0 +426 0 +427 0 +428 0 +429 0 +430 0 +431 0 +432 0 +433 0 +434 0 +435 0 +436 0 +437 0 +438 0 +439 0 +440 0 +441 0 +442 0 +443 0 +444 0 +445 0 +446 0 +447 0 +448 0 +449 0 +450 0 +451 0 +452 0 +453 0 +454 0 +455 0 +456 0 +457 0 +458 0 +459 0 +460 0 +461 0 +462 0 +463 0 +464 0 +465 0 +466 0 +467 0 +468 0 +469 0 +470 0 +471 0 +472 0 +473 0 +474 0 +475 0 +476 0 +477 0 +478 0 +479 0 +480 0 +481 0 +482 0 +483 0 +484 0 +485 0 +486 0 +487 0 +488 0 +489 0 +490 0 +491 0 +492 0 +493 0 +494 0 +495 0 +496 0 +497 0 +498 0 +499 0 +500 0 +501 0 +502 0 +503 0 +504 0 +505 0 +506 0 +507 0 +508 0 +509 0 +510 0 +511 0 +512 0 +513 0 +514 0 +515 0 +516 0 +517 0 +518 0 +519 0 +520 0 +521 0 +522 0 +523 0 +524 0 +525 0 +526 0 +527 0 +528 0 +529 0 +530 0 +531 0 +532 0 +533 0 +534 0 +535 0 +536 0 +537 0 +538 0 +539 0 +540 0 +541 0 +542 0 +543 0 +544 0 +545 0 +546 0 +547 0 +548 0 +549 0 +550 0 +402 0 +403 0 +404 0 +405 0 +406 0 +700 0 +701 0 +702 0 +703 0 +704 0 +705 0 +706 0 +707 0 +708 0 +709 0 +710 0 +711 0 +712 0 +713 0 +714 0 +715 0 +716 0 +717 0 +718 0 +719 0 +720 0 +721 0 +722 0 +723 0 +724 0 +725 0 +726 0 +727 0 +728 0 +729 0 +730 0 +731 0 +732 0 +733 0 +734 0 +735 0 +736 0 +737 0 +738 0 +739 0 +740 0 +741 0 +742 0 +743 0 +744 0 +745 0 +746 0 +747 0 +748 0 +749 0 +750 0 +751 0 +752 0 +753 0 +754 0 +755 0 +756 0 +757 0 +758 0 +759 0 +760 0 +761 0 +762 0 +763 0 +764 0 +765 0 +766 0 +767 0 +768 0 +769 0 +770 0 +771 0 +772 0 +773 0 +774 0 +775 0 +776 0 +777 0 +778 0 +779 0 +780 0 +781 0 +782 0 +783 0 +784 0 +785 0 +786 0 +787 0 +788 0 +789 0 +790 0 +791 0 +792 0 +793 0 +794 0 +795 0 +796 0 +797 0 +798 0 +799 0 +800 0 +801 0 +802 0 +803 0 +804 0 +805 0 +806 0 +807 0 +808 0 +809 0 +810 0 +811 0 +812 0 +813 0 +814 0 +815 0 +816 0 +817 0 +818 0 +819 0 +820 0 +821 0 +822 0 +823 0 +824 0 +825 0 +826 0 +827 0 +828 0 +829 0 +830 0 +831 0 +832 0 +833 0 +834 0 +835 0 +836 0 +837 0 +838 0 +839 0 +840 0 +841 0 +407 0 +408 0 +409 0 diff --git a/evidence/allen-omega-L694/L722/memory.log b/evidence/allen-omega-L694/L722/memory.log new file mode 100644 index 00000000..5928102e --- /dev/null +++ b/evidence/allen-omega-L694/L722/memory.log @@ -0,0 +1,79 @@ +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 0 +310 0 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +362 0 +363 0 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 0 +361 0 diff --git a/evidence/allen-omega-L694/L722/paint.log b/evidence/allen-omega-L694/L722/paint.log new file mode 100644 index 00000000..281a5bd2 --- /dev/null +++ b/evidence/allen-omega-L694/L722/paint.log @@ -0,0 +1,11 @@ +1101 0 +1102 0 +1103 0 +1104 0 +1105 0 +1106 0 +1107 0 +1108 0 +1109 0 +1110 0 +1111 0 diff --git a/evidence/allen-omega-L694/L722/red.exit b/evidence/allen-omega-L694/L722/red.exit new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/L722/red.exit @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/L722/red.stderr b/evidence/allen-omega-L694/L722/red.stderr new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L722/red.stdout b/evidence/allen-omega-L694/L722/red.stdout new file mode 100644 index 00000000..a44ca483 --- /dev/null +++ b/evidence/allen-omega-L694/L722/red.stdout @@ -0,0 +1 @@ +JOB 1 chat You are the far hands of Allen, a quiet presence living in AIENOS on the person's computer. You answer as Allen; the person sees only your words, as if Allen said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. the person said something in passing. Answer in one or two warm, plain sentences. hi diff --git a/evidence/allen-omega-L694/L722/reply.log b/evidence/allen-omega-L694/L722/reply.log new file mode 100644 index 00000000..d11a72ad --- /dev/null +++ b/evidence/allen-omega-L694/L722/reply.log @@ -0,0 +1,15 @@ +801 0 +802 0 +803 0 +804 0 +805 0 +806 0 +807 0 +808 0 +809 0 +810 0 +811 0 +812 0 +813 0 +814 0 +815 0 diff --git a/evidence/allen-omega-L694/L722/runtime.log b/evidence/allen-omega-L694/L722/runtime.log new file mode 100644 index 00000000..5168e6f3 --- /dev/null +++ b/evidence/allen-omega-L694/L722/runtime.log @@ -0,0 +1,28 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 diff --git a/evidence/allen-omega-L694/L722/scene.log b/evidence/allen-omega-L694/L722/scene.log new file mode 100644 index 00000000..44a4b2b1 --- /dev/null +++ b/evidence/allen-omega-L694/L722/scene.log @@ -0,0 +1,14 @@ +1001 0 +1002 0 +1003 0 +1004 0 +1005 0 +1006 0 +1007 0 +1008 0 +1009 0 +1010 0 +1011 0 +1012 0 +1013 0 +1014 0 diff --git a/evidence/allen-omega-L694/L722/short.log b/evidence/allen-omega-L694/L722/short.log new file mode 100644 index 00000000..a9da2dc8 --- /dev/null +++ b/evidence/allen-omega-L694/L722/short.log @@ -0,0 +1,20 @@ +401 0 +410 0 +411 0 +412 0 +413 0 +414 0 +402 0 +403 0 +404 0 +405 0 +406 0 +700 0 +701 0 +702 0 +703 0 +704 0 +705 0 +407 0 +408 0 +409 0 diff --git a/evidence/allen-omega-L694/L722/source.sha256 b/evidence/allen-omega-L694/L722/source.sha256 new file mode 100644 index 00000000..ef1fdc60 --- /dev/null +++ b/evidence/allen-omega-L694/L722/source.sha256 @@ -0,0 +1,35 @@ +184f4270c72c4eca6a7afdd28b70a608f2e237980b12c8a7bfc2c7d2c3e625b9 native/omega/allen/base.om +795ca28627a19f1088de0f23277e79cdac921ff88451c606c7b655ce0f2e8a5b native/omega/allen/build-one.sh +4d2235ac5d6b237695b1c3112f70ebdfa0cebafa2ec8e691e4be4de37a62199b native/omega/allen/code.om +76ee9cdeaac036905c76dfa29f42bf5a78d1259ad1656adfaa24916c3b93550d native/omega/allen/courier.om +e056022d8dd4a3976d5d392e52bf6a5e2bf81334ee6b3a58c61cdf56778c4d41 native/omega/allen/gate.sh +9d71a653870eeef678f95df04db9c38aedaadd06e7c74bf3e5d9fde6e28f82f8 native/omega/allen/golden.sh +06087bc573ebb876a0ed80f6025c592fb4b1d23335169c3da402824fd1482c35 native/omega/allen/intent.om +4bc37c95d553364c5d2925d8ff9e8a53b1a61974513e6f492f77b7ebb05bbda4 native/omega/allen/main.om +068292abd04d3a61b063fc5380b22a56c4235a87915c219ebf3b37d16d7bc9c7 native/omega/allen/memory.om +b4d7b6e6cd680d2ba1eec2978b0cbb81ffc63035b73f5c3726bdad97a7b6aa04 native/omega/allen/paint.om +46ba5562bcbbd808e6557f1f49e296e022c292ea0b718b1516312f10a9828cca native/omega/allen/README.md +e50a7f673aaee92aba4a3aec303aa93b071121c09ad05d4ad1dcc2deb9706dcc native/omega/allen/reply.om +5b01eae03204d08f6d207ef29f2ba09a1d9f249f1738f68f151214675a4ff2ed native/omega/allen/runtime.om +c8d4a437b41538cc1eeb62a2029c6993d41e5ef90cc7b26c8e1c92bc98ec57d3 native/omega/allen/scene.om +f085198549d1c235a97574ff6f6560ce82217611f4051fc3dbbc8286aab6d536 native/omega/allen/tests/check.om +b76438a85257bd95768115047be286c107e3723628a16a0541870732d0849a42 native/omega/allen/tests/code.om +98105e1c30626f54da07940fe0415637730b7e112ea39ba2aae1f2d648993373 native/omega/allen/tests/courier.om +f524aab74657dc2e9e4330bf42bc05ef01ce3e8f08a05c80371be0c0a33764d3 native/omega/allen/tests/edges.om +a2e8bcde92d522216a4fa99559dd3bcba096aea86127364587dadcc2bfb585af native/omega/allen/tests/fixture.om +c9ef2bee7cbd1c072c6045d62c55f3bdd938901e91792cee72ea57fb8f25a198 native/omega/allen/tests/golden.om +8ba742d85ea510586f3cf86661bc0f28c5d99b59981c2d3fb220705efad24564 native/omega/allen/tests/intent.om +861d9af698b021056cceb6c00ae3458558db415963fe832d3fca7da55731cf7b native/omega/allen/tests/memory.om +13e4db7436165783c6aad48497ffe89fa6e5ba3de928e66a766c29e1e817fcf5 native/omega/allen/tests/paint.om +e6d232d92d74d88423cebbbbfc6e403ea9b865b80c909e1d23087001d905035a native/omega/allen/tests/probe.om +8fbc8a0517900efd771a994686356416a0fea5e20cfd9bc26c787850398113df native/omega/allen/tests/render.om +094a5e833bae7dfd3b013e3f015f143e9d7bd3efe9b9c896a7f58b09e1ec14b8 native/omega/allen/tests/reply.om +bab9b0e853aa4b62918353a5d1625a3171deebfb639e599fe9751b5a61a3df62 native/omega/allen/tests/runtime.om +b9c84d9a58658589137764fe60209d8320550dd8ed99fa6026df65ba48737e4f native/omega/allen/tests/scene.om +521fff50f312b64801017b1349d9a31dac6eac50eb989d93d2dbac4e100f5007 native/omega/allen/tests/stdio-overflow.om +89aee5326b428147ea6da9aa739b6679e214ed114ae5f41d3b70299cf864092c native/omega/allen/tests/view.om +0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0 native/omega/allen/vendor/OMEGA-LICENSE +b234738e8ce81b3d67586deb41fdaab4543169d4b69e86fd3dc28a08432ab5fc native/omega/allen/vendor/PROVENANCE.md +992ec4a4957271b442740598136887a5c610effcd8ae9fb9480a006a4f181097 native/omega/allen/vendor/sha256-core.om +0781cdcec18570a57afbe3be4a6717dd2d1fa4c887b49a3e4cb542b594f8a041 native/omega/allen/vendor/sha256.om +abbefd2f7dc48f2ac28b9526f5c2e5b369da4b7c5e84dde6e6a3cd20bd5687ac native/omega/allen/view.om diff --git a/evidence/allen-omega-L694/L722/stdio-overflow.stderr b/evidence/allen-omega-L694/L722/stdio-overflow.stderr new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L722/stdio-overflow.stdout b/evidence/allen-omega-L694/L722/stdio-overflow.stdout new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L722/view.log b/evidence/allen-omega-L694/L722/view.log new file mode 100644 index 00000000..8b194f11 --- /dev/null +++ b/evidence/allen-omega-L694/L722/view.log @@ -0,0 +1,13 @@ +901 0 +902 0 +903 0 +904 0 +905 0 +906 0 +907 0 +908 0 +909 0 +910 0 +911 0 +912 0 +913 0 diff --git a/evidence/allen-omega-L694/L725/README.md b/evidence/allen-omega-L694/L725/README.md new file mode 100644 index 00000000..071985d9 --- /dev/null +++ b/evidence/allen-omega-L694/L725/README.md @@ -0,0 +1,50 @@ +# L725: native Omega courier lifecycle + +Partial host-native milestone under L694. This is not socket, Ethernet, model, +x86 EFI or physical iMac qualification. The provider must supply actual monotonic +milliseconds, link state, datagram bytes and whole-datagram send results. All new +product and executable test source is handwritten seeded Omega. Existing shell +and host tools only build, inspect, run, compare and inventory the artifacts. + +## Executed evidence + +- `full.log` and `full.exit`: complete native gate returned 0. `counts.json` + inventories 1092 executed passing checks, including 213 scheduler checks and + the original 879 checks. Existing memory/stdio goldens and stdio overflow + refusal remain passing. +- Seven compiled behavioral mutants were rejected: stale 3, CRC 2, hash 2, + readback 7, session 1, keepalive 40, ACK-stop 27. Compilation and nonempty static + AArch64 EXEC checks precede every run, including the mutants. +- `source.sha256` binds all consumed native-tree files; parent compared each + listed hash against source immediately before committing. `binaries.sha256` + binds actual native artifacts under the named handoff output directory. +- The final scheduler tests cover 4096-byte jobs across five datagrams with + byte-by-byte payload comparisons, failed-send retry, retry deadlines, HELLO/HI + readiness/expiry, ACK and LINE retry stop, duplicate GOT, queue backpressure, + cancellation, next-job reset, malformed/stale sessions and backward clocks. + +## RED and fixture corrections retained + +1. `red.om`/`red.exit`: initial test assembly omitted runtime.om, which code.om + references. Compiler error 3 is a fixture setup error, not behavioral RED. +2. `red2.om`/`red2.log`/`red2.exit`: compiled Omega stub, 78 failures among 108 + checks. The first real implementation then ran with six failures in packet + inspection (`green1.log`). Diagnosis: the existing test logger itself writes + to Outb, overwriting pending datagrams before test inspection. +3. The test-only `test` wrapper now preserves Outb/Outlen/Err around logging. + `red3` reran the compilable stub: 76 of 108 checks fail, exit 76. The same + unchanged production implementation passes all 108 (`green2`). No assertion + or production refusal was removed to resolve the fixture defect. +4. Expanded maximum-capacity/backpressure coverage passes 213 checks (`green3`), + then the combined native gate passes all 1092. The two new compiled mutants + prove the real timing and acknowledgement assertions detect behavioral faults. + +The original L719 finding and L722 RED/GREEN remain retained. The separate L723 +corrective review is archived under `../L722/corrective-review`, with exact-source +closure and binary identity checked, its three boundary probes rerun by the +parent, and positive control compared byte-for-byte. That review clears only the +stdio correction; it does not review this new scheduler. + +Independent scheduler review remains pending. The broad legacy repository strict +suite runs separately; its outcome is not inferred from this native gate. No +READY/merge/deployment/full-platform claim is made here. diff --git a/evidence/allen-omega-L694/L725/ackstop-mutant.log b/evidence/allen-omega-L694/L725/ackstop-mutant.log new file mode 100644 index 00000000..5d0598cb --- /dev/null +++ b/evidence/allen-omega-L694/L725/ackstop-mutant.log @@ -0,0 +1,213 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 1 +65 1 +66 0 +67 0 +68 0 +69 1 +70 1 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 1 +165 0 +166 0 +167 0 +168 0 +169 1 +170 0 +171 1 +172 1 +173 0 +174 1 +175 0 +176 0 +177 0 +178 1 +179 0 +180 1 +181 0 +182 1 +183 0 +184 1 +185 0 +186 1 +187 0 +188 1 +189 0 +190 1 +191 0 +192 1 +193 0 +194 1 +195 1 +196 1 +197 1 +198 0 +199 1 +200 0 +201 0 +202 1 +203 1 +204 1 +205 0 +206 1 +207 1 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 diff --git a/evidence/allen-omega-L694/L725/binaries.sha256 b/evidence/allen-omega-L694/L725/binaries.sha256 new file mode 100644 index 00000000..984a1e7e --- /dev/null +++ b/evidence/allen-omega-L694/L725/binaries.sha256 @@ -0,0 +1,23 @@ +6a815fd66fdb6886af1a8dc857d6951268b43340bfd0f5dcf5ed7e677d384357 /home/drakestapleton/handoffs/allen-omega-L694/L725/full/scheduler +3036ba651bd6825a31db6f1d9ec60ad52b1f0c56a3fd525fda6c0b1da3f1ff7b /home/drakestapleton/handoffs/allen-omega-L694/L725/full/readback-mutant +b106da82966dfc959663bf943dfd01a8f70cced034efba51e476ea78f0f0f5dc /home/drakestapleton/handoffs/allen-omega-L694/L725/full/view +3f9aae22be9800849c7a05049b0e6b0b758a5b4e67ee1e133910a66e75100c27 /home/drakestapleton/handoffs/allen-omega-L694/L725/full/allen +2259fa1fb28693c519fbe85ee7c805c8e2b7ccc5f4b29a0fb28ef7809f14dc6a /home/drakestapleton/handoffs/allen-omega-L694/L725/full/reply +e4d98c22d7c51637fd1d9d0da06eee2144fb70bbf7e435f786cc313d458887f5 /home/drakestapleton/handoffs/allen-omega-L694/L725/full/ackstop-mutant +7d3946f72b32b9a70780c79deaeea4f7f0fbb2587907106a3e4e655445f7b218 /home/drakestapleton/handoffs/allen-omega-L694/L725/full/hash-mutant +688b4eeb6c7846fb36fea2884d8296d4643dd11c74da6988793e785929ad89e4 /home/drakestapleton/handoffs/allen-omega-L694/L725/full/golden +762e48ed7daa7e2027d4e06717ff23bd11744094504e9c6ba538e2d68171d547 /home/drakestapleton/handoffs/allen-omega-L694/L725/full/session-mutant +2e6de4e1d216916e74bc08329cdabbd44681d483e1726463ceebe1d56bca1c63 /home/drakestapleton/handoffs/allen-omega-L694/L725/full/intent +b852b5d51bfcc096b2f35ea131709d28aeb26ebe1fa7626655d8abe9c67fa292 /home/drakestapleton/handoffs/allen-omega-L694/L725/full/fixture +cca90a4f538ae8150a479b5c4ea269008b7cee1fe73056e1da8e3bbcc70146da /home/drakestapleton/handoffs/allen-omega-L694/L725/full/runtime +b4aef9ff0a2b5060802824247f5f56aa9fe37e0e52b4f86c2d93b867fef6a0cd /home/drakestapleton/handoffs/allen-omega-L694/L725/full/code +4cc03fb5f9d9cc34d5d0a0dbfd68fc96d66e1e5cc0371217abbc4ec7dee9c295 /home/drakestapleton/handoffs/allen-omega-L694/L725/full/edges +c970301a150f75278d60c3599efdbbea9a17abf83d951cc289bd6062bb1e0cd8 /home/drakestapleton/handoffs/allen-omega-L694/L725/full/render +db8433262d65d28e0521a4b07bcfb98a866937d018738504581dc15894531014 /home/drakestapleton/handoffs/allen-omega-L694/L725/full/stale-mutant +929dcee90baf941017010d78ff9ca7c6e76d6c8ac71b2402b00c49c29e51144d /home/drakestapleton/handoffs/allen-omega-L694/L725/full/courier +7de38ac1871bc16d3b83d1a89730d4e567d34145588295c3ec3b34a577fb4e51 /home/drakestapleton/handoffs/allen-omega-L694/L725/full/scene +2a9151fd8824c485536e364fd3509dc8acdaff7ff3d6a9cafac189a48b1a7362 /home/drakestapleton/handoffs/allen-omega-L694/L725/full/paint +bcb251faa2cd3f2c6fbc203f0fd9b59e2fd9b961254426699b7684c64c5ea4c9 /home/drakestapleton/handoffs/allen-omega-L694/L725/full/crc-mutant +71f99242bcad6ede239b240602470fcf3d5da3267eb47a1ad522241958222367 /home/drakestapleton/handoffs/allen-omega-L694/L725/full/stdio-overflow-input +2f0e5b78f242e27e87d2b07b150d12ccbf3ebf03e3be38d45aeb67e8aa1f486c /home/drakestapleton/handoffs/allen-omega-L694/L725/full/keepalive-mutant +0865317bcebeb9dbf958344f716abcc0a3ed473ddb3cb482bbce056764d057a8 /home/drakestapleton/handoffs/allen-omega-L694/L725/full/memory diff --git a/evidence/allen-omega-L694/L725/code.log b/evidence/allen-omega-L694/L725/code.log new file mode 100644 index 00000000..e7e197b7 --- /dev/null +++ b/evidence/allen-omega-L694/L725/code.log @@ -0,0 +1,23 @@ +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 diff --git a/evidence/allen-omega-L694/L725/counts.json b/evidence/allen-omega-L694/L725/counts.json new file mode 100644 index 00000000..d4f468dd --- /dev/null +++ b/evidence/allen-omega-L694/L725/counts.json @@ -0,0 +1,19 @@ +{ + "checks": { + "runtime": 28, + "code": 23, + "courier": 24, + "scheduler": 213, + "memory": 79, + "intent": 8, + "reply": 15, + "view": 13, + "scene": 14, + "paint": 11, + "edges": 352, + "short": 20, + "long": 292 + }, + "total": 1092, + "compiled_mutants_rejected": 7 +} diff --git a/evidence/allen-omega-L694/L725/courier.log b/evidence/allen-omega-L694/L725/courier.log new file mode 100644 index 00000000..8402df49 --- /dev/null +++ b/evidence/allen-omega-L694/L725/courier.log @@ -0,0 +1,24 @@ +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 diff --git a/evidence/allen-omega-L694/L725/crc-mutant.log b/evidence/allen-omega-L694/L725/crc-mutant.log new file mode 100644 index 00000000..a0d90bd4 --- /dev/null +++ b/evidence/allen-omega-L694/L725/crc-mutant.log @@ -0,0 +1,23 @@ +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 1 +117 1 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 diff --git a/evidence/allen-omega-L694/L725/edges.log b/evidence/allen-omega-L694/L725/edges.log new file mode 100644 index 00000000..e8d0deea --- /dev/null +++ b/evidence/allen-omega-L694/L725/edges.log @@ -0,0 +1,352 @@ +1201 0 +1202 0 +1203 0 +1204 0 +1205 0 +1206 0 +1207 0 +1208 0 +1209 0 +1210 0 +1211 0 +1212 0 +1213 0 +1214 0 +1220 0 +1221 0 +1222 0 +1223 0 +1224 0 +1225 0 +1226 0 +1227 0 +1228 0 +1229 0 +1230 0 +1231 0 +1232 0 +1233 0 +1234 0 +1235 0 +1236 0 +1237 0 +1238 0 +1239 0 +1240 0 +1241 0 +1242 0 +1243 0 +1244 0 +1245 0 +1246 0 +1247 0 +1248 0 +1249 0 +1250 0 +1251 0 +1252 0 +1253 0 +1254 0 +1255 0 +1256 0 +1257 0 +1258 0 +1259 0 +1260 0 +1261 0 +1262 0 +1301 0 +1302 0 +1303 0 +1304 0 +1305 0 +1306 0 +1310 0 +1311 0 +1312 0 +1313 0 +1314 0 +1315 0 +1316 0 +1317 0 +1318 0 +1319 0 +1320 0 +1321 0 +1322 0 +1323 0 +1324 0 +1325 0 +1326 0 +1327 0 +1328 0 +1329 0 +1330 0 +1331 0 +1332 0 +1333 0 +1334 0 +1335 0 +1336 0 +1337 0 +1338 0 +1339 0 +1340 0 +1341 0 +1342 0 +1343 0 +1344 0 +1345 0 +1346 0 +1347 0 +1348 0 +1349 0 +1350 0 +1351 0 +1352 0 +1353 0 +1354 0 +1355 0 +1356 0 +1357 0 +1358 0 +1359 0 +1360 0 +1361 0 +1362 0 +1363 0 +1364 0 +1365 0 +1366 0 +1367 0 +1368 0 +1369 0 +1370 0 +1371 0 +1372 0 +1373 0 +1374 0 +1375 0 +1376 0 +1377 0 +1378 0 +1379 0 +1380 0 +1381 0 +1382 0 +1383 0 +1384 0 +1385 0 +1386 0 +1387 0 +1388 0 +1389 0 +1390 0 +1391 0 +1392 0 +1393 0 +1394 0 +1395 0 +1396 0 +1397 0 +1398 0 +1399 0 +1400 0 +1401 0 +1402 0 +1403 0 +1404 0 +1405 0 +1406 0 +1407 0 +1408 0 +1409 0 +1410 0 +1411 0 +1412 0 +1413 0 +1414 0 +1415 0 +1416 0 +1417 0 +1418 0 +1419 0 +1420 0 +1421 0 +1422 0 +1423 0 +1424 0 +1425 0 +1426 0 +1427 0 +1428 0 +1429 0 +1430 0 +1431 0 +1432 0 +1433 0 +1434 0 +1435 0 +1436 0 +1437 0 +1438 0 +1439 0 +1440 0 +1441 0 +1442 0 +1443 0 +1444 0 +1445 0 +1446 0 +1447 0 +1448 0 +1449 0 +1450 0 +1451 0 +1452 0 +1453 0 +1454 0 +1455 0 +1456 0 +1457 0 +1458 0 +1459 0 +1460 0 +1461 0 +1462 0 +1463 0 +1464 0 +1465 0 +1466 0 +1467 0 +1468 0 +1469 0 +1470 0 +1471 0 +1472 0 +1473 0 +1474 0 +1475 0 +1476 0 +1477 0 +1478 0 +1479 0 +1480 0 +1481 0 +1482 0 +1483 0 +1484 0 +1485 0 +1486 0 +1487 0 +1488 0 +1489 0 +1490 0 +1491 0 +1492 0 +1493 0 +1494 0 +1495 0 +1496 0 +1497 0 +1498 0 +1499 0 +1500 0 +1501 0 +1502 0 +1503 0 +1504 0 +1505 0 +1506 0 +1507 0 +1508 0 +1509 0 +1510 0 +1511 0 +1512 0 +1513 0 +1514 0 +1515 0 +1516 0 +1517 0 +1518 0 +1519 0 +1520 0 +1521 0 +1522 0 +1523 0 +1524 0 +1525 0 +1526 0 +1527 0 +1528 0 +1529 0 +1530 0 +1531 0 +1532 0 +1533 0 +1534 0 +1535 0 +1536 0 +1537 0 +1538 0 +1539 0 +1540 0 +1541 0 +1542 0 +1543 0 +1544 0 +1545 0 +1546 0 +1547 0 +1548 0 +1549 0 +1550 0 +1551 0 +1552 0 +1553 0 +1554 0 +1555 0 +1556 0 +1557 0 +1558 0 +1559 0 +1560 0 +1561 0 +1562 0 +1563 0 +1564 0 +1565 0 +1570 0 +1571 0 +1572 0 +1575 0 +1573 0 +1574 0 +1600 0 +1601 0 +1602 0 +1603 0 +1604 0 +1605 0 +1606 0 +1607 0 +1610 0 +1611 0 +1612 0 +1613 0 +1614 0 +1615 0 +1616 0 +1617 0 +1701 0 +1702 0 +1703 0 +1704 0 +1705 0 +1706 0 +1707 0 +1708 0 +1709 0 +1710 0 +1711 0 diff --git a/evidence/allen-omega-L694/L725/full.exit b/evidence/allen-omega-L694/L725/full.exit new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/L725/full.exit @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/L725/full.log b/evidence/allen-omega-L694/L725/full.log new file mode 100644 index 00000000..e681192a --- /dev/null +++ b/evidence/allen-omega-L694/L725/full.log @@ -0,0 +1,24 @@ +runtime compile=0 native-exit=0 +code compile=0 native-exit=0 +courier compile=0 native-exit=0 +scheduler compile=0 native-exit=0 +memory compile=0 native-exit=0 +intent compile=0 native-exit=0 +reply compile=0 native-exit=0 +view compile=0 native-exit=0 +scene compile=0 native-exit=0 +paint compile=0 native-exit=0 +edges compile=0 native-exit=0 +fixture compile=0 native-exit=0 +golden compile=0 native-exit=0 +render compile=0 native-exit=0 +stdio native-exit=0 golden-cmp=0 +stdio overflow native-exit=65 no-later-command=PASS +stale mutant compile=0 rejected-exit=3 +crc mutant compile=0 rejected-exit=2 +hash mutant compile=0 rejected-exit=2 +readback mutant compile=0 rejected-exit=7 +session mutant compile=0 rejected-exit=1 +keepalive mutant compile=0 rejected-exit=40 +ackstop mutant compile=0 rejected-exit=27 +ALLEN_OMEGA_HOST: PASS; target=NOT_RUN; live=NOT_RUN diff --git a/evidence/allen-omega-L694/L725/green1.exit b/evidence/allen-omega-L694/L725/green1.exit new file mode 100644 index 00000000..1e8b3149 --- /dev/null +++ b/evidence/allen-omega-L694/L725/green1.exit @@ -0,0 +1 @@ +6 diff --git a/evidence/allen-omega-L694/L725/green1.log b/evidence/allen-omega-L694/L725/green1.log new file mode 100644 index 00000000..be7f31cb --- /dev/null +++ b/evidence/allen-omega-L694/L725/green1.log @@ -0,0 +1,108 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 1 +37 1 +38 1 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 1 +47 1 +48 1 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 diff --git a/evidence/allen-omega-L694/L725/green2.exit b/evidence/allen-omega-L694/L725/green2.exit new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/L725/green2.exit @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/L725/green2.log b/evidence/allen-omega-L694/L725/green2.log new file mode 100644 index 00000000..eae3b0e8 --- /dev/null +++ b/evidence/allen-omega-L694/L725/green2.log @@ -0,0 +1,108 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 diff --git a/evidence/allen-omega-L694/L725/green3.exit b/evidence/allen-omega-L694/L725/green3.exit new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/L725/green3.exit @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/L725/green3.log b/evidence/allen-omega-L694/L725/green3.log new file mode 100644 index 00000000..1d8ffd12 --- /dev/null +++ b/evidence/allen-omega-L694/L725/green3.log @@ -0,0 +1,213 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 +183 0 +184 0 +185 0 +186 0 +187 0 +188 0 +189 0 +190 0 +191 0 +192 0 +193 0 +194 0 +195 0 +196 0 +197 0 +198 0 +199 0 +200 0 +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 diff --git a/evidence/allen-omega-L694/L725/hash-mutant.log b/evidence/allen-omega-L694/L725/hash-mutant.log new file mode 100644 index 00000000..c75cfefb --- /dev/null +++ b/evidence/allen-omega-L694/L725/hash-mutant.log @@ -0,0 +1,79 @@ +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 1 +310 1 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +362 0 +363 0 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 0 +361 0 diff --git a/evidence/allen-omega-L694/L725/independent-review/hello.expected b/evidence/allen-omega-L694/L725/independent-review/hello.expected new file mode 100644 index 00000000..d6d7c0c9 --- /dev/null +++ b/evidence/allen-omega-L694/L725/independent-review/hello.expected @@ -0,0 +1 @@ +ALLEN-COURIER v=1 run=000000000000004d kind=HELLO seq=0 part=0/0 bytes=0 diff --git a/evidence/allen-omega-L694/L725/independent-review/lifecycle-review.full.om b/evidence/allen-omega-L694/L725/independent-review/lifecycle-review.full.om new file mode 100644 index 00000000..1b076d8d --- /dev/null +++ b/evidence/allen-omega-L694/L725/independent-review/lifecycle-review.full.om @@ -0,0 +1,2764 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +note Independent serialized lifecycle boundary probes; all assertions run in Omega. +global SavedOut uchar 8192 +fn test ok bool to void +n = get Outlen 0 +e = get Err 0 +for i ulong n +put SavedOut i get Outb i +end +check ok add get Checks 0 1 +for i ulong n +put Outb i get SavedOut i +end +put Outlen 0 n +put Err 0 e +end +fn copyout to void +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +end +fn controlr kind ulong to void +put Inlen 0 0 +b = packet kind get Q 1 0 0 0 +copyout +end +fn liner part ulong value ulong to void +put Inlen 0 1 +put In 0 uchar value +b = packet 2 get Q 1 part 0 0 +copyout +end +fn main to int +test qstart 77 100 +test qnext 100 true +test qsent 100 true +test not qnext 2099 true +test qnext 2100 true +test qsent 2100 true +controlr 6 +test eq qincoming 2101 1 +test qready 2101 +note First failed JOB must be immediately retryable; ACK while no send is outstanding then suppresses retries. +put Inlen 0 3 +put In 0 65 +put In 1 66 +put In 2 67 +test qsubmit 2102 +test qnext 2102 true +test eq get T 10 1 +test qsent 2102 false +test eq get T 10 0 +test qnext 2102 true +test qsent 2102 true +controlr 4 +test eq qincoming 2103 1 +test eq get T 6 1 +test not qnext 4101 true +note Send one line, fail its GOT, then accept duplicate and retry GOT until success. +liner 1 65 +test eq qincoming 4102 1 +test qnext 4102 true +test eq get T 10 3 +test qsent 4102 false +test eq get T 13 1 +liner 1 65 +test eq qincoming 4103 2 +test qnext 4103 true +test qsent 4103 true +test eq get T 13 0 +test qtake +test eq get In 0 65 +test not qtake +note Pending GOT is discarded by cancel; cancelled sequence cannot later emit old receipt. +liner 2 66 +test eq qincoming 4104 1 +test qnext 4104 true +test eq get T 10 3 +qcancel +test eq get T 10 0 +test eq get T 13 0 +test not qsent 4104 true +test not qnext 4104 true +test eq get Q 4 0 +note New submission after cancel uses new sequence; stale old ACK is rejected. +put Inlen 0 1 +put In 0 90 +test qsubmit 4105 +test eq get Q 1 2 +put Inlen 0 0 +b = packet 4 1 0 0 0 +copyout +test eq qincoming 4106 0 +test eq get T 6 0 +test qnext 4106 true +test eq get T 10 1 +test qsent 4106 true +controlr 4 +test eq qincoming 4107 1 +note Existing ready state expires at the strict 30000ms edge, then HELLO uses 2s. +test qready 32100 +test qnext 32100 true +test qsent 32100 true +test not qready 32101 +test not qnext 32101 true +test qnext 34100 true +test eq get T 10 5 +test qsent 34106 true +note Once any LINE is accepted, a later backward-clock packet cannot move clock/state. +liner 1 82 +test eq qincoming 34107 1 +old = get T 0 +liner 2 83 +test eq qincoming 34106 0 +test eq get T 0 old +test eq get Q 2 1 +ret int get Fails 0 +end diff --git a/evidence/allen-omega-L694/L725/independent-review/lifecycle-review.log b/evidence/allen-omega-L694/L725/independent-review/lifecycle-review.log new file mode 100644 index 00000000..9a5ae0eb --- /dev/null +++ b/evidence/allen-omega-L694/L725/independent-review/lifecycle-review.log @@ -0,0 +1,58 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 diff --git a/evidence/allen-omega-L694/L725/independent-review/lifecycle-review.om b/evidence/allen-omega-L694/L725/independent-review/lifecycle-review.om new file mode 100644 index 00000000..37e29b0e --- /dev/null +++ b/evidence/allen-omega-L694/L725/independent-review/lifecycle-review.om @@ -0,0 +1,118 @@ +note Independent serialized lifecycle boundary probes; all assertions run in Omega. +global SavedOut uchar 8192 +fn test ok bool to void +n = get Outlen 0 +e = get Err 0 +for i ulong n +put SavedOut i get Outb i +end +check ok add get Checks 0 1 +for i ulong n +put Outb i get SavedOut i +end +put Outlen 0 n +put Err 0 e +end +fn copyout to void +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +end +fn controlr kind ulong to void +put Inlen 0 0 +b = packet kind get Q 1 0 0 0 +copyout +end +fn liner part ulong value ulong to void +put Inlen 0 1 +put In 0 uchar value +b = packet 2 get Q 1 part 0 0 +copyout +end +fn main to int +test qstart 77 100 +test qnext 100 true +test qsent 100 true +test not qnext 2099 true +test qnext 2100 true +test qsent 2100 true +controlr 6 +test eq qincoming 2101 1 +test qready 2101 +note First failed JOB must be immediately retryable; ACK while no send is outstanding then suppresses retries. +put Inlen 0 3 +put In 0 65 +put In 1 66 +put In 2 67 +test qsubmit 2102 +test qnext 2102 true +test eq get T 10 1 +test qsent 2102 false +test eq get T 10 0 +test qnext 2102 true +test qsent 2102 true +controlr 4 +test eq qincoming 2103 1 +test eq get T 6 1 +test not qnext 4101 true +note Send one line, fail its GOT, then accept duplicate and retry GOT until success. +liner 1 65 +test eq qincoming 4102 1 +test qnext 4102 true +test eq get T 10 3 +test qsent 4102 false +test eq get T 13 1 +liner 1 65 +test eq qincoming 4103 2 +test qnext 4103 true +test qsent 4103 true +test eq get T 13 0 +test qtake +test eq get In 0 65 +test not qtake +note Pending GOT is discarded by cancel; cancelled sequence cannot later emit old receipt. +liner 2 66 +test eq qincoming 4104 1 +test qnext 4104 true +test eq get T 10 3 +qcancel +test eq get T 10 0 +test eq get T 13 0 +test not qsent 4104 true +test not qnext 4104 true +test eq get Q 4 0 +note New submission after cancel uses new sequence; stale old ACK is rejected. +put Inlen 0 1 +put In 0 90 +test qsubmit 4105 +test eq get Q 1 2 +put Inlen 0 0 +b = packet 4 1 0 0 0 +copyout +test eq qincoming 4106 0 +test eq get T 6 0 +test qnext 4106 true +test eq get T 10 1 +test qsent 4106 true +controlr 4 +test eq qincoming 4107 1 +note Existing ready state expires at the strict 30000ms edge, then HELLO uses 2s. +test qready 32100 +test qnext 32100 true +test qsent 32100 true +test not qready 32101 +test not qnext 32101 true +test qnext 34100 true +test eq get T 10 5 +test qsent 34106 true +note Once any LINE is accepted, a later backward-clock packet cannot move clock/state. +liner 1 82 +test eq qincoming 34107 1 +old = get T 0 +liner 2 83 +test eq qincoming 34106 0 +test eq get T 0 old +test eq get Q 2 1 +ret int get Fails 0 +end diff --git a/evidence/allen-omega-L694/L725/independent-review/parent-verification.json b/evidence/allen-omega-L694/L725/independent-review/parent-verification.json new file mode 100644 index 00000000..36dc9db2 --- /dev/null +++ b/evidence/allen-omega-L694/L725/independent-review/parent-verification.json @@ -0,0 +1,13 @@ +{ + "source": "ae16b168e3c135a4770b4400f4cb9a18dcb289f4", + "exact_core_and_test_closure": true, + "checks": { + "scheduler": 213, + "lifecycle-review": 58 + }, + "parent_rebuild_byte_identical": true, + "parent_probe_exit": 0, + "wire_bytes": 73, + "wire_cmp": 0, + "scope": "host-only; transport and target unqualified" +} diff --git a/evidence/allen-omega-L694/L725/independent-review/report.md b/evidence/allen-omega-L694/L725/independent-review/report.md new file mode 100644 index 00000000..20459335 --- /dev/null +++ b/evidence/allen-omega-L694/L725/independent-review/report.md @@ -0,0 +1,27 @@ +# L730 independent review — native Omega courier lifecycle + +## Scope and provenance + +- Reviewed exact candidate `ae16b168e3c135a4770b4400f4cb9a18dcb289f4` against parent `13d02ab4b7145579f6d3faa53442167bfcdcd7bc` in `~/workspace/aienos-allen-omega-L694`. +- Exported candidate source to `~/handoffs/L730-review/source` and rebuilt from that immutable export; local git worktree was clean at review start. +- Reviewed `native/omega/allen/scheduler.om`, its regression suite and API documentation, the reused Omega courier core, and legacy `native/kernel/x86/courier_udp.h` / `courier_udp_x86.c` wire behavior. +- Compiler SHA-256: `191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9`. + +## Results + +**No findings** in the reviewed serialized lifecycle and tested boundary sequences. + +Executed from the exact export with the pinned `build-one.sh` path: + +1. Rebuilt and ran the narrow scheduler suite: compile exit 0, static AArch64 ELF64 EXEC with no `INTERP`/`NEEDED`, native exit 0, `213` assertions and `0` failures. Combined source SHA-256 `f92c69dd168d6f95984c9150af0544f11a9b265b4aa350e15dc3e3b7bf1de947`; executable SHA-256 `6a815fd66fdb6886af1a8dc857d6951268b43340bfd0f5dcf5ed7e677d384357`. +2. Independently authored and ran `build/lifecycle-review.om` as Omega against the candidate scheduler. Compile exit 0, native exit 0, `58` assertions, `0` failures. Sequences covered failed JOB send/retry, ACK suppressing retries, failed GOT retained through duplicate/retry, `qcancel` discarding pending receipt, post-cancel sequence advancement and stale ACK refusal, strict HI expiry and 2s/10s HELLO timing, and backward-clock LINE refusal without state movement. Full-probe source SHA-256 `46096dd4e85af3c5338088a9b5842cc53286f1eca7a09baf2b5eefe7ed164074`; executable SHA-256 `0e0ecd1704cc4bb5b8187e1b2fd0899b353f1acf78f5ab39b92dc90cfb14aaff`. +3. Built and executed a separate minimal Omega program producing the first HELLO, then compared the resulting bytes with the literal legacy header form using `cmp`: **PASS**, 73 bytes exact (`ALLEN-COURIER v=1 run=000000000000004d kind=HELLO seq=0 part=0/0 bytes=0\n`). Wire executable SHA-256 `7e34ddd7422c798c7abd1f1e551f793152539a5ff431d3c175168c43e2b5f08c`; raw emitted bytes SHA-256 `a33f0ab1a0cbf950f93fb4b85808f4b8af02271426c8f60583060a95bde4f801`. + +The existing courier parser binds packets to the current run and sequence; the lifecycle suite exercises retries, ordered line delivery/duplicate receipts, queue-full recovery, cancellation and refusal boundaries. No source or production files were modified. No live sockets, service/device calls, iMac or physical-target qualification were performed or inferred; this is host-only native execution, not transport/deployment qualification. + +## Review artifacts + +- Export: `~/handoffs/L730-review/source` +- Narrow native suite executable/log/source: `~/handoffs/L730-review/build/scheduler`, `scheduler.log`, `scheduler.om` +- Independent Omega probe source/full-source/executable/log: `~/handoffs/L730-review/build/lifecycle-review.om`, `lifecycle-review.full.om`, `lifecycle-review`, `lifecycle-review.log` +- Wire probe source/executable/raw bytes/expected bytes: `~/handoffs/L730-review/build/wire.om`, `wire`, `wire.bin`, `hello.expected` diff --git a/evidence/allen-omega-L694/L725/independent-review/scheduler.log b/evidence/allen-omega-L694/L725/independent-review/scheduler.log new file mode 100644 index 00000000..1d8ffd12 --- /dev/null +++ b/evidence/allen-omega-L694/L725/independent-review/scheduler.log @@ -0,0 +1,213 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 +183 0 +184 0 +185 0 +186 0 +187 0 +188 0 +189 0 +190 0 +191 0 +192 0 +193 0 +194 0 +195 0 +196 0 +197 0 +198 0 +199 0 +200 0 +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 diff --git a/evidence/allen-omega-L694/L725/independent-review/wire.bin b/evidence/allen-omega-L694/L725/independent-review/wire.bin new file mode 100644 index 00000000..d6d7c0c9 --- /dev/null +++ b/evidence/allen-omega-L694/L725/independent-review/wire.bin @@ -0,0 +1 @@ +ALLEN-COURIER v=1 run=000000000000004d kind=HELLO seq=0 part=0/0 bytes=0 diff --git a/evidence/allen-omega-L694/L725/independent-review/wire.full.om b/evidence/allen-omega-L694/L725/independent-review/wire.full.om new file mode 100644 index 00000000..804a550a --- /dev/null +++ b/evidence/allen-omega-L694/L725/independent-review/wire.full.om @@ -0,0 +1,2635 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +fn main to int +a = qstart 77 100 +b = qnext 100 true +w = write 1 Outb 0 get Outlen 0 +ret 0 +end diff --git a/evidence/allen-omega-L694/L725/independent-review/wire.om b/evidence/allen-omega-L694/L725/independent-review/wire.om new file mode 100644 index 00000000..63d75935 --- /dev/null +++ b/evidence/allen-omega-L694/L725/independent-review/wire.om @@ -0,0 +1,6 @@ +fn main to int +a = qstart 77 100 +b = qnext 100 true +w = write 1 Outb 0 get Outlen 0 +ret 0 +end diff --git a/evidence/allen-omega-L694/L725/intent.log b/evidence/allen-omega-L694/L725/intent.log new file mode 100644 index 00000000..5371bd36 --- /dev/null +++ b/evidence/allen-omega-L694/L725/intent.log @@ -0,0 +1,8 @@ +501 0 +502 0 +503 0 +504 0 +505 0 +506 0 +507 0 +508 0 diff --git a/evidence/allen-omega-L694/L725/keepalive-mutant.log b/evidence/allen-omega-L694/L725/keepalive-mutant.log new file mode 100644 index 00000000..2e3415df --- /dev/null +++ b/evidence/allen-omega-L694/L725/keepalive-mutant.log @@ -0,0 +1,213 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 1 +19 1 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 1 +54 1 +55 1 +56 1 +57 0 +58 0 +59 1 +60 0 +61 0 +62 0 +63 0 +64 0 +65 1 +66 0 +67 0 +68 0 +69 1 +70 1 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 1 +170 0 +171 1 +172 1 +173 0 +174 1 +175 0 +176 0 +177 0 +178 1 +179 1 +180 1 +181 1 +182 1 +183 1 +184 1 +185 1 +186 1 +187 1 +188 1 +189 1 +190 1 +191 1 +192 1 +193 1 +194 1 +195 1 +196 1 +197 1 +198 0 +199 1 +200 0 +201 0 +202 1 +203 1 +204 1 +205 0 +206 1 +207 1 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 diff --git a/evidence/allen-omega-L694/L725/long.log b/evidence/allen-omega-L694/L725/long.log new file mode 100644 index 00000000..0a060bc8 --- /dev/null +++ b/evidence/allen-omega-L694/L725/long.log @@ -0,0 +1,292 @@ +401 0 +410 0 +411 0 +412 0 +413 0 +414 0 +415 0 +416 0 +417 0 +418 0 +419 0 +420 0 +421 0 +422 0 +423 0 +424 0 +425 0 +426 0 +427 0 +428 0 +429 0 +430 0 +431 0 +432 0 +433 0 +434 0 +435 0 +436 0 +437 0 +438 0 +439 0 +440 0 +441 0 +442 0 +443 0 +444 0 +445 0 +446 0 +447 0 +448 0 +449 0 +450 0 +451 0 +452 0 +453 0 +454 0 +455 0 +456 0 +457 0 +458 0 +459 0 +460 0 +461 0 +462 0 +463 0 +464 0 +465 0 +466 0 +467 0 +468 0 +469 0 +470 0 +471 0 +472 0 +473 0 +474 0 +475 0 +476 0 +477 0 +478 0 +479 0 +480 0 +481 0 +482 0 +483 0 +484 0 +485 0 +486 0 +487 0 +488 0 +489 0 +490 0 +491 0 +492 0 +493 0 +494 0 +495 0 +496 0 +497 0 +498 0 +499 0 +500 0 +501 0 +502 0 +503 0 +504 0 +505 0 +506 0 +507 0 +508 0 +509 0 +510 0 +511 0 +512 0 +513 0 +514 0 +515 0 +516 0 +517 0 +518 0 +519 0 +520 0 +521 0 +522 0 +523 0 +524 0 +525 0 +526 0 +527 0 +528 0 +529 0 +530 0 +531 0 +532 0 +533 0 +534 0 +535 0 +536 0 +537 0 +538 0 +539 0 +540 0 +541 0 +542 0 +543 0 +544 0 +545 0 +546 0 +547 0 +548 0 +549 0 +550 0 +402 0 +403 0 +404 0 +405 0 +406 0 +700 0 +701 0 +702 0 +703 0 +704 0 +705 0 +706 0 +707 0 +708 0 +709 0 +710 0 +711 0 +712 0 +713 0 +714 0 +715 0 +716 0 +717 0 +718 0 +719 0 +720 0 +721 0 +722 0 +723 0 +724 0 +725 0 +726 0 +727 0 +728 0 +729 0 +730 0 +731 0 +732 0 +733 0 +734 0 +735 0 +736 0 +737 0 +738 0 +739 0 +740 0 +741 0 +742 0 +743 0 +744 0 +745 0 +746 0 +747 0 +748 0 +749 0 +750 0 +751 0 +752 0 +753 0 +754 0 +755 0 +756 0 +757 0 +758 0 +759 0 +760 0 +761 0 +762 0 +763 0 +764 0 +765 0 +766 0 +767 0 +768 0 +769 0 +770 0 +771 0 +772 0 +773 0 +774 0 +775 0 +776 0 +777 0 +778 0 +779 0 +780 0 +781 0 +782 0 +783 0 +784 0 +785 0 +786 0 +787 0 +788 0 +789 0 +790 0 +791 0 +792 0 +793 0 +794 0 +795 0 +796 0 +797 0 +798 0 +799 0 +800 0 +801 0 +802 0 +803 0 +804 0 +805 0 +806 0 +807 0 +808 0 +809 0 +810 0 +811 0 +812 0 +813 0 +814 0 +815 0 +816 0 +817 0 +818 0 +819 0 +820 0 +821 0 +822 0 +823 0 +824 0 +825 0 +826 0 +827 0 +828 0 +829 0 +830 0 +831 0 +832 0 +833 0 +834 0 +835 0 +836 0 +837 0 +838 0 +839 0 +840 0 +841 0 +407 0 +408 0 +409 0 diff --git a/evidence/allen-omega-L694/L725/memory.log b/evidence/allen-omega-L694/L725/memory.log new file mode 100644 index 00000000..5928102e --- /dev/null +++ b/evidence/allen-omega-L694/L725/memory.log @@ -0,0 +1,79 @@ +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 0 +310 0 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +362 0 +363 0 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 0 +361 0 diff --git a/evidence/allen-omega-L694/L725/paint.log b/evidence/allen-omega-L694/L725/paint.log new file mode 100644 index 00000000..281a5bd2 --- /dev/null +++ b/evidence/allen-omega-L694/L725/paint.log @@ -0,0 +1,11 @@ +1101 0 +1102 0 +1103 0 +1104 0 +1105 0 +1106 0 +1107 0 +1108 0 +1109 0 +1110 0 +1111 0 diff --git a/evidence/allen-omega-L694/L725/readback-mutant.log b/evidence/allen-omega-L694/L725/readback-mutant.log new file mode 100644 index 00000000..268002ad --- /dev/null +++ b/evidence/allen-omega-L694/L725/readback-mutant.log @@ -0,0 +1,79 @@ +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 0 +310 0 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 1 +339 1 +340 0 +341 0 +342 0 +343 0 +344 1 +345 0 +346 0 +347 0 +348 0 +349 1 +350 1 +351 0 +352 0 +362 0 +363 0 +353 1 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 1 +361 0 diff --git a/evidence/allen-omega-L694/L725/red.exit b/evidence/allen-omega-L694/L725/red.exit new file mode 100644 index 00000000..00750edc --- /dev/null +++ b/evidence/allen-omega-L694/L725/red.exit @@ -0,0 +1 @@ +3 diff --git a/evidence/allen-omega-L694/L725/red.om b/evidence/allen-omega-L694/L725/red.om new file mode 100644 index 00000000..6d248235 --- /dev/null +++ b/evidence/allen-omega-L694/L725/red.om @@ -0,0 +1,834 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note L725 compilable behavioral stub, retained only in RED evidence. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +ret false +end +fn qready now ulong to bool +ret false +end +fn qsubmit now ulong to bool +ret false +end +fn qnext now ulong link bool to bool +ret false +end +fn qsent now ulong ok bool to bool +ret false +end +fn qincoming now ulong to ulong +ret 0 +end +fn qcancel to void +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +note Native courier lifecycle regression. Clock values are injected milliseconds. +text Lineone "SAY 1 1/1 Model text." +fn test ok bool to void +check ok add get Checks 0 1 +end +fn tcopy to void +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +end +fn control kind ulong seq ulong to void +put Inlen 0 0 +b = packet kind seq 0 0 0 +tcopy +end +fn linepkt part ulong to void +put Inlen 0 len Lineone +for i ulong len Lineone +put In i get Lineone i +end +b = packet 2 get Q 1 part 0 0 +tcopy +end +fn jobinput to void +put Inlen 0 1001 +for i ulong 1001 +put In i 120 +end +put In 999 10 +put In 1000 121 +end +fn main to int +test qstart 42 100 +test not qready 100 +test not qnext 100 false +test eq get T 3 0 +test qnext 100 true +test eq get T 10 5 +test not qnext 100 true +test qsent 100 false +test eq get T 3 0 +test qnext 101 true +test qsent 101 true +test eq get T 3 1 +test not qnext 2100 true +test qnext 2101 true +test qsent 2101 true +control 6 0 +test eq qincoming 2102 1 +test qready 2102 +test not qnext 12100 true +test qnext 12101 true +test eq get T 10 5 +test qsent 12101 true +test qready 32101 +test not qready 32102 +test qnext 32102 true +test qsent 32102 true +test not qnext 32101 true +test eq get T 0 32102 +jobinput +test qsubmit 32103 +test eq get Q 1 1 +test eq get JobOut 999 32 +test eq get JobOut 1000 121 +test not qsubmit 32103 +test qnext 32103 true +test eq get T 10 1 +test eq get T 11 1 +tcopy +test pkparse +test eq get N 6 1000 +test eq get In add get N 5 999 32 +test qsent 32103 false +test eq get T 9 1 +test qnext 32104 true +test eq get T 11 1 +test qsent 32104 true +test qnext 32104 true +test eq get T 11 2 +tcopy +test pkparse +test eq get N 6 1 +test eq get In get N 5 121 +test qsent 32104 true +test eq get T 9 0 +control 6 0 +test eq qincoming 32105 1 +test qready 32105 +test not qnext 34103 true +test qnext 34104 true +test eq get T 10 1 +test eq get T 11 1 +test qsent 34104 true +test qnext 34104 true +test eq get T 11 2 +test qsent 34104 true +control 4 2 +test eq qincoming 34105 0 +test eq get T 6 0 +control 4 1 +test eq qincoming 34105 1 +test eq get T 6 1 +test not qnext 36104 true +linepkt 1 +test eq qincoming 36105 1 +test eq get Q 4 1 +test eq get T 13 1 +test qnext 36105 true +test eq get T 10 3 +test qsent 36105 false +test eq get T 13 1 +linepkt 1 +test eq qincoming 36106 2 +test eq get Q 4 1 +test qnext 36106 true +test eq get T 10 3 +test qsent 36106 true +test eq get T 13 0 +test qtake +test eq get Inlen 0 len Lineone +test not qtake +linepkt 2 +test eq qincoming 36107 1 +linepkt 3 +test eq qincoming 36107 0 +test eq get Q 2 2 +test eq get Q 4 1 +test qnext 36108 true +test qsent 36108 true +linepkt 3 +test eq qincoming 36109 1 +test eq get Q 2 3 +qcancel +test eq get T 5 0 +linepkt 4 +test eq qincoming 36110 0 +jobinput +test qsubmit 36111 +test eq get Q 1 2 +test eq get Q 4 0 +control 6 0 +test eq qincoming 36112 1 +control 6 0 +put In 22 49 +test eq qincoming 36113 0 +test eq get T 2 36112 +control 4 2 +test eq qincoming 36110 0 +test eq get T 6 0 +qcancel +put Q 1 4294967295 +jobinput +test not qsubmit 36114 +test eq get Q 1 4294967295 +test not qstart 0 36114 +test eq get Q 0 42 +test qstart 43 0 +put Inlen 0 4097 +test not qsubmit 0 +test eq get Q 1 0 +put Inlen 0 0 +test not qsubmit 0 +test not qsent 0 true +ret int get Fails 0 +end diff --git a/evidence/allen-omega-L694/L725/red2.exit b/evidence/allen-omega-L694/L725/red2.exit new file mode 100644 index 00000000..8e14edce --- /dev/null +++ b/evidence/allen-omega-L694/L725/red2.exit @@ -0,0 +1 @@ +78 diff --git a/evidence/allen-omega-L694/L725/red2.log b/evidence/allen-omega-L694/L725/red2.log new file mode 100644 index 00000000..852ff9e0 --- /dev/null +++ b/evidence/allen-omega-L694/L725/red2.log @@ -0,0 +1,108 @@ +1 1 +2 0 +3 0 +4 0 +5 1 +6 1 +7 0 +8 1 +9 0 +10 1 +11 1 +12 1 +13 0 +14 1 +15 1 +16 1 +17 1 +18 0 +19 1 +20 1 +21 1 +22 1 +23 0 +24 1 +25 1 +26 0 +27 1 +28 1 +29 1 +30 1 +31 1 +32 0 +33 1 +34 1 +35 1 +36 1 +37 1 +38 1 +39 1 +40 1 +41 1 +42 1 +43 1 +44 1 +45 1 +46 1 +47 1 +48 1 +49 1 +50 0 +51 1 +52 1 +53 0 +54 1 +55 1 +56 1 +57 1 +58 1 +59 1 +60 1 +61 0 +62 0 +63 1 +64 1 +65 0 +66 1 +67 1 +68 1 +69 1 +70 1 +71 1 +72 1 +73 1 +74 1 +75 1 +76 1 +77 1 +78 0 +79 1 +80 1 +81 0 +82 1 +83 0 +84 1 +85 1 +86 1 +87 1 +88 1 +89 1 +90 0 +91 0 +92 1 +93 1 +94 0 +95 1 +96 0 +97 1 +98 0 +99 0 +100 0 +101 0 +102 0 +103 1 +104 1 +105 0 +106 1 +107 0 +108 0 diff --git a/evidence/allen-omega-L694/L725/red2.om b/evidence/allen-omega-L694/L725/red2.om new file mode 100644 index 00000000..ff7cf4b2 --- /dev/null +++ b/evidence/allen-omega-L694/L725/red2.om @@ -0,0 +1,979 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note L725 compilable behavioral stub, retained only in RED evidence. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +ret false +end +fn qready now ulong to bool +ret false +end +fn qsubmit now ulong to bool +ret false +end +fn qnext now ulong link bool to bool +ret false +end +fn qsent now ulong ok bool to bool +ret false +end +fn qincoming now ulong to ulong +ret 0 +end +fn qcancel to void +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +note Native courier lifecycle regression. Clock values are injected milliseconds. +text Lineone "SAY 1 1/1 Model text." +fn test ok bool to void +check ok add get Checks 0 1 +end +fn tcopy to void +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +end +fn control kind ulong seq ulong to void +put Inlen 0 0 +b = packet kind seq 0 0 0 +tcopy +end +fn linepkt part ulong to void +put Inlen 0 len Lineone +for i ulong len Lineone +put In i get Lineone i +end +b = packet 2 get Q 1 part 0 0 +tcopy +end +fn jobinput to void +put Inlen 0 1001 +for i ulong 1001 +put In i 120 +end +put In 999 10 +put In 1000 121 +end +fn main to int +test qstart 42 100 +test not qready 100 +test not qnext 100 false +test eq get T 3 0 +test qnext 100 true +test eq get T 10 5 +test not qnext 100 true +test qsent 100 false +test eq get T 3 0 +test qnext 101 true +test qsent 101 true +test eq get T 3 1 +test not qnext 2100 true +test qnext 2101 true +test qsent 2101 true +control 6 0 +test eq qincoming 2102 1 +test qready 2102 +test not qnext 12100 true +test qnext 12101 true +test eq get T 10 5 +test qsent 12101 true +test qready 32101 +test not qready 32102 +test qnext 32102 true +test qsent 32102 true +test not qnext 32101 true +test eq get T 0 32102 +jobinput +test qsubmit 32103 +test eq get Q 1 1 +test eq get JobOut 999 32 +test eq get JobOut 1000 121 +test not qsubmit 32103 +test qnext 32103 true +test eq get T 10 1 +test eq get T 11 1 +tcopy +test pkparse +test eq get N 6 1000 +test eq get In add get N 5 999 32 +test qsent 32103 false +test eq get T 9 1 +test qnext 32104 true +test eq get T 11 1 +test qsent 32104 true +test qnext 32104 true +test eq get T 11 2 +tcopy +test pkparse +test eq get N 6 1 +test eq get In get N 5 121 +test qsent 32104 true +test eq get T 9 0 +control 6 0 +test eq qincoming 32105 1 +test qready 32105 +test not qnext 34103 true +test qnext 34104 true +test eq get T 10 1 +test eq get T 11 1 +test qsent 34104 true +test qnext 34104 true +test eq get T 11 2 +test qsent 34104 true +control 4 2 +test eq qincoming 34105 0 +test eq get T 6 0 +control 4 1 +test eq qincoming 34105 1 +test eq get T 6 1 +test not qnext 36104 true +linepkt 1 +test eq qincoming 36105 1 +test eq get Q 4 1 +test eq get T 13 1 +test qnext 36105 true +test eq get T 10 3 +test qsent 36105 false +test eq get T 13 1 +linepkt 1 +test eq qincoming 36106 2 +test eq get Q 4 1 +test qnext 36106 true +test eq get T 10 3 +test qsent 36106 true +test eq get T 13 0 +test qtake +test eq get Inlen 0 len Lineone +test not qtake +linepkt 2 +test eq qincoming 36107 1 +linepkt 3 +test eq qincoming 36107 0 +test eq get Q 2 2 +test eq get Q 4 1 +test qnext 36108 true +test qsent 36108 true +linepkt 3 +test eq qincoming 36109 1 +test eq get Q 2 3 +qcancel +test eq get T 5 0 +linepkt 4 +test eq qincoming 36110 0 +jobinput +test qsubmit 36111 +test eq get Q 1 2 +test eq get Q 4 0 +control 6 0 +test eq qincoming 36112 1 +control 6 0 +put In 22 49 +test eq qincoming 36113 0 +test eq get T 2 36112 +control 4 2 +test eq qincoming 36110 0 +test eq get T 6 0 +qcancel +put Q 1 4294967295 +jobinput +test not qsubmit 36114 +test eq get Q 1 4294967295 +test not qstart 0 36114 +test eq get Q 0 42 +test qstart 43 0 +put Inlen 0 4097 +test not qsubmit 0 +test eq get Q 1 0 +put Inlen 0 0 +test not qsubmit 0 +test not qsent 0 true +ret int get Fails 0 +end diff --git a/evidence/allen-omega-L694/L725/red3.exit b/evidence/allen-omega-L694/L725/red3.exit new file mode 100644 index 00000000..dd475631 --- /dev/null +++ b/evidence/allen-omega-L694/L725/red3.exit @@ -0,0 +1 @@ +76 diff --git a/evidence/allen-omega-L694/L725/red3.log b/evidence/allen-omega-L694/L725/red3.log new file mode 100644 index 00000000..e47b4d39 --- /dev/null +++ b/evidence/allen-omega-L694/L725/red3.log @@ -0,0 +1,108 @@ +1 1 +2 0 +3 0 +4 0 +5 1 +6 1 +7 0 +8 1 +9 0 +10 1 +11 1 +12 1 +13 0 +14 1 +15 1 +16 1 +17 1 +18 0 +19 1 +20 1 +21 1 +22 1 +23 0 +24 1 +25 1 +26 0 +27 1 +28 1 +29 1 +30 1 +31 1 +32 0 +33 1 +34 1 +35 1 +36 0 +37 1 +38 1 +39 1 +40 1 +41 1 +42 1 +43 1 +44 1 +45 1 +46 0 +47 1 +48 1 +49 1 +50 0 +51 1 +52 1 +53 0 +54 1 +55 1 +56 1 +57 1 +58 1 +59 1 +60 1 +61 0 +62 0 +63 1 +64 1 +65 0 +66 1 +67 1 +68 1 +69 1 +70 1 +71 1 +72 1 +73 1 +74 1 +75 1 +76 1 +77 1 +78 0 +79 1 +80 1 +81 0 +82 1 +83 0 +84 1 +85 1 +86 1 +87 1 +88 1 +89 1 +90 0 +91 0 +92 1 +93 1 +94 0 +95 1 +96 0 +97 1 +98 0 +99 0 +100 0 +101 0 +102 0 +103 1 +104 1 +105 0 +106 1 +107 0 +108 0 diff --git a/evidence/allen-omega-L694/L725/red3.om b/evidence/allen-omega-L694/L725/red3.om new file mode 100644 index 00000000..56ecba1f --- /dev/null +++ b/evidence/allen-omega-L694/L725/red3.om @@ -0,0 +1,991 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note L725 compilable behavioral stub, retained only in RED evidence. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +ret false +end +fn qready now ulong to bool +ret false +end +fn qsubmit now ulong to bool +ret false +end +fn qnext now ulong link bool to bool +ret false +end +fn qsent now ulong ok bool to bool +ret false +end +fn qincoming now ulong to ulong +ret 0 +end +fn qcancel to void +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +note Native courier lifecycle regression. Clock values are injected milliseconds. +text Lineone "SAY 1 1/1 Model text." +note check writes through Outb; preserve the actual pending datagram around logging. +global SavedOut uchar 8192 +fn test ok bool to void +n = get Outlen 0 +e = get Err 0 +for i ulong n +put SavedOut i get Outb i +end +check ok add get Checks 0 1 +for i ulong n +put Outb i get SavedOut i +end +put Outlen 0 n +put Err 0 e +end +fn tcopy to void +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +end +fn control kind ulong seq ulong to void +put Inlen 0 0 +b = packet kind seq 0 0 0 +tcopy +end +fn linepkt part ulong to void +put Inlen 0 len Lineone +for i ulong len Lineone +put In i get Lineone i +end +b = packet 2 get Q 1 part 0 0 +tcopy +end +fn jobinput to void +put Inlen 0 1001 +for i ulong 1001 +put In i 120 +end +put In 999 10 +put In 1000 121 +end +fn main to int +test qstart 42 100 +test not qready 100 +test not qnext 100 false +test eq get T 3 0 +test qnext 100 true +test eq get T 10 5 +test not qnext 100 true +test qsent 100 false +test eq get T 3 0 +test qnext 101 true +test qsent 101 true +test eq get T 3 1 +test not qnext 2100 true +test qnext 2101 true +test qsent 2101 true +control 6 0 +test eq qincoming 2102 1 +test qready 2102 +test not qnext 12100 true +test qnext 12101 true +test eq get T 10 5 +test qsent 12101 true +test qready 32101 +test not qready 32102 +test qnext 32102 true +test qsent 32102 true +test not qnext 32101 true +test eq get T 0 32102 +jobinput +test qsubmit 32103 +test eq get Q 1 1 +test eq get JobOut 999 32 +test eq get JobOut 1000 121 +test not qsubmit 32103 +test qnext 32103 true +test eq get T 10 1 +test eq get T 11 1 +tcopy +test pkparse +test eq get N 6 1000 +test eq get In add get N 5 999 32 +test qsent 32103 false +test eq get T 9 1 +test qnext 32104 true +test eq get T 11 1 +test qsent 32104 true +test qnext 32104 true +test eq get T 11 2 +tcopy +test pkparse +test eq get N 6 1 +test eq get In get N 5 121 +test qsent 32104 true +test eq get T 9 0 +control 6 0 +test eq qincoming 32105 1 +test qready 32105 +test not qnext 34103 true +test qnext 34104 true +test eq get T 10 1 +test eq get T 11 1 +test qsent 34104 true +test qnext 34104 true +test eq get T 11 2 +test qsent 34104 true +control 4 2 +test eq qincoming 34105 0 +test eq get T 6 0 +control 4 1 +test eq qincoming 34105 1 +test eq get T 6 1 +test not qnext 36104 true +linepkt 1 +test eq qincoming 36105 1 +test eq get Q 4 1 +test eq get T 13 1 +test qnext 36105 true +test eq get T 10 3 +test qsent 36105 false +test eq get T 13 1 +linepkt 1 +test eq qincoming 36106 2 +test eq get Q 4 1 +test qnext 36106 true +test eq get T 10 3 +test qsent 36106 true +test eq get T 13 0 +test qtake +test eq get Inlen 0 len Lineone +test not qtake +linepkt 2 +test eq qincoming 36107 1 +linepkt 3 +test eq qincoming 36107 0 +test eq get Q 2 2 +test eq get Q 4 1 +test qnext 36108 true +test qsent 36108 true +linepkt 3 +test eq qincoming 36109 1 +test eq get Q 2 3 +qcancel +test eq get T 5 0 +linepkt 4 +test eq qincoming 36110 0 +jobinput +test qsubmit 36111 +test eq get Q 1 2 +test eq get Q 4 0 +control 6 0 +test eq qincoming 36112 1 +control 6 0 +put In 22 49 +test eq qincoming 36113 0 +test eq get T 2 36112 +control 4 2 +test eq qincoming 36110 0 +test eq get T 6 0 +qcancel +put Q 1 4294967295 +jobinput +test not qsubmit 36114 +test eq get Q 1 4294967295 +test not qstart 0 36114 +test eq get Q 0 42 +test qstart 43 0 +put Inlen 0 4097 +test not qsubmit 0 +test eq get Q 1 0 +put Inlen 0 0 +test not qsubmit 0 +test not qsent 0 true +ret int get Fails 0 +end diff --git a/evidence/allen-omega-L694/L725/reply.log b/evidence/allen-omega-L694/L725/reply.log new file mode 100644 index 00000000..d11a72ad --- /dev/null +++ b/evidence/allen-omega-L694/L725/reply.log @@ -0,0 +1,15 @@ +801 0 +802 0 +803 0 +804 0 +805 0 +806 0 +807 0 +808 0 +809 0 +810 0 +811 0 +812 0 +813 0 +814 0 +815 0 diff --git a/evidence/allen-omega-L694/L725/runtime.log b/evidence/allen-omega-L694/L725/runtime.log new file mode 100644 index 00000000..5168e6f3 --- /dev/null +++ b/evidence/allen-omega-L694/L725/runtime.log @@ -0,0 +1,28 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 diff --git a/evidence/allen-omega-L694/L725/scene.log b/evidence/allen-omega-L694/L725/scene.log new file mode 100644 index 00000000..44a4b2b1 --- /dev/null +++ b/evidence/allen-omega-L694/L725/scene.log @@ -0,0 +1,14 @@ +1001 0 +1002 0 +1003 0 +1004 0 +1005 0 +1006 0 +1007 0 +1008 0 +1009 0 +1010 0 +1011 0 +1012 0 +1013 0 +1014 0 diff --git a/evidence/allen-omega-L694/L725/scheduler.log b/evidence/allen-omega-L694/L725/scheduler.log new file mode 100644 index 00000000..1d8ffd12 --- /dev/null +++ b/evidence/allen-omega-L694/L725/scheduler.log @@ -0,0 +1,213 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 +183 0 +184 0 +185 0 +186 0 +187 0 +188 0 +189 0 +190 0 +191 0 +192 0 +193 0 +194 0 +195 0 +196 0 +197 0 +198 0 +199 0 +200 0 +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 diff --git a/evidence/allen-omega-L694/L725/session-mutant.log b/evidence/allen-omega-L694/L725/session-mutant.log new file mode 100644 index 00000000..9ce7ef78 --- /dev/null +++ b/evidence/allen-omega-L694/L725/session-mutant.log @@ -0,0 +1,24 @@ +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 1 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 diff --git a/evidence/allen-omega-L694/L725/short.log b/evidence/allen-omega-L694/L725/short.log new file mode 100644 index 00000000..a9da2dc8 --- /dev/null +++ b/evidence/allen-omega-L694/L725/short.log @@ -0,0 +1,20 @@ +401 0 +410 0 +411 0 +412 0 +413 0 +414 0 +402 0 +403 0 +404 0 +405 0 +406 0 +700 0 +701 0 +702 0 +703 0 +704 0 +705 0 +407 0 +408 0 +409 0 diff --git a/evidence/allen-omega-L694/L725/source.sha256 b/evidence/allen-omega-L694/L725/source.sha256 new file mode 100644 index 00000000..7147d854 --- /dev/null +++ b/evidence/allen-omega-L694/L725/source.sha256 @@ -0,0 +1,37 @@ +184f4270c72c4eca6a7afdd28b70a608f2e237980b12c8a7bfc2c7d2c3e625b9 native/omega/allen/base.om +795ca28627a19f1088de0f23277e79cdac921ff88451c606c7b655ce0f2e8a5b native/omega/allen/build-one.sh +4d2235ac5d6b237695b1c3112f70ebdfa0cebafa2ec8e691e4be4de37a62199b native/omega/allen/code.om +76ee9cdeaac036905c76dfa29f42bf5a78d1259ad1656adfaa24916c3b93550d native/omega/allen/courier.om +7c2e516c56b555bbd7fefa8f24b0b87b6013b0545a43c98e7c01269cccbf76d3 native/omega/allen/gate.sh +9d71a653870eeef678f95df04db9c38aedaadd06e7c74bf3e5d9fde6e28f82f8 native/omega/allen/golden.sh +06087bc573ebb876a0ed80f6025c592fb4b1d23335169c3da402824fd1482c35 native/omega/allen/intent.om +4bc37c95d553364c5d2925d8ff9e8a53b1a61974513e6f492f77b7ebb05bbda4 native/omega/allen/main.om +068292abd04d3a61b063fc5380b22a56c4235a87915c219ebf3b37d16d7bc9c7 native/omega/allen/memory.om +b4d7b6e6cd680d2ba1eec2978b0cbb81ffc63035b73f5c3726bdad97a7b6aa04 native/omega/allen/paint.om +e1a49f0f3fb01e92e8b474867d0fb68a3fc4da53c8fe5ad8411862c97f364843 native/omega/allen/README.md +e50a7f673aaee92aba4a3aec303aa93b071121c09ad05d4ad1dcc2deb9706dcc native/omega/allen/reply.om +5b01eae03204d08f6d207ef29f2ba09a1d9f249f1738f68f151214675a4ff2ed native/omega/allen/runtime.om +c8d4a437b41538cc1eeb62a2029c6993d41e5ef90cc7b26c8e1c92bc98ec57d3 native/omega/allen/scene.om +615dff78462a715153b3d891b2cfe146c318d3a0a26ae1aaa642484f965c12df native/omega/allen/scheduler.om +f085198549d1c235a97574ff6f6560ce82217611f4051fc3dbbc8286aab6d536 native/omega/allen/tests/check.om +b76438a85257bd95768115047be286c107e3723628a16a0541870732d0849a42 native/omega/allen/tests/code.om +98105e1c30626f54da07940fe0415637730b7e112ea39ba2aae1f2d648993373 native/omega/allen/tests/courier.om +f524aab74657dc2e9e4330bf42bc05ef01ce3e8f08a05c80371be0c0a33764d3 native/omega/allen/tests/edges.om +a2e8bcde92d522216a4fa99559dd3bcba096aea86127364587dadcc2bfb585af native/omega/allen/tests/fixture.om +c9ef2bee7cbd1c072c6045d62c55f3bdd938901e91792cee72ea57fb8f25a198 native/omega/allen/tests/golden.om +8ba742d85ea510586f3cf86661bc0f28c5d99b59981c2d3fb220705efad24564 native/omega/allen/tests/intent.om +861d9af698b021056cceb6c00ae3458558db415963fe832d3fca7da55731cf7b native/omega/allen/tests/memory.om +13e4db7436165783c6aad48497ffe89fa6e5ba3de928e66a766c29e1e817fcf5 native/omega/allen/tests/paint.om +e6d232d92d74d88423cebbbbfc6e403ea9b865b80c909e1d23087001d905035a native/omega/allen/tests/probe.om +8fbc8a0517900efd771a994686356416a0fea5e20cfd9bc26c787850398113df native/omega/allen/tests/render.om +094a5e833bae7dfd3b013e3f015f143e9d7bd3efe9b9c896a7f58b09e1ec14b8 native/omega/allen/tests/reply.om +bab9b0e853aa4b62918353a5d1625a3171deebfb639e599fe9751b5a61a3df62 native/omega/allen/tests/runtime.om +b9c84d9a58658589137764fe60209d8320550dd8ed99fa6026df65ba48737e4f native/omega/allen/tests/scene.om +bf984fa9cf63ddb569147afc2a028ccdafdbeae2067125cf35d658e5d00f4c94 native/omega/allen/tests/scheduler.om +521fff50f312b64801017b1349d9a31dac6eac50eb989d93d2dbac4e100f5007 native/omega/allen/tests/stdio-overflow.om +89aee5326b428147ea6da9aa739b6679e214ed114ae5f41d3b70299cf864092c native/omega/allen/tests/view.om +0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0 native/omega/allen/vendor/OMEGA-LICENSE +b234738e8ce81b3d67586deb41fdaab4543169d4b69e86fd3dc28a08432ab5fc native/omega/allen/vendor/PROVENANCE.md +992ec4a4957271b442740598136887a5c610effcd8ae9fb9480a006a4f181097 native/omega/allen/vendor/sha256-core.om +0781cdcec18570a57afbe3be4a6717dd2d1fa4c887b49a3e4cb542b594f8a041 native/omega/allen/vendor/sha256.om +abbefd2f7dc48f2ac28b9526f5c2e5b369da4b7c5e84dde6e6a3cd20bd5687ac native/omega/allen/view.om diff --git a/evidence/allen-omega-L694/L725/stale-mutant.log b/evidence/allen-omega-L694/L725/stale-mutant.log new file mode 100644 index 00000000..ac2e3d09 --- /dev/null +++ b/evidence/allen-omega-L694/L725/stale-mutant.log @@ -0,0 +1,28 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 1 +7 1 +8 1 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 diff --git a/evidence/allen-omega-L694/L725/stdio-overflow.stderr b/evidence/allen-omega-L694/L725/stdio-overflow.stderr new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L725/stdio-overflow.stdout b/evidence/allen-omega-L694/L725/stdio-overflow.stdout new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L725/view.log b/evidence/allen-omega-L694/L725/view.log new file mode 100644 index 00000000..8b194f11 --- /dev/null +++ b/evidence/allen-omega-L694/L725/view.log @@ -0,0 +1,13 @@ +901 0 +902 0 +903 0 +904 0 +905 0 +906 0 +907 0 +908 0 +909 0 +910 0 +911 0 +912 0 +913 0 diff --git a/evidence/allen-omega-L694/L734/README.md b/evidence/allen-omega-L694/L734/README.md new file mode 100644 index 00000000..11126c92 --- /dev/null +++ b/evidence/allen-omega-L694/L734/README.md @@ -0,0 +1,55 @@ +# L734: native application binding + +This increment joins runtime prompt admission, intent/JOB construction, courier +scheduling, CODE assembly and SAY/WAIT consumption in handwritten seeded Omega. +It is an executed provider-facing core, not actual network/device attachment. +The existing development stdio main remains separate. No live service, machine, +physical disk, compiler or kernel provider was changed. + +## Actual results + +`full.log`, `full.exit` and `counts.json`: 1253 native checks pass, including +161 application checks. Nine separately compiled behavioral mutants are rejected: +stale3, CRC2, hash2, readback7, session1, keepalive40, ACK-stop27, pending-wire1, +application-CODE3. Each executable was built through the pinned compiler and +checked for nonempty static AArch64 EXEC before execution. Memory and stdio +goldens, and the overflow refusal regression, remain passing. + +`source.sha256` was checked against the current source bytes before this commit. +`binaries.sha256` inventories actual compiled executables in the fresh handoff +output directory. Build orchestration and log/hash collection use existing host +tools; product and executable test/probe logic are Omega only. + +## RED/GREEN and construction failures + +- Initial `red.om` did not compile: text identifiers longer than the selected + compiler's eight-byte global-name limit returned error13. Tests were corrected + to the actual grammar. This was not counted as behavioral RED. +- `red2` is a compilable stub: 131 executed assertions,103 failures, exit103. +- Initial real implementation `green1.om` exceeded the selected compiler's + sixteen-slot expression budget (error12). Extracting the retry-admission helper + preserved behavior; `green2` executed133 checks with exit0. The two additional + executed assertions are conditional send-result checks skipped by the stub. +- Pending-output regression: a code-completion LINE could cause saytake to write + AGAIN into Outb while a previously offered JOB was awaiting send-result + reporting. `pending-red` executed154 checks with one failure. The application + now preserves the complete outgoing bytes/length/error around reply handling; + `pending-green` executes154 checks, zero failures. The final compiled + pendingwire mutant independently reintroduces this defect and fails. +- Stale-inner-CODE regression: an accepted current transport envelope containing + an old CODE ID could populate the old assembly buffer during a newer chat, + before heard rejected its logical ID. `stalecode-red` executes161 checks with + three state-mutation failures. The application now validates active code-kind + and assembly/conversation binding before calling codetake. The same cases pass + in the full suite, and the compiled appcode mutant fails those three checks. + +Tests exercise real serialized protocol bytes through the application calls: +chat prompt->JOB->LINE->retained answer, immediate code acknowledgement, +missing-code AGAIN after GOT, distinct conversation/wire IDs, stale inner reply +refusal, complete CRC-checked code before display, cancellation/reset, failed send, +WAIT, slow notice, silence timeout, backward clocks and invalid admission. + +Independent review pending. The earlier completed strict legacy repository suite +is retained in ../parent-strict; it is not silently relabeled as qualification +of this new native source. Native socket/clock/device integration, full portable +parity, x86 EFI/QEMU and physical iMac execution remain open under L694. diff --git a/evidence/allen-omega-L694/L734/ackstop-mutant.log b/evidence/allen-omega-L694/L734/ackstop-mutant.log new file mode 100644 index 00000000..5d0598cb --- /dev/null +++ b/evidence/allen-omega-L694/L734/ackstop-mutant.log @@ -0,0 +1,213 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 1 +65 1 +66 0 +67 0 +68 0 +69 1 +70 1 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 1 +165 0 +166 0 +167 0 +168 0 +169 1 +170 0 +171 1 +172 1 +173 0 +174 1 +175 0 +176 0 +177 0 +178 1 +179 0 +180 1 +181 0 +182 1 +183 0 +184 1 +185 0 +186 1 +187 0 +188 1 +189 0 +190 1 +191 0 +192 1 +193 0 +194 1 +195 1 +196 1 +197 1 +198 0 +199 1 +200 0 +201 0 +202 1 +203 1 +204 1 +205 0 +206 1 +207 1 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 diff --git a/evidence/allen-omega-L694/L734/appcode-mutant.log b/evidence/allen-omega-L694/L734/appcode-mutant.log new file mode 100644 index 00000000..a7e8e5a9 --- /dev/null +++ b/evidence/allen-omega-L694/L734/appcode-mutant.log @@ -0,0 +1,161 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 1 +76 1 +77 1 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 diff --git a/evidence/allen-omega-L694/L734/application.log b/evidence/allen-omega-L694/L734/application.log new file mode 100644 index 00000000..57341bc5 --- /dev/null +++ b/evidence/allen-omega-L694/L734/application.log @@ -0,0 +1,161 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 diff --git a/evidence/allen-omega-L694/L734/binaries.sha256 b/evidence/allen-omega-L694/L734/binaries.sha256 new file mode 100644 index 00000000..ac54dc46 --- /dev/null +++ b/evidence/allen-omega-L694/L734/binaries.sha256 @@ -0,0 +1,26 @@ +6d650ec56ff5ff9d069b042e6651962b68cd9ef674c33c4efe76345c4e97dbfe /home/drakestapleton/handoffs/allen-omega-L694/L734/full/scheduler +fdae94ddf868f701e5b2b97187206f11dd4d2b53601edee6fab7e2d8c541b782 /home/drakestapleton/handoffs/allen-omega-L694/L734/full/readback-mutant +3bec6065cb044eb019e143bfa0e2eacbe58c92a11069a701f196591512de424d /home/drakestapleton/handoffs/allen-omega-L694/L734/full/view +144fcf58ba2d37e28e31f70901ddee2816bc73e392837edc9d33a37cfdd8da39 /home/drakestapleton/handoffs/allen-omega-L694/L734/full/allen +56d7b62cc9ee2088bec592fcdcb08e1460727ee924f5f6dc57609b440ce4bfdb /home/drakestapleton/handoffs/allen-omega-L694/L734/full/reply +1b084c60c51bb6bff0e86b6e33bdd7f8ae20c439358a59040b10557ef4480922 /home/drakestapleton/handoffs/allen-omega-L694/L734/full/ackstop-mutant +d35f99663a6b6c38cfe73466cd957406ce1a02e0fbcd7d4e6d517916adb2e892 /home/drakestapleton/handoffs/allen-omega-L694/L734/full/hash-mutant +7ab3d4b929b9783974fce2bba19d348f05825f21486b2392a4f53fac3f0f3545 /home/drakestapleton/handoffs/allen-omega-L694/L734/full/golden +7a77f860a281df4f67cf253eebbd73d4d2a74c9e4e00e1dd4e56af826aff54cb /home/drakestapleton/handoffs/allen-omega-L694/L734/full/session-mutant +8eb6d85cb109b38f0b63ddd3728d97ae44846bf023dadd85c9a5ddfe5938bfaa /home/drakestapleton/handoffs/allen-omega-L694/L734/full/intent +1e112b3a8a29fd8af52ae5e5dded6d9960a8aca5c5191c32ebb19ba0ac657e42 /home/drakestapleton/handoffs/allen-omega-L694/L734/full/fixture +a899184689994913953a995f6535fa154d7c7ac021033157dee9540d3895422b /home/drakestapleton/handoffs/allen-omega-L694/L734/full/runtime +d0c7123c568256add05f01477def3aaa2f610817cc68a4c8dbed0e898bf33494 /home/drakestapleton/handoffs/allen-omega-L694/L734/full/code +99c557b76691198da03677762b605ea874be85ce8ab06650d3d77747ae2efba5 /home/drakestapleton/handoffs/allen-omega-L694/L734/full/edges +ac9fee41c760e6c47990f12b76052958c57c6142be09d26b349d9c9ac01fa669 /home/drakestapleton/handoffs/allen-omega-L694/L734/full/appcode-mutant +171d20f70aa37afc3e8d3a6d1a7350f6bdc3f2064473ff247c616733297e0dc7 /home/drakestapleton/handoffs/allen-omega-L694/L734/full/render +8208fb15282d590f8ac6a68805a7ecc1ef59976421f75cfd3045a0d9156b69b4 /home/drakestapleton/handoffs/allen-omega-L694/L734/full/stale-mutant +0b38ec713cfd0fcb7d2dbe82a571bd3666ecc840231b02cb703b74ea3b077ad5 /home/drakestapleton/handoffs/allen-omega-L694/L734/full/courier +f16baa5e99569377dc55617fd83c24cfdf414597ee86f2f8e33f9eb091b7e166 /home/drakestapleton/handoffs/allen-omega-L694/L734/full/scene +e9dc0394cdacc031f299f53c3ba91658a6d33476e9b75f7abf2605707bbf2312 /home/drakestapleton/handoffs/allen-omega-L694/L734/full/pendingwire-mutant +ca4def5b75b6c1b85e1f15630e447d86e42ef1a4f9532f023c9cbc20dcc0005b /home/drakestapleton/handoffs/allen-omega-L694/L734/full/paint +aecb6d628b7dd4656b980f228304c0bc64ec53b7f8fc627dd9920802e162fec6 /home/drakestapleton/handoffs/allen-omega-L694/L734/full/crc-mutant +71f99242bcad6ede239b240602470fcf3d5da3267eb47a1ad522241958222367 /home/drakestapleton/handoffs/allen-omega-L694/L734/full/stdio-overflow-input +4b639c76d4301d413bf7c1e213bcc1c8d83c4588cacd4bec5a60fd282a9a6fac /home/drakestapleton/handoffs/allen-omega-L694/L734/full/keepalive-mutant +b61eb63933ae35b49cb17722f9835ba2311055b2fbfe16acdf89f9c7436a7a92 /home/drakestapleton/handoffs/allen-omega-L694/L734/full/memory +987c3ac961f1dc5297ac8a48e71a6c3b203babb6e8ef6503b982b537a3efe469 /home/drakestapleton/handoffs/allen-omega-L694/L734/full/application diff --git a/evidence/allen-omega-L694/L734/code.log b/evidence/allen-omega-L694/L734/code.log new file mode 100644 index 00000000..e7e197b7 --- /dev/null +++ b/evidence/allen-omega-L694/L734/code.log @@ -0,0 +1,23 @@ +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 diff --git a/evidence/allen-omega-L694/L734/counts.json b/evidence/allen-omega-L694/L734/counts.json new file mode 100644 index 00000000..26d8e50a --- /dev/null +++ b/evidence/allen-omega-L694/L734/counts.json @@ -0,0 +1,20 @@ +{ + "checks": { + "runtime": 28, + "code": 23, + "courier": 24, + "scheduler": 213, + "application": 161, + "memory": 79, + "intent": 8, + "reply": 15, + "view": 13, + "scene": 14, + "paint": 11, + "edges": 352, + "short": 20, + "long": 292 + }, + "total": 1253, + "compiled_mutants_rejected": 9 +} diff --git a/evidence/allen-omega-L694/L734/courier.log b/evidence/allen-omega-L694/L734/courier.log new file mode 100644 index 00000000..8402df49 --- /dev/null +++ b/evidence/allen-omega-L694/L734/courier.log @@ -0,0 +1,24 @@ +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 diff --git a/evidence/allen-omega-L694/L734/crc-mutant.log b/evidence/allen-omega-L694/L734/crc-mutant.log new file mode 100644 index 00000000..a0d90bd4 --- /dev/null +++ b/evidence/allen-omega-L694/L734/crc-mutant.log @@ -0,0 +1,23 @@ +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 1 +117 1 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 diff --git a/evidence/allen-omega-L694/L734/edges.log b/evidence/allen-omega-L694/L734/edges.log new file mode 100644 index 00000000..e8d0deea --- /dev/null +++ b/evidence/allen-omega-L694/L734/edges.log @@ -0,0 +1,352 @@ +1201 0 +1202 0 +1203 0 +1204 0 +1205 0 +1206 0 +1207 0 +1208 0 +1209 0 +1210 0 +1211 0 +1212 0 +1213 0 +1214 0 +1220 0 +1221 0 +1222 0 +1223 0 +1224 0 +1225 0 +1226 0 +1227 0 +1228 0 +1229 0 +1230 0 +1231 0 +1232 0 +1233 0 +1234 0 +1235 0 +1236 0 +1237 0 +1238 0 +1239 0 +1240 0 +1241 0 +1242 0 +1243 0 +1244 0 +1245 0 +1246 0 +1247 0 +1248 0 +1249 0 +1250 0 +1251 0 +1252 0 +1253 0 +1254 0 +1255 0 +1256 0 +1257 0 +1258 0 +1259 0 +1260 0 +1261 0 +1262 0 +1301 0 +1302 0 +1303 0 +1304 0 +1305 0 +1306 0 +1310 0 +1311 0 +1312 0 +1313 0 +1314 0 +1315 0 +1316 0 +1317 0 +1318 0 +1319 0 +1320 0 +1321 0 +1322 0 +1323 0 +1324 0 +1325 0 +1326 0 +1327 0 +1328 0 +1329 0 +1330 0 +1331 0 +1332 0 +1333 0 +1334 0 +1335 0 +1336 0 +1337 0 +1338 0 +1339 0 +1340 0 +1341 0 +1342 0 +1343 0 +1344 0 +1345 0 +1346 0 +1347 0 +1348 0 +1349 0 +1350 0 +1351 0 +1352 0 +1353 0 +1354 0 +1355 0 +1356 0 +1357 0 +1358 0 +1359 0 +1360 0 +1361 0 +1362 0 +1363 0 +1364 0 +1365 0 +1366 0 +1367 0 +1368 0 +1369 0 +1370 0 +1371 0 +1372 0 +1373 0 +1374 0 +1375 0 +1376 0 +1377 0 +1378 0 +1379 0 +1380 0 +1381 0 +1382 0 +1383 0 +1384 0 +1385 0 +1386 0 +1387 0 +1388 0 +1389 0 +1390 0 +1391 0 +1392 0 +1393 0 +1394 0 +1395 0 +1396 0 +1397 0 +1398 0 +1399 0 +1400 0 +1401 0 +1402 0 +1403 0 +1404 0 +1405 0 +1406 0 +1407 0 +1408 0 +1409 0 +1410 0 +1411 0 +1412 0 +1413 0 +1414 0 +1415 0 +1416 0 +1417 0 +1418 0 +1419 0 +1420 0 +1421 0 +1422 0 +1423 0 +1424 0 +1425 0 +1426 0 +1427 0 +1428 0 +1429 0 +1430 0 +1431 0 +1432 0 +1433 0 +1434 0 +1435 0 +1436 0 +1437 0 +1438 0 +1439 0 +1440 0 +1441 0 +1442 0 +1443 0 +1444 0 +1445 0 +1446 0 +1447 0 +1448 0 +1449 0 +1450 0 +1451 0 +1452 0 +1453 0 +1454 0 +1455 0 +1456 0 +1457 0 +1458 0 +1459 0 +1460 0 +1461 0 +1462 0 +1463 0 +1464 0 +1465 0 +1466 0 +1467 0 +1468 0 +1469 0 +1470 0 +1471 0 +1472 0 +1473 0 +1474 0 +1475 0 +1476 0 +1477 0 +1478 0 +1479 0 +1480 0 +1481 0 +1482 0 +1483 0 +1484 0 +1485 0 +1486 0 +1487 0 +1488 0 +1489 0 +1490 0 +1491 0 +1492 0 +1493 0 +1494 0 +1495 0 +1496 0 +1497 0 +1498 0 +1499 0 +1500 0 +1501 0 +1502 0 +1503 0 +1504 0 +1505 0 +1506 0 +1507 0 +1508 0 +1509 0 +1510 0 +1511 0 +1512 0 +1513 0 +1514 0 +1515 0 +1516 0 +1517 0 +1518 0 +1519 0 +1520 0 +1521 0 +1522 0 +1523 0 +1524 0 +1525 0 +1526 0 +1527 0 +1528 0 +1529 0 +1530 0 +1531 0 +1532 0 +1533 0 +1534 0 +1535 0 +1536 0 +1537 0 +1538 0 +1539 0 +1540 0 +1541 0 +1542 0 +1543 0 +1544 0 +1545 0 +1546 0 +1547 0 +1548 0 +1549 0 +1550 0 +1551 0 +1552 0 +1553 0 +1554 0 +1555 0 +1556 0 +1557 0 +1558 0 +1559 0 +1560 0 +1561 0 +1562 0 +1563 0 +1564 0 +1565 0 +1570 0 +1571 0 +1572 0 +1575 0 +1573 0 +1574 0 +1600 0 +1601 0 +1602 0 +1603 0 +1604 0 +1605 0 +1606 0 +1607 0 +1610 0 +1611 0 +1612 0 +1613 0 +1614 0 +1615 0 +1616 0 +1617 0 +1701 0 +1702 0 +1703 0 +1704 0 +1705 0 +1706 0 +1707 0 +1708 0 +1709 0 +1710 0 +1711 0 diff --git a/evidence/allen-omega-L694/L734/full.exit b/evidence/allen-omega-L694/L734/full.exit new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/L734/full.exit @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/L734/full.log b/evidence/allen-omega-L694/L734/full.log new file mode 100644 index 00000000..6e989ecf --- /dev/null +++ b/evidence/allen-omega-L694/L734/full.log @@ -0,0 +1,27 @@ +runtime compile=0 native-exit=0 +code compile=0 native-exit=0 +courier compile=0 native-exit=0 +scheduler compile=0 native-exit=0 +application compile=0 native-exit=0 +memory compile=0 native-exit=0 +intent compile=0 native-exit=0 +reply compile=0 native-exit=0 +view compile=0 native-exit=0 +scene compile=0 native-exit=0 +paint compile=0 native-exit=0 +edges compile=0 native-exit=0 +fixture compile=0 native-exit=0 +golden compile=0 native-exit=0 +render compile=0 native-exit=0 +stdio native-exit=0 golden-cmp=0 +stdio overflow native-exit=65 no-later-command=PASS +stale mutant compile=0 rejected-exit=3 +crc mutant compile=0 rejected-exit=2 +hash mutant compile=0 rejected-exit=2 +readback mutant compile=0 rejected-exit=7 +session mutant compile=0 rejected-exit=1 +keepalive mutant compile=0 rejected-exit=40 +ackstop mutant compile=0 rejected-exit=27 +pendingwire mutant compile=0 rejected-exit=1 +appcode mutant compile=0 rejected-exit=3 +ALLEN_OMEGA_HOST: PASS; target=NOT_RUN; live=NOT_RUN diff --git a/evidence/allen-omega-L694/L734/green1.om b/evidence/allen-omega-L694/L734/green1.om new file mode 100644 index 00000000..ec79f64b --- /dev/null +++ b/evidence/allen-omega-L694/L734/green1.om @@ -0,0 +1,3098 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +note First acknowledge the triggering LINE; only then submit AGAIN under a new +note wire sequence. Its body keeps the original conversation ID. +if and gt get A 1 0 and eq get T 10 0 eq get T 13 0 +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +appcancel +put A 2 3 +ret false +end +put A 1 0 +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +note End-to-end application core over real Omega protocol bytes; no socket simulation claim. +text Smallask "hello" +text Codeaskt "Please make me a calculator" +text Finaltxt " 1/1 Model answer." +text Codetxt " 1/1 9 3ce11e06 python print(1)\\n" +text Prefixes "SAY WAIT CODE " +text Againexp "AGAIN 2" +global SavedOut uchar 8192 +fn test ok bool to void +n = get Outlen 0 +e = get Err 0 +for i ulong n +put SavedOut i get Outb i +end +check ok add get Checks 0 1 +for i ulong n +put Outb i get SavedOut i +end +put Outlen 0 n +put Err 0 e +end +fn copyout to void +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +end +fn prompt code bool to void +if code +put Inlen 0 len Codeaskt +for i ulong len Codeaskt +put In i get Codeaskt i +end +else +put Inlen 0 len Smallask +for i ulong len Smallask +put In i get Smallask i +end +end +end +fn incoming part ulong seq ulong kind ulong to void +outreset +off = ulong 0 +size = ulong 4 +if eq kind 1 +off = ulong 4 +size = ulong 5 +end +if eq kind 2 +off = ulong 9 +size = ulong 5 +end +for i ulong size +emitb get Prefixes add off i +end +emitn seq +if eq kind 0 +for i ulong len Finaltxt +emitb get Finaltxt i +end +end +if eq kind 2 +for i ulong len Codetxt +emitb get Codetxt i +end +end +copyout +b = packet 2 get Q 1 part 0 0 +copyout +end +fn main to int +test not appinit 0 100 +test appinit 42 100 +test not appinit 43 100 +test eq get Q 0 42 +prompt false +test appask 100 +test eq get R 0 1 +test eq get Q 1 1 +test eq get R 9 1 +test eq get R 1 1 +test eq get A 2 0 +prompt false +test not appask 101 +test eq get R 9 1 +test apppoll 100 true +test eq get T 10 5 +test appsent 100 true +test apppoll 100 true +test eq get T 10 1 +copyout +test pkparse +test eq get N 1 1 +test eq get In get N 5 74 +test appsent 100 true +incoming 1 1 0 +test appreceive 101 +test eq get A 2 1 +test eq get R 1 0 +test eq get R 8 13 +test eq get R 9 2 +test eq get Answer 0 77 +prompt true +test not appask 102 +test eq get R 0 1 +test apppoll 102 true +test eq get T 10 3 +test appsent 102 true +note Code acknowledgement is visible immediately, but missing code requests AGAIN. +prompt true +test appask 103 +test eq get R 0 2 +test eq get Q 1 2 +test eq get R 2 2 +test eq get A 2 1 +test eq get R 8 len Ack +test apppoll 103 true +test appsent 103 false +test apppoll 104 true +test eq get T 10 1 +test appsent 104 true +incoming 1 2 0 +test appreceive 105 +test eq get A 2 2 +test eq get A 1 len Againexp +test eq get R 1 1 +test eq get R 13 1 +test apppoll 105 true +test eq get T 10 3 +test eq get Q 1 2 +test appsent 105 true +test apppoll 106 true +test eq get T 10 1 +test eq get Q 1 3 +test eq get R 0 2 +copyout +test pkparse +test eq get N 6 len Againexp +bad = ulong 0 +for i ulong len Againexp +if ne get In add get N 5 i get Againexp i +bad = add bad 1 +end +end +test eq bad 0 +test appsent 106 true +incoming 1 2 0 +test appreceive 107 +test eq get A 2 3 +test eq get R 1 0 +test eq get A 1 0 +note Reset cancels pending delivery without reusing either counter. +appreset +test eq get R 0 2 +test eq get Q 1 3 +test eq get R 9 0 +prompt false +test appask 108 +test eq get R 0 3 +test eq get Q 1 4 +test apppoll 108 true +test appsent 108 true +incoming 1 2 0 +test appreceive 109 +test eq get A 2 4 +test eq get R 1 1 +test eq get R 8 0 +test apppoll 109 true +test appsent 109 true +incoming 2 3 0 +test appreceive 110 +test eq get A 2 1 +test eq get R 1 0 +test eq get R 9 2 +test apppoll 110 true +test appsent 110 true +note Cancellation drops an outstanding send and stale response safely. +prompt false +test appask 111 +test apppoll 111 true +appcancel +test eq get R 1 0 +test eq get T 5 0 +test not appsent 111 true +incoming 1 4 0 +test not appreceive 112 +note Complete CODE bytes must arrive before a code response becomes visible. +prompt true +test appask 113 +test eq get R 0 5 +test eq get Q 1 6 +test apppoll 113 true +test appsent 113 true +incoming 1 5 2 +test appreceive 114 +test eq get A 2 0 +test eq codestat 2 +test eq get R 6 0 +test apppoll 114 true +test appsent 114 true +incoming 2 5 0 +test appreceive 115 +test eq get A 2 1 +test eq get R 6 1 +test eq get R 1 0 +test eq get Code 6 49 +test apppoll 115 true +test appsent 115 true +note WAIT updates silence deadline, no answer; slow and timeout cancel both layers. +prompt false +test appask 116 +test eq get R 0 6 +test apppoll 116 true +test appsent 116 true +incoming 1 6 1 +test appreceive 117 +test eq get A 2 0 +test eq get R 4 117 +test apppoll 117 true +test appsent 117 true +v = apppoll 20116 true +test eq get A 2 5 +test eq get R 1 1 +if v +test appsent 20116 true +end +v = apppoll 30116 true +test eq get R 1 1 +if v +test appsent 30116 true +end +v = apppoll 30117 true +test eq get A 2 6 +test eq get R 1 0 +test eq get T 5 0 +test eq get A 1 0 +if v +test appsent 30117 true +end +n = get R 9 +prompt false +test not appask 30116 +test eq get R 9 n +test not apppoll 30116 true +note Invalid prompt never becomes a pending job or transcript line. +put Inlen 0 160 +test not appask 30118 +test eq get R 9 n +test eq get R 0 6 +test eq get Q 1 7 +ret int get Fails 0 +end diff --git a/evidence/allen-omega-L694/L734/green2.exit b/evidence/allen-omega-L694/L734/green2.exit new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/L734/green2.exit @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/L734/green2.log b/evidence/allen-omega-L694/L734/green2.log new file mode 100644 index 00000000..d5e8237e --- /dev/null +++ b/evidence/allen-omega-L694/L734/green2.log @@ -0,0 +1,133 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 diff --git a/evidence/allen-omega-L694/L734/hash-mutant.log b/evidence/allen-omega-L694/L734/hash-mutant.log new file mode 100644 index 00000000..c75cfefb --- /dev/null +++ b/evidence/allen-omega-L694/L734/hash-mutant.log @@ -0,0 +1,79 @@ +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 1 +310 1 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +362 0 +363 0 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 0 +361 0 diff --git a/evidence/allen-omega-L694/L734/independent-review/build/app-baseline.log b/evidence/allen-omega-L694/L734/independent-review/build/app-baseline.log new file mode 100644 index 00000000..2e8a428d --- /dev/null +++ b/evidence/allen-omega-L694/L734/independent-review/build/app-baseline.log @@ -0,0 +1,182 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 diff --git a/evidence/allen-omega-L694/L734/independent-review/build/probe-final-50/probe.log b/evidence/allen-omega-L694/L734/independent-review/build/probe-final-50/probe.log new file mode 100644 index 00000000..107e4801 --- /dev/null +++ b/evidence/allen-omega-L694/L734/independent-review/build/probe-final-50/probe.log @@ -0,0 +1,50 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 diff --git a/evidence/allen-omega-L694/L734/independent-review/development/app-baseline.log b/evidence/allen-omega-L694/L734/independent-review/development/app-baseline.log new file mode 100644 index 00000000..2e8a428d --- /dev/null +++ b/evidence/allen-omega-L694/L734/independent-review/development/app-baseline.log @@ -0,0 +1,182 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 diff --git a/evidence/allen-omega-L694/L734/independent-review/development/app-baseline.om b/evidence/allen-omega-L694/L734/independent-review/development/app-baseline.om new file mode 100644 index 00000000..a5ebf72b --- /dev/null +++ b/evidence/allen-omega-L694/L734/independent-review/development/app-baseline.om @@ -0,0 +1,3226 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +note End-to-end application core over real Omega protocol bytes; no socket simulation claim. +text Smallask "hello" +text Codeaskt "Please make me a calculator" +text Finaltxt " 1/1 Model answer." +text Codetxt " 1/1 9 3ce11e06 python print(1)\\n" +text Prefixes "SAY WAIT CODE " +text Againexp "AGAIN 2" +global SavedOut uchar 8192 +global Heldwire uchar 8192 +global Heldlen ulong 2 +fn holdwire to void +put Heldlen 0 get Outlen 0 +put Heldlen 1 get Err 0 +for i ulong get Outlen 0 +put Heldwire i get Outb i +end +end +fn unhold to void +for i ulong get Heldlen 0 +put Outb i get Heldwire i +end +put Outlen 0 get Heldlen 0 +put Err 0 get Heldlen 1 +end +fn samewire to bool +if ne get Outlen 0 get Heldlen 0 +ret false +end +for i ulong get Heldlen 0 +if ne get Outb i get Heldwire i +ret false +end +end +ret eq get Err 0 get Heldlen 1 +end +fn test ok bool to void +n = get Outlen 0 +e = get Err 0 +for i ulong n +put SavedOut i get Outb i +end +check ok add get Checks 0 1 +for i ulong n +put Outb i get SavedOut i +end +put Outlen 0 n +put Err 0 e +end +fn copyout to void +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +end +fn prompt code bool to void +if code +put Inlen 0 len Codeaskt +for i ulong len Codeaskt +put In i get Codeaskt i +end +else +put Inlen 0 len Smallask +for i ulong len Smallask +put In i get Smallask i +end +end +end +fn incoming part ulong seq ulong kind ulong to void +outreset +off = ulong 0 +size = ulong 4 +if eq kind 1 +off = ulong 4 +size = ulong 5 +end +if eq kind 2 +off = ulong 9 +size = ulong 5 +end +for i ulong size +emitb get Prefixes add off i +end +emitn seq +if eq kind 0 +for i ulong len Finaltxt +emitb get Finaltxt i +end +end +if eq kind 2 +for i ulong len Codetxt +emitb get Codetxt i +end +end +copyout +b = packet 2 get Q 1 part 0 0 +copyout +end +fn main to int +test not appinit 0 100 +test appinit 42 100 +test not appinit 43 100 +test eq get Q 0 42 +prompt false +test appask 100 +test eq get R 0 1 +test eq get Q 1 1 +test eq get R 9 1 +test eq get R 1 1 +test eq get A 2 0 +prompt false +test not appask 101 +test eq get R 9 1 +test apppoll 100 true +test eq get T 10 5 +test appsent 100 true +test apppoll 100 true +test eq get T 10 1 +copyout +test pkparse +test eq get N 1 1 +test eq get In get N 5 74 +test appsent 100 true +incoming 1 1 0 +test appreceive 101 +test eq get A 2 1 +test eq get R 1 0 +test eq get R 8 13 +test eq get R 9 2 +test eq get Answer 0 77 +prompt true +test not appask 102 +test eq get R 0 1 +test apppoll 102 true +test eq get T 10 3 +test appsent 102 true +note Code acknowledgement is visible immediately, but missing code requests AGAIN. +prompt true +test appask 103 +test eq get R 0 2 +test eq get Q 1 2 +test eq get R 2 2 +test eq get A 2 1 +test eq get R 8 len Ack +test apppoll 103 true +test appsent 103 false +test apppoll 104 true +test eq get T 10 1 +test appsent 104 true +incoming 1 2 0 +test appreceive 105 +test eq get A 2 2 +test eq get A 1 len Againexp +test eq get R 1 1 +test eq get R 13 1 +test apppoll 105 true +test eq get T 10 3 +test eq get Q 1 2 +test appsent 105 true +test apppoll 106 true +test eq get T 10 1 +test eq get Q 1 3 +test eq get R 0 2 +copyout +test pkparse +test eq get N 6 len Againexp +bad = ulong 0 +for i ulong len Againexp +if ne get In add get N 5 i get Againexp i +bad = add bad 1 +end +end +test eq bad 0 +test appsent 106 true +incoming 1 2 0 +test appreceive 107 +test eq get A 2 3 +test eq get R 1 0 +test eq get A 1 0 +note Reset cancels pending delivery without reusing either counter. +appreset +test eq get R 0 2 +test eq get Q 1 3 +test eq get R 9 0 +prompt false +test appask 108 +test eq get R 0 3 +test eq get Q 1 4 +test apppoll 108 true +test appsent 108 true +note Old CODE must not mutate the code buffer during a newer chat job. +incoming 1 2 2 +test appreceive 109 +test eq get A 2 4 +test eq get C 1 0 +test eq get C 2 0 +test eq get Code 0 0 +test apppoll 109 true +test appsent 109 true +incoming 2 2 0 +test appreceive 109 +test eq get A 2 4 +test eq get R 1 1 +test eq get R 8 0 +test apppoll 109 true +test appsent 109 true +incoming 3 3 0 +test appreceive 110 +test eq get A 2 1 +test eq get R 1 0 +test eq get R 9 2 +test apppoll 110 true +test appsent 110 true +note Cancellation drops an outstanding send and stale response safely. +prompt false +test appask 111 +test apppoll 111 true +appcancel +test eq get R 1 0 +test eq get T 5 0 +test not appsent 111 true +incoming 1 4 0 +test not appreceive 112 +note Complete CODE bytes must arrive before a code response becomes visible. +prompt true +test appask 113 +test eq get R 0 5 +test eq get Q 1 6 +test apppoll 113 true +test appsent 113 true +incoming 1 5 2 +test appreceive 114 +test eq get A 2 0 +test eq codestat 2 +test eq get R 6 0 +test apppoll 114 true +test appsent 114 true +incoming 2 5 0 +test appreceive 115 +test eq get A 2 1 +test eq get R 6 1 +test eq get R 1 0 +test eq get Code 6 49 +test apppoll 115 true +test appsent 115 true +note WAIT updates silence deadline, no answer; slow and timeout cancel both layers. +prompt false +test appask 116 +test eq get R 0 6 +test apppoll 116 true +test appsent 116 true +incoming 1 6 1 +test appreceive 117 +test eq get A 2 0 +test eq get R 4 117 +test apppoll 117 true +test appsent 117 true +v = apppoll 20116 true +test eq get A 2 5 +test eq get R 1 1 +if v +test appsent 20116 true +end +v = apppoll 30116 true +test eq get R 1 1 +if v +test appsent 30116 true +end +v = apppoll 30117 true +test eq get A 2 6 +test eq get R 1 0 +test eq get T 5 0 +test eq get A 1 0 +if v +test appsent 30117 true +end +n = get R 9 +prompt false +test not appask 30116 +test eq get R 9 n +test not apppoll 30116 true +note Invalid prompt never becomes a pending job or transcript line. +put Inlen 0 160 +test not appask 30118 +test eq get R 9 n +test eq get R 0 6 +test eq get Q 1 7 +note Receiving a code completion before send-result reporting cannot replace +note the pending datagram with the newly generated AGAIN text. +prompt true +test appask 30118 +test apppoll 30118 true +test eq get T 10 1 +holdwire +incoming 1 7 0 +unhold +test appreceive 30119 +test eq get A 2 2 +test samewire +test eq get T 10 1 +test appsent 30119 true +test apppoll 30120 true +test eq get T 10 3 +test appsent 30120 true +test apppoll 30121 true +test eq get Q 1 9 +test eq get R 0 7 +test appsent 30121 true +appcancel +note Idle runtime still refuses a new prompt while a HELLO send is outstanding. +test apppoll 32122 true +test eq get T 10 5 +holdwire +n = get R 9 +prompt false +test not appask 32122 +test samewire +test eq get R 9 n +test appsent 32122 true +note Late CODE may complete the original job before queued AGAIN is sent. +prompt true +test appask 32123 +test eq get R 0 8 +test eq get Q 1 10 +test apppoll 32123 true +test appsent 32123 true +incoming 1 8 0 +test appreceive 32124 +test gt get A 1 0 +test apppoll 32124 true +test appsent 32124 true +incoming 2 8 2 +test appreceive 32125 +test eq codestat 2 +test apppoll 32125 true +test appsent 32125 true +incoming 3 8 0 +test appreceive 32126 +test eq get A 2 1 +test eq get R 1 0 +test eq get A 1 0 +test apppoll 32126 true +test appsent 32126 true +test not apppoll 32127 true +test eq get Q 1 10 +ret int get Fails 0 +end diff --git a/evidence/allen-omega-L694/L734/independent-review/development/independent-probe.log b/evidence/allen-omega-L694/L734/independent-review/development/independent-probe.log new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L734/independent-review/development/independent-probe.om b/evidence/allen-omega-L694/L734/independent-review/development/independent-probe.om new file mode 100644 index 00000000..08722b1b --- /dev/null +++ b/evidence/allen-omega-L694/L734/independent-review/development/independent-probe.om @@ -0,0 +1,2961 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +note Independent L737 application event-interleaving probe. Seeded Omega only. +fn probecheck ok bool id ulong to void +if not ok +put Fails 0 add get Fails 0 1 +end +end +fn line lineid ulong conv ulong to void +outreset +emitb 83 +emitb 65 +emitb 89 +emitb 32 +emitn conv +emitb 32 +emitb 49 +emitb 47 +emitb 49 +emitb 32 +emitb 111 +emitb 107 +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +b = packet 2 get Q 1 lineid 0 0 +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +end +fn prompt to void +put Inlen 0 5 +put In 0 104 +put In 1 101 +put In 2 108 +put In 3 108 +put In 4 111 +end +fn main to int +probecheck appinit 77 0 1 +prompt +probecheck appask 0 2 +probecheck apppoll 0 true 3 +probecheck appsent 0 true 4 +probecheck apppoll 0 true 5 +probecheck appsent 0 true 6 +line 1 1 +probecheck appreceive 1 7 +probecheck eq get R 1 0 8 +line 2 1 +probecheck appreceive 2 9 +probecheck eq get A 2 4 10 +probecheck eq get Q 4 2 11 +probecheck eq get T 13 2 12 +probecheck apppoll 2 true 13 +probecheck eq get T 10 3 14 +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +probecheck pkparse 15 +probecheck eq get N 0 4 16 +probecheck eq get N 2 2 17 +probecheck appsent 2 true 18 +probecheck eq get T 13 0 19 +probecheck not apppoll 3 true 20 +note Retry of the first accepted line is classified duplicate and then acknowledged. +line 1 1 +probecheck appreceive 4 21 +probecheck eq get T 13 1 22 +probecheck apppoll 4 true 23 +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +probecheck pkparse 24 +probecheck eq get N 0 4 25 +probecheck eq get N 2 1 26 +probecheck appsent 4 true 27 +ret int get Fails 0 +end diff --git a/evidence/allen-omega-L694/L734/independent-review/development/probe-final-50/probe.log b/evidence/allen-omega-L694/L734/independent-review/development/probe-final-50/probe.log new file mode 100644 index 00000000..107e4801 --- /dev/null +++ b/evidence/allen-omega-L694/L734/independent-review/development/probe-final-50/probe.log @@ -0,0 +1,50 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 diff --git a/evidence/allen-omega-L694/L734/independent-review/development/probe-final-50/probe.om b/evidence/allen-omega-L694/L734/independent-review/development/probe-final-50/probe.om new file mode 100644 index 00000000..8cd3b347 --- /dev/null +++ b/evidence/allen-omega-L694/L734/independent-review/development/probe-final-50/probe.om @@ -0,0 +1,3023 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +note Independent L737 application event-interleaving probe. Seeded Omega only. +global Probeout uchar 8192 +global Pstate ulong 2 +fn probecheck ok bool id ulong to void +put Pstate 0 get Outlen 0 +put Pstate 1 get Err 0 +for i ulong get Outlen 0 +put Probeout i get Outb i +end +check ok id +for i ulong get Pstate 0 +put Outb i get Probeout i +end +put Outlen 0 get Pstate 0 +put Err 0 get Pstate 1 +end +fn line lineid ulong conv ulong to void +outreset +emitb 83 +emitb 65 +emitb 89 +emitb 32 +emitn conv +emitb 32 +emitb 49 +emitb 47 +emitb 49 +emitb 32 +emitb 111 +emitb 107 +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +b = packet 2 get Q 1 lineid 0 0 +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +end +fn waitline lineid ulong to void +outreset +emitb 87 +emitb 65 +emitb 73 +emitb 84 +emitb 32 +emitb 49 +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +b = packet 2 get Q 1 lineid 0 0 +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +end +fn prompt to void +put Inlen 0 5 +put In 0 104 +put In 1 101 +put In 2 108 +put In 3 108 +put In 4 111 +end +fn readwire to void +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +end +fn main to int +probecheck appinit 77 0 1 +prompt +probecheck appask 0 2 +probecheck apppoll 0 true 3 +probecheck appsent 0 true 4 +probecheck apppoll 0 true 5 +probecheck appsent 0 true 6 +waitline 1 +probecheck appreceive 1 7 +probecheck eq get R 1 1 8 +probecheck eq get T 13 1 9 +note Distinct LINE is backpressured while GOT1 is pending; retry after receipt send. +line 2 1 +probecheck not appreceive 2 10 +probecheck eq get Q 2 1 11 +probecheck eq get T 13 1 12 +probecheck apppoll 2 true 13 +readwire +probecheck pkparse 14 +probecheck eq get N 0 3 15 +probecheck eq get N 2 1 16 +probecheck appsent 2 true 17 +probecheck eq get T 13 0 18 +line 2 1 +probecheck appreceive 3 19 +probecheck eq get A 2 1 20 +probecheck eq get R 1 0 21 +probecheck eq get T 13 2 22 +probecheck apppoll 3 true 23 +readwire +probecheck pkparse 24 +probecheck eq get N 0 3 25 +probecheck eq get N 2 2 26 +probecheck appsent 3 true 27 +probecheck not apppoll 4 true 28 +note Replayed acknowledged LINE is treated as duplicate and gets its own GOT. +waitline 1 +probecheck appreceive 4 29 +probecheck eq get T 13 1 30 +probecheck apppoll 4 true 31 +readwire +probecheck pkparse 32 +probecheck eq get N 0 3 33 +probecheck eq get N 2 1 34 +probecheck appsent 4 true 35 +probecheck not apppoll 5 true 36 +note Cancellation discards the offered JOB but wire and conversation counters persist. +prompt +probecheck appask 5 37 +probecheck apppoll 5 true 38 +probecheck eq get T 10 1 39 +appcancel +probecheck eq get T 5 0 40 +probecheck not appsent 5 true 41 +probecheck eq get Q 1 2 42 +probecheck eq get R 0 2 43 +prompt +probecheck appask 6 44 +probecheck eq get Q 1 3 45 +probecheck eq get R 0 3 46 +appcancel +old = get R 9 +put Q 1 4294967295 +prompt +probecheck not appask 7 47 +probecheck eq get R 0 3 48 +probecheck eq get R 9 old 49 +probecheck eq get Q 1 4294967295 50 +ret int get Fails 0 +end diff --git a/evidence/allen-omega-L694/L734/independent-review/development/probe-final-pass/probe.log b/evidence/allen-omega-L694/L734/independent-review/development/probe-final-pass/probe.log new file mode 100644 index 00000000..f25a2fd2 --- /dev/null +++ b/evidence/allen-omega-L694/L734/independent-review/development/probe-final-pass/probe.log @@ -0,0 +1,36 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 diff --git a/evidence/allen-omega-L694/L734/independent-review/development/probe-final-pass/probe.om b/evidence/allen-omega-L694/L734/independent-review/development/probe-final-pass/probe.om new file mode 100644 index 00000000..05015ca5 --- /dev/null +++ b/evidence/allen-omega-L694/L734/independent-review/development/probe-final-pass/probe.om @@ -0,0 +1,3001 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +note Independent L737 application event-interleaving probe. Seeded Omega only. +global Probeout uchar 8192 +global Pstate ulong 2 +fn probecheck ok bool id ulong to void +put Pstate 0 get Outlen 0 +put Pstate 1 get Err 0 +for i ulong get Outlen 0 +put Probeout i get Outb i +end +check ok id +for i ulong get Pstate 0 +put Outb i get Probeout i +end +put Outlen 0 get Pstate 0 +put Err 0 get Pstate 1 +end +fn line lineid ulong conv ulong to void +outreset +emitb 83 +emitb 65 +emitb 89 +emitb 32 +emitn conv +emitb 32 +emitb 49 +emitb 47 +emitb 49 +emitb 32 +emitb 111 +emitb 107 +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +b = packet 2 get Q 1 lineid 0 0 +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +end +fn waitline lineid ulong to void +outreset +emitb 87 +emitb 65 +emitb 73 +emitb 84 +emitb 32 +emitb 49 +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +b = packet 2 get Q 1 lineid 0 0 +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +end +fn prompt to void +put Inlen 0 5 +put In 0 104 +put In 1 101 +put In 2 108 +put In 3 108 +put In 4 111 +end +fn readwire to void +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +end +fn main to int +probecheck appinit 77 0 1 +prompt +probecheck appask 0 2 +probecheck apppoll 0 true 3 +probecheck appsent 0 true 4 +probecheck apppoll 0 true 5 +probecheck appsent 0 true 6 +waitline 1 +probecheck appreceive 1 7 +probecheck eq get R 1 1 8 +probecheck eq get T 13 1 9 +note Distinct LINE is backpressured while GOT1 is pending; retry after receipt send. +line 2 1 +probecheck not appreceive 2 10 +probecheck eq get Q 2 1 11 +probecheck eq get T 13 1 12 +probecheck apppoll 2 true 13 +readwire +probecheck pkparse 14 +probecheck eq get N 0 3 15 +probecheck eq get N 2 1 16 +probecheck appsent 2 true 17 +probecheck eq get T 13 0 18 +line 2 1 +probecheck appreceive 3 19 +probecheck eq get A 2 1 20 +probecheck eq get R 1 0 21 +probecheck eq get T 13 2 22 +probecheck apppoll 3 true 23 +readwire +probecheck pkparse 24 +probecheck eq get N 0 3 25 +probecheck eq get N 2 2 26 +probecheck appsent 3 true 27 +probecheck not apppoll 4 true 28 +note Replayed acknowledged LINE is treated as duplicate and gets its own GOT. +waitline 1 +probecheck appreceive 4 29 +probecheck eq get T 13 1 30 +probecheck apppoll 4 true 31 +readwire +probecheck pkparse 32 +probecheck eq get N 0 3 33 +probecheck eq get N 2 1 34 +probecheck appsent 4 true 35 +probecheck not apppoll 5 true 36 +ret int get Fails 0 +end diff --git a/evidence/allen-omega-L694/L734/independent-review/development/probe-final/probe.log b/evidence/allen-omega-L694/L734/independent-review/development/probe-final/probe.log new file mode 100644 index 00000000..b5fe8eac --- /dev/null +++ b/evidence/allen-omega-L694/L734/independent-review/development/probe-final/probe.log @@ -0,0 +1,36 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 1 +15 1 +16 1 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 1 +25 1 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 1 +33 1 +34 0 +35 0 +36 0 diff --git a/evidence/allen-omega-L694/L734/independent-review/development/probe-final/probe.om b/evidence/allen-omega-L694/L734/independent-review/development/probe-final/probe.om new file mode 100644 index 00000000..edf1ff2a --- /dev/null +++ b/evidence/allen-omega-L694/L734/independent-review/development/probe-final/probe.om @@ -0,0 +1,2989 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +note Independent L737 application event-interleaving probe. Seeded Omega only. +fn probecheck ok bool id ulong to void +check ok id +end +fn line lineid ulong conv ulong to void +outreset +emitb 83 +emitb 65 +emitb 89 +emitb 32 +emitn conv +emitb 32 +emitb 49 +emitb 47 +emitb 49 +emitb 32 +emitb 111 +emitb 107 +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +b = packet 2 get Q 1 lineid 0 0 +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +end +fn waitline lineid ulong to void +outreset +emitb 87 +emitb 65 +emitb 73 +emitb 84 +emitb 32 +emitb 49 +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +b = packet 2 get Q 1 lineid 0 0 +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +end +fn prompt to void +put Inlen 0 5 +put In 0 104 +put In 1 101 +put In 2 108 +put In 3 108 +put In 4 111 +end +fn readwire to void +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +end +fn main to int +probecheck appinit 77 0 1 +prompt +probecheck appask 0 2 +probecheck apppoll 0 true 3 +probecheck appsent 0 true 4 +probecheck apppoll 0 true 5 +probecheck appsent 0 true 6 +waitline 1 +probecheck appreceive 1 7 +probecheck eq get R 1 1 8 +probecheck eq get T 13 1 9 +note Distinct LINE is backpressured while GOT1 is pending; retry after receipt send. +line 2 1 +probecheck not appreceive 2 10 +probecheck eq get Q 2 1 11 +probecheck eq get T 13 1 12 +probecheck apppoll 2 true 13 +readwire +probecheck pkparse 14 +probecheck eq get N 0 4 15 +probecheck eq get N 2 1 16 +probecheck appsent 2 true 17 +probecheck eq get T 13 0 18 +line 2 1 +probecheck appreceive 3 19 +probecheck eq get A 2 1 20 +probecheck eq get R 1 0 21 +probecheck eq get T 13 2 22 +probecheck apppoll 3 true 23 +readwire +probecheck pkparse 24 +probecheck eq get N 0 4 25 +probecheck eq get N 2 2 26 +probecheck appsent 3 true 27 +probecheck not apppoll 4 true 28 +note Replayed acknowledged LINE is treated as duplicate and gets its own GOT. +waitline 1 +probecheck appreceive 4 29 +probecheck eq get T 13 1 30 +probecheck apppoll 4 true 31 +readwire +probecheck pkparse 32 +probecheck eq get N 0 4 33 +probecheck eq get N 2 1 34 +probecheck appsent 4 true 35 +probecheck not apppoll 5 true 36 +ret int get Fails 0 +end diff --git a/evidence/allen-omega-L694/L734/independent-review/development/probe-verified/probe.om b/evidence/allen-omega-L694/L734/independent-review/development/probe-verified/probe.om new file mode 100644 index 00000000..6501e3dc --- /dev/null +++ b/evidence/allen-omega-L694/L734/independent-review/development/probe-verified/probe.om @@ -0,0 +1,3001 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +note Independent L737 application event-interleaving probe. Seeded Omega only. +global Probeout uchar 8192 +global Probestate ulong 2 +fn probecheck ok bool id ulong to void +put Probestate 0 get Outlen 0 +put Probestate 1 get Err 0 +for i ulong get Outlen 0 +put Probeout i get Outb i +end +check ok id +for i ulong get Probestate 0 +put Outb i get Probeout i +end +put Outlen 0 get Probestate 0 +put Err 0 get Probestate 1 +end +fn line lineid ulong conv ulong to void +outreset +emitb 83 +emitb 65 +emitb 89 +emitb 32 +emitn conv +emitb 32 +emitb 49 +emitb 47 +emitb 49 +emitb 32 +emitb 111 +emitb 107 +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +b = packet 2 get Q 1 lineid 0 0 +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +end +fn waitline lineid ulong to void +outreset +emitb 87 +emitb 65 +emitb 73 +emitb 84 +emitb 32 +emitb 49 +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +b = packet 2 get Q 1 lineid 0 0 +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +end +fn prompt to void +put Inlen 0 5 +put In 0 104 +put In 1 101 +put In 2 108 +put In 3 108 +put In 4 111 +end +fn readwire to void +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +end +fn main to int +probecheck appinit 77 0 1 +prompt +probecheck appask 0 2 +probecheck apppoll 0 true 3 +probecheck appsent 0 true 4 +probecheck apppoll 0 true 5 +probecheck appsent 0 true 6 +waitline 1 +probecheck appreceive 1 7 +probecheck eq get R 1 1 8 +probecheck eq get T 13 1 9 +note Distinct LINE is backpressured while GOT1 is pending; retry after receipt send. +line 2 1 +probecheck not appreceive 2 10 +probecheck eq get Q 2 1 11 +probecheck eq get T 13 1 12 +probecheck apppoll 2 true 13 +readwire +probecheck pkparse 14 +probecheck eq get N 0 4 15 +probecheck eq get N 2 1 16 +probecheck appsent 2 true 17 +probecheck eq get T 13 0 18 +line 2 1 +probecheck appreceive 3 19 +probecheck eq get A 2 1 20 +probecheck eq get R 1 0 21 +probecheck eq get T 13 2 22 +probecheck apppoll 3 true 23 +readwire +probecheck pkparse 24 +probecheck eq get N 0 4 25 +probecheck eq get N 2 2 26 +probecheck appsent 3 true 27 +probecheck not apppoll 4 true 28 +note Replayed acknowledged LINE is treated as duplicate and gets its own GOT. +waitline 1 +probecheck appreceive 4 29 +probecheck eq get T 13 1 30 +probecheck apppoll 4 true 31 +readwire +probecheck pkparse 32 +probecheck eq get N 0 4 33 +probecheck eq get N 2 1 34 +probecheck appsent 4 true 35 +probecheck not apppoll 5 true 36 +ret int get Fails 0 +end diff --git a/evidence/allen-omega-L694/L734/independent-review/development/probe-verified2/probe.log b/evidence/allen-omega-L694/L734/independent-review/development/probe-verified2/probe.log new file mode 100644 index 00000000..0e75a60b --- /dev/null +++ b/evidence/allen-omega-L694/L734/independent-review/development/probe-verified2/probe.log @@ -0,0 +1,36 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 1 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 1 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 1 +34 0 +35 0 +36 0 diff --git a/evidence/allen-omega-L694/L734/independent-review/development/probe-verified2/probe.om b/evidence/allen-omega-L694/L734/independent-review/development/probe-verified2/probe.om new file mode 100644 index 00000000..04034e39 --- /dev/null +++ b/evidence/allen-omega-L694/L734/independent-review/development/probe-verified2/probe.om @@ -0,0 +1,3001 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +note Independent L737 application event-interleaving probe. Seeded Omega only. +global Probeout uchar 8192 +global Pstate ulong 2 +fn probecheck ok bool id ulong to void +put Pstate 0 get Outlen 0 +put Pstate 1 get Err 0 +for i ulong get Outlen 0 +put Probeout i get Outb i +end +check ok id +for i ulong get Pstate 0 +put Outb i get Probeout i +end +put Outlen 0 get Pstate 0 +put Err 0 get Pstate 1 +end +fn line lineid ulong conv ulong to void +outreset +emitb 83 +emitb 65 +emitb 89 +emitb 32 +emitn conv +emitb 32 +emitb 49 +emitb 47 +emitb 49 +emitb 32 +emitb 111 +emitb 107 +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +b = packet 2 get Q 1 lineid 0 0 +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +end +fn waitline lineid ulong to void +outreset +emitb 87 +emitb 65 +emitb 73 +emitb 84 +emitb 32 +emitb 49 +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +b = packet 2 get Q 1 lineid 0 0 +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +end +fn prompt to void +put Inlen 0 5 +put In 0 104 +put In 1 101 +put In 2 108 +put In 3 108 +put In 4 111 +end +fn readwire to void +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +end +fn main to int +probecheck appinit 77 0 1 +prompt +probecheck appask 0 2 +probecheck apppoll 0 true 3 +probecheck appsent 0 true 4 +probecheck apppoll 0 true 5 +probecheck appsent 0 true 6 +waitline 1 +probecheck appreceive 1 7 +probecheck eq get R 1 1 8 +probecheck eq get T 13 1 9 +note Distinct LINE is backpressured while GOT1 is pending; retry after receipt send. +line 2 1 +probecheck not appreceive 2 10 +probecheck eq get Q 2 1 11 +probecheck eq get T 13 1 12 +probecheck apppoll 2 true 13 +readwire +probecheck pkparse 14 +probecheck eq get N 0 4 15 +probecheck eq get N 2 1 16 +probecheck appsent 2 true 17 +probecheck eq get T 13 0 18 +line 2 1 +probecheck appreceive 3 19 +probecheck eq get A 2 1 20 +probecheck eq get R 1 0 21 +probecheck eq get T 13 2 22 +probecheck apppoll 3 true 23 +readwire +probecheck pkparse 24 +probecheck eq get N 0 4 25 +probecheck eq get N 2 2 26 +probecheck appsent 3 true 27 +probecheck not apppoll 4 true 28 +note Replayed acknowledged LINE is treated as duplicate and gets its own GOT. +waitline 1 +probecheck appreceive 4 29 +probecheck eq get T 13 1 30 +probecheck apppoll 4 true 31 +readwire +probecheck pkparse 32 +probecheck eq get N 0 4 33 +probecheck eq get N 2 1 34 +probecheck appsent 4 true 35 +probecheck not apppoll 5 true 36 +ret int get Fails 0 +end diff --git a/evidence/allen-omega-L694/L734/independent-review/development/probe2/probe.log b/evidence/allen-omega-L694/L734/independent-review/development/probe2/probe.log new file mode 100644 index 00000000..d5172bc2 --- /dev/null +++ b/evidence/allen-omega-L694/L734/independent-review/development/probe2/probe.log @@ -0,0 +1,27 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 1 +10 1 +11 1 +12 1 +13 0 +14 0 +15 1 +16 1 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 1 +25 1 +26 0 +27 0 diff --git a/evidence/allen-omega-L694/L734/independent-review/development/probe2/probe.om b/evidence/allen-omega-L694/L734/independent-review/development/probe2/probe.om new file mode 100644 index 00000000..213f5ec9 --- /dev/null +++ b/evidence/allen-omega-L694/L734/independent-review/development/probe2/probe.om @@ -0,0 +1,2959 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +note Independent L737 application event-interleaving probe. Seeded Omega only. +fn probecheck ok bool id ulong to void +check ok id +end +fn line lineid ulong conv ulong to void +outreset +emitb 83 +emitb 65 +emitb 89 +emitb 32 +emitn conv +emitb 32 +emitb 49 +emitb 47 +emitb 49 +emitb 32 +emitb 111 +emitb 107 +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +b = packet 2 get Q 1 lineid 0 0 +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +end +fn prompt to void +put Inlen 0 5 +put In 0 104 +put In 1 101 +put In 2 108 +put In 3 108 +put In 4 111 +end +fn main to int +probecheck appinit 77 0 1 +prompt +probecheck appask 0 2 +probecheck apppoll 0 true 3 +probecheck appsent 0 true 4 +probecheck apppoll 0 true 5 +probecheck appsent 0 true 6 +line 1 1 +probecheck appreceive 1 7 +probecheck eq get R 1 0 8 +line 2 1 +probecheck appreceive 2 9 +probecheck eq get A 2 4 10 +probecheck eq get Q 4 2 11 +probecheck eq get T 13 2 12 +probecheck apppoll 2 true 13 +probecheck eq get T 10 3 14 +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +probecheck pkparse 15 +probecheck eq get N 0 4 16 +probecheck eq get N 2 2 17 +probecheck appsent 2 true 18 +probecheck eq get T 13 0 19 +probecheck not apppoll 3 true 20 +note Retry of the first accepted line is classified duplicate and then acknowledged. +line 1 1 +probecheck appreceive 4 21 +probecheck eq get T 13 1 22 +probecheck apppoll 4 true 23 +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +probecheck pkparse 24 +probecheck eq get N 0 4 25 +probecheck eq get N 2 1 26 +probecheck appsent 4 true 27 +ret int get Fails 0 +end diff --git a/evidence/allen-omega-L694/L734/independent-review/development/probe3/probe.log b/evidence/allen-omega-L694/L734/independent-review/development/probe3/probe.log new file mode 100644 index 00000000..c66b5768 --- /dev/null +++ b/evidence/allen-omega-L694/L734/independent-review/development/probe3/probe.log @@ -0,0 +1,27 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 1 +9 1 +10 1 +11 1 +12 1 +13 0 +14 0 +15 1 +16 1 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 1 +25 1 +26 0 +27 0 diff --git a/evidence/allen-omega-L694/L734/independent-review/development/probe3/probe.om b/evidence/allen-omega-L694/L734/independent-review/development/probe3/probe.om new file mode 100644 index 00000000..5d598edc --- /dev/null +++ b/evidence/allen-omega-L694/L734/independent-review/development/probe3/probe.om @@ -0,0 +1,2977 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +note Independent L737 application event-interleaving probe. Seeded Omega only. +fn probecheck ok bool id ulong to void +check ok id +end +fn line lineid ulong conv ulong to void +outreset +emitb 83 +emitb 65 +emitb 89 +emitb 32 +emitn conv +emitb 32 +emitb 49 +emitb 47 +emitb 49 +emitb 32 +emitb 111 +emitb 107 +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +b = packet 2 get Q 1 lineid 0 0 +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +end +fn waitline lineid ulong to void +outreset +emitb 87 +emitb 65 +emitb 73 +emitb 84 +emitb 32 +emitb 49 +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +b = packet 2 get Q 1 lineid 0 0 +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +end +fn prompt to void +put Inlen 0 5 +put In 0 104 +put In 1 101 +put In 2 108 +put In 3 108 +put In 4 111 +end +fn main to int +probecheck appinit 77 0 1 +prompt +probecheck appask 0 2 +probecheck apppoll 0 true 3 +probecheck appsent 0 true 4 +probecheck apppoll 0 true 5 +probecheck appsent 0 true 6 +waitline 1 +probecheck appreceive 1 7 +probecheck eq get R 1 0 8 +line 2 1 +probecheck appreceive 2 9 +probecheck eq get A 2 1 10 +probecheck eq get Q 4 2 11 +probecheck eq get T 13 2 12 +probecheck apppoll 2 true 13 +probecheck eq get T 10 3 14 +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +probecheck pkparse 15 +probecheck eq get N 0 4 16 +probecheck eq get N 2 2 17 +probecheck appsent 2 true 18 +probecheck eq get T 13 0 19 +probecheck not apppoll 3 true 20 +note Retry of the first accepted line is classified duplicate and then acknowledged. +line 1 1 +probecheck appreceive 4 21 +probecheck eq get T 13 1 22 +probecheck apppoll 4 true 23 +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +probecheck pkparse 24 +probecheck eq get N 0 4 25 +probecheck eq get N 2 1 26 +probecheck appsent 4 true 27 +ret int get Fails 0 +end diff --git a/evidence/allen-omega-L694/L734/independent-review/parent-probe.log b/evidence/allen-omega-L694/L734/independent-review/parent-probe.log new file mode 100644 index 00000000..107e4801 --- /dev/null +++ b/evidence/allen-omega-L694/L734/independent-review/parent-probe.log @@ -0,0 +1,50 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 diff --git a/evidence/allen-omega-L694/L734/independent-review/parent-verification.md b/evidence/allen-omega-L694/L734/independent-review/parent-verification.md new file mode 100644 index 00000000..ee3d2c79 --- /dev/null +++ b/evidence/allen-omega-L694/L734/independent-review/parent-verification.md @@ -0,0 +1,21 @@ +# Parent verification and disposition + +Reviewed exact8d0d11babf7cc3b57ee000a265aeda9fe531ebf0. The report has no +substantive findings. All39 exported native files match the exact Git pin, with +no membership changes. Reconstructed core and final probe concatenations match +source+check.om+independent probe exactly. The reported application/probe binary +SHA256 values match actual artifacts. Parent independently rebuilt the final +probe byte-identically and replayed50/50 checks,exit0. Existing application +rebuild182/182 and current combined native gate remain passing. + +Developmental probes are retained, not relabeled passing. Early probes assumed +LINE could replace a pending GOT and used the wrong parsed GOT enum. The already +published provider contract requires one-pending-GOT backpressure; final probes +assert refusal/no mutation followed by successful retry. Enum3 is the declared +GOT value. Another probe logger overwrote Outb; final helper preserves its bytes, +length and error. Production source was unchanged across those probe revisions. + +Clears independent review only for L734 application binding, not for the new L740 +scene decoder. No socket/device/EFI/live model/physical iMac qualification. +Original report hash:36ed362fa8693f24516659ef76808b78ea1ff8d42aa9921a5340917edb924ce1. +Verified final probe ELF:e792b6ad96152cf123b2caa46ce46bf501e5c5f2d8f036cf078e1b0eb1a64c32. diff --git a/evidence/allen-omega-L694/L734/independent-review/probes/L737-interleave.om b/evidence/allen-omega-L694/L734/independent-review/probes/L737-interleave.om new file mode 100644 index 00000000..a2f15a49 --- /dev/null +++ b/evidence/allen-omega-L694/L734/independent-review/probes/L737-interleave.om @@ -0,0 +1,143 @@ +note Independent L737 application event-interleaving probe. Seeded Omega only. +global Probeout uchar 8192 +global Pstate ulong 2 +fn probecheck ok bool id ulong to void +put Pstate 0 get Outlen 0 +put Pstate 1 get Err 0 +for i ulong get Outlen 0 +put Probeout i get Outb i +end +check ok id +for i ulong get Pstate 0 +put Outb i get Probeout i +end +put Outlen 0 get Pstate 0 +put Err 0 get Pstate 1 +end +fn line lineid ulong conv ulong to void +outreset +emitb 83 +emitb 65 +emitb 89 +emitb 32 +emitn conv +emitb 32 +emitb 49 +emitb 47 +emitb 49 +emitb 32 +emitb 111 +emitb 107 +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +b = packet 2 get Q 1 lineid 0 0 +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +end +fn waitline lineid ulong to void +outreset +emitb 87 +emitb 65 +emitb 73 +emitb 84 +emitb 32 +emitb 49 +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +b = packet 2 get Q 1 lineid 0 0 +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +end +fn prompt to void +put Inlen 0 5 +put In 0 104 +put In 1 101 +put In 2 108 +put In 3 108 +put In 4 111 +end +fn readwire to void +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +end +fn main to int +probecheck appinit 77 0 1 +prompt +probecheck appask 0 2 +probecheck apppoll 0 true 3 +probecheck appsent 0 true 4 +probecheck apppoll 0 true 5 +probecheck appsent 0 true 6 +waitline 1 +probecheck appreceive 1 7 +probecheck eq get R 1 1 8 +probecheck eq get T 13 1 9 +note Distinct LINE is backpressured while GOT1 is pending; retry after receipt send. +line 2 1 +probecheck not appreceive 2 10 +probecheck eq get Q 2 1 11 +probecheck eq get T 13 1 12 +probecheck apppoll 2 true 13 +readwire +probecheck pkparse 14 +probecheck eq get N 0 3 15 +probecheck eq get N 2 1 16 +probecheck appsent 2 true 17 +probecheck eq get T 13 0 18 +line 2 1 +probecheck appreceive 3 19 +probecheck eq get A 2 1 20 +probecheck eq get R 1 0 21 +probecheck eq get T 13 2 22 +probecheck apppoll 3 true 23 +readwire +probecheck pkparse 24 +probecheck eq get N 0 3 25 +probecheck eq get N 2 2 26 +probecheck appsent 3 true 27 +probecheck not apppoll 4 true 28 +note Replayed acknowledged LINE is treated as duplicate and gets its own GOT. +waitline 1 +probecheck appreceive 4 29 +probecheck eq get T 13 1 30 +probecheck apppoll 4 true 31 +readwire +probecheck pkparse 32 +probecheck eq get N 0 3 33 +probecheck eq get N 2 1 34 +probecheck appsent 4 true 35 +probecheck not apppoll 5 true 36 +note Cancellation discards the offered JOB but wire and conversation counters persist. +prompt +probecheck appask 5 37 +probecheck apppoll 5 true 38 +probecheck eq get T 10 1 39 +appcancel +probecheck eq get T 5 0 40 +probecheck not appsent 5 true 41 +probecheck eq get Q 1 2 42 +probecheck eq get R 0 2 43 +prompt +probecheck appask 6 44 +probecheck eq get Q 1 3 45 +probecheck eq get R 0 3 46 +appcancel +old = get R 9 +put Q 1 4294967295 +prompt +probecheck not appask 7 47 +probecheck eq get R 0 3 48 +probecheck eq get R 9 old 49 +probecheck eq get Q 1 4294967295 50 +ret int get Fails 0 +end diff --git a/evidence/allen-omega-L694/L734/independent-review/report.md b/evidence/allen-omega-L694/L734/independent-review/report.md new file mode 100644 index 00000000..46e6e71a --- /dev/null +++ b/evidence/allen-omega-L694/L734/independent-review/report.md @@ -0,0 +1,29 @@ +# L737 independent review — L734 native Omega application binding + +## Verdict + +**No substantive findings** in the reviewed native application/runtime/courier integration at `8d0d11babf7cc3b57ee000a265aeda9fe531ebf0` (base `0db871fdc1fabefa99012cbd3f6e8cd83fdfcf2e`). Scope is the host-executed, transport-independent Omega core only. This does not qualify a socket/provider binding, live service, iMac, EFI/device path, or full Allen replacement. + +## Source and compiler receipts + +- Fresh `git archive` export: `~/handoffs/L737-review/source`; all 39 files under `native/omega/allen` matched the exact pinned Git tree byte-for-byte; no missing or extra files. Manifest: `source-closure.sha256`. +- Application source SHA-256: `68f02db782e9c5a506e64972123129c9cc761c78ce6f39e40d2eb7c73394bcfe`. +- Parent application-test SHA-256: `f4e6bb5571a0700febdecfc6209ae1c088eab50a82bce4d8a10179408e3abb5f`. +- Pinned compiler SHA-256: `191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9`. +- Both freshly built test artifacts passed `build-one.sh` checks for nonempty static AArch64 `EXEC`; `readelf` showed no dynamic section for the independent probe. + +## Executed results + +1. Rebuilt and ran exact-source `tests/application.om`: **exit 0; 182/182 checks passed**. ELF SHA-256 `ba8dd2746d9612599cc96b2d98c0b2e70a9230bfa0dbb3ec003fd08bdd756fec`; log `build/app-baseline.log`. +2. Authored and ran `probes/L737-interleave.om` (Omega only): **exit 0; 50/50 checks passed**. Binary SHA-256 `e792b6ad96152cf123b2caa46ce46bf501e5c5f2d8f036cf078e1b0eb1a64c32`; log `build/probe-final-50/probe.log`. + +The independent probe exercised a received WAIT followed by a distinct LINE while its GOT was pending, verified transport backpressure leaves the first receipt pending, retried the LINE after GOT send, decoded the resulting GOT sequence, replayed an acknowledged LINE and verified duplicate receipt, cancelled an offered JOB and confirmed both counters were retained, then forced wire-ID exhaustion and checked request ID/transcript count remained unchanged. All expected state/output assertions passed. + +## Files + +- `report.md` — this review. +- `source/` and `source-closure.sha256` — exact source export and per-file closure manifest. +- `probes/L737-interleave.om` — independent Omega probe source. +- `build/` — assembled Omega inputs, logs and native artifacts, including the application rebuild and successful 50-check probe. + +No production or compiler files were modified. No whole Allen suite, socket, service, agent, hardware or deployment work was run. diff --git a/evidence/allen-omega-L694/L734/independent-review/source-closure.sha256 b/evidence/allen-omega-L694/L734/independent-review/source-closure.sha256 new file mode 100644 index 00000000..5fbe917e --- /dev/null +++ b/evidence/allen-omega-L694/L734/independent-review/source-closure.sha256 @@ -0,0 +1,39 @@ +68f02db782e9c5a506e64972123129c9cc761c78ce6f39e40d2eb7c73394bcfe native/omega/allen/application.om +184f4270c72c4eca6a7afdd28b70a608f2e237980b12c8a7bfc2c7d2c3e625b9 native/omega/allen/base.om +795ca28627a19f1088de0f23277e79cdac921ff88451c606c7b655ce0f2e8a5b native/omega/allen/build-one.sh +4d2235ac5d6b237695b1c3112f70ebdfa0cebafa2ec8e691e4be4de37a62199b native/omega/allen/code.om +76ee9cdeaac036905c76dfa29f42bf5a78d1259ad1656adfaa24916c3b93550d native/omega/allen/courier.om +87024b3e838ab15860991cdf5f70cfa4ad2b63ec2b9b843cb2da0276143fcf5f native/omega/allen/gate.sh +9d71a653870eeef678f95df04db9c38aedaadd06e7c74bf3e5d9fde6e28f82f8 native/omega/allen/golden.sh +06087bc573ebb876a0ed80f6025c592fb4b1d23335169c3da402824fd1482c35 native/omega/allen/intent.om +4bc37c95d553364c5d2925d8ff9e8a53b1a61974513e6f492f77b7ebb05bbda4 native/omega/allen/main.om +068292abd04d3a61b063fc5380b22a56c4235a87915c219ebf3b37d16d7bc9c7 native/omega/allen/memory.om +b4d7b6e6cd680d2ba1eec2978b0cbb81ffc63035b73f5c3726bdad97a7b6aa04 native/omega/allen/paint.om +ba47aedd0244c5229f8543aad7fd5120631c6f4cf502fde038ca27e7659cecec native/omega/allen/README.md +e50a7f673aaee92aba4a3aec303aa93b071121c09ad05d4ad1dcc2deb9706dcc native/omega/allen/reply.om +5b01eae03204d08f6d207ef29f2ba09a1d9f249f1738f68f151214675a4ff2ed native/omega/allen/runtime.om +c8d4a437b41538cc1eeb62a2029c6993d41e5ef90cc7b26c8e1c92bc98ec57d3 native/omega/allen/scene.om +615dff78462a715153b3d891b2cfe146c318d3a0a26ae1aaa642484f965c12df native/omega/allen/scheduler.om +f4e6bb5571a0700febdecfc6209ae1c088eab50a82bce4d8a10179408e3abb5f native/omega/allen/tests/application.om +f085198549d1c235a97574ff6f6560ce82217611f4051fc3dbbc8286aab6d536 native/omega/allen/tests/check.om +b76438a85257bd95768115047be286c107e3723628a16a0541870732d0849a42 native/omega/allen/tests/code.om +98105e1c30626f54da07940fe0415637730b7e112ea39ba2aae1f2d648993373 native/omega/allen/tests/courier.om +f524aab74657dc2e9e4330bf42bc05ef01ce3e8f08a05c80371be0c0a33764d3 native/omega/allen/tests/edges.om +a2e8bcde92d522216a4fa99559dd3bcba096aea86127364587dadcc2bfb585af native/omega/allen/tests/fixture.om +c9ef2bee7cbd1c072c6045d62c55f3bdd938901e91792cee72ea57fb8f25a198 native/omega/allen/tests/golden.om +8ba742d85ea510586f3cf86661bc0f28c5d99b59981c2d3fb220705efad24564 native/omega/allen/tests/intent.om +861d9af698b021056cceb6c00ae3458558db415963fe832d3fca7da55731cf7b native/omega/allen/tests/memory.om +13e4db7436165783c6aad48497ffe89fa6e5ba3de928e66a766c29e1e817fcf5 native/omega/allen/tests/paint.om +e6d232d92d74d88423cebbbbfc6e403ea9b865b80c909e1d23087001d905035a native/omega/allen/tests/probe.om +8fbc8a0517900efd771a994686356416a0fea5e20cfd9bc26c787850398113df native/omega/allen/tests/render.om +094a5e833bae7dfd3b013e3f015f143e9d7bd3efe9b9c896a7f58b09e1ec14b8 native/omega/allen/tests/reply.om +bab9b0e853aa4b62918353a5d1625a3171deebfb639e599fe9751b5a61a3df62 native/omega/allen/tests/runtime.om +b9c84d9a58658589137764fe60209d8320550dd8ed99fa6026df65ba48737e4f native/omega/allen/tests/scene.om +bf984fa9cf63ddb569147afc2a028ccdafdbeae2067125cf35d658e5d00f4c94 native/omega/allen/tests/scheduler.om +521fff50f312b64801017b1349d9a31dac6eac50eb989d93d2dbac4e100f5007 native/omega/allen/tests/stdio-overflow.om +89aee5326b428147ea6da9aa739b6679e214ed114ae5f41d3b70299cf864092c native/omega/allen/tests/view.om +0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0 native/omega/allen/vendor/OMEGA-LICENSE +b234738e8ce81b3d67586deb41fdaab4543169d4b69e86fd3dc28a08432ab5fc native/omega/allen/vendor/PROVENANCE.md +992ec4a4957271b442740598136887a5c610effcd8ae9fb9480a006a4f181097 native/omega/allen/vendor/sha256-core.om +0781cdcec18570a57afbe3be4a6717dd2d1fa4c887b49a3e4cb542b594f8a041 native/omega/allen/vendor/sha256.om +abbefd2f7dc48f2ac28b9526f5c2e5b369da4b7c5e84dde6e6a3cd20bd5687ac native/omega/allen/view.om diff --git a/evidence/allen-omega-L694/L734/intent.log b/evidence/allen-omega-L694/L734/intent.log new file mode 100644 index 00000000..5371bd36 --- /dev/null +++ b/evidence/allen-omega-L694/L734/intent.log @@ -0,0 +1,8 @@ +501 0 +502 0 +503 0 +504 0 +505 0 +506 0 +507 0 +508 0 diff --git a/evidence/allen-omega-L694/L734/keepalive-mutant.log b/evidence/allen-omega-L694/L734/keepalive-mutant.log new file mode 100644 index 00000000..2e3415df --- /dev/null +++ b/evidence/allen-omega-L694/L734/keepalive-mutant.log @@ -0,0 +1,213 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 1 +19 1 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 1 +54 1 +55 1 +56 1 +57 0 +58 0 +59 1 +60 0 +61 0 +62 0 +63 0 +64 0 +65 1 +66 0 +67 0 +68 0 +69 1 +70 1 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 1 +170 0 +171 1 +172 1 +173 0 +174 1 +175 0 +176 0 +177 0 +178 1 +179 1 +180 1 +181 1 +182 1 +183 1 +184 1 +185 1 +186 1 +187 1 +188 1 +189 1 +190 1 +191 1 +192 1 +193 1 +194 1 +195 1 +196 1 +197 1 +198 0 +199 1 +200 0 +201 0 +202 1 +203 1 +204 1 +205 0 +206 1 +207 1 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 diff --git a/evidence/allen-omega-L694/L734/late-code/README.md b/evidence/allen-omega-L694/L734/late-code/README.md new file mode 100644 index 00000000..51b12d27 --- /dev/null +++ b/evidence/allen-omega-L694/L734/late-code/README.md @@ -0,0 +1,17 @@ +# Late CODE completion correction + +Follow-on to initial application milestone b4852db, before independent review. +A late CODE and final SAY can arrive on the original wire job after the first +missing-code response queues AGAIN, but before that retry is submitted. The +original code retained the queued retry after successful completion, causing an +unnecessary new wire job. New native regression:182 assertions,3 failures, +exit3 (`latecode-red`), preserving the original source and output. + +The successful-completion branch now clears queued recovery bytes. The unchanged +regression passes182/182 within the complete fresh native suite. `counts.json` +and `final.log` are the final source verdict:1274 checks pass,9 compiled mutants +rejected, original stdio/memory goldens and overflow refusal pass. This supersedes +the initial1253-check source qualification for the changed application file; the +initial receipts are preserved, not rewritten. Source inventory was checked +against actual bytes immediately before commit. Independent review pending; +transport, device, x86 and iMac qualification remain open. diff --git a/evidence/allen-omega-L694/L734/late-code/ackstop-mutant.log b/evidence/allen-omega-L694/L734/late-code/ackstop-mutant.log new file mode 100644 index 00000000..5d0598cb --- /dev/null +++ b/evidence/allen-omega-L694/L734/late-code/ackstop-mutant.log @@ -0,0 +1,213 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 1 +65 1 +66 0 +67 0 +68 0 +69 1 +70 1 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 1 +165 0 +166 0 +167 0 +168 0 +169 1 +170 0 +171 1 +172 1 +173 0 +174 1 +175 0 +176 0 +177 0 +178 1 +179 0 +180 1 +181 0 +182 1 +183 0 +184 1 +185 0 +186 1 +187 0 +188 1 +189 0 +190 1 +191 0 +192 1 +193 0 +194 1 +195 1 +196 1 +197 1 +198 0 +199 1 +200 0 +201 0 +202 1 +203 1 +204 1 +205 0 +206 1 +207 1 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 diff --git a/evidence/allen-omega-L694/L734/late-code/appcode-mutant.log b/evidence/allen-omega-L694/L734/late-code/appcode-mutant.log new file mode 100644 index 00000000..c9c50601 --- /dev/null +++ b/evidence/allen-omega-L694/L734/late-code/appcode-mutant.log @@ -0,0 +1,182 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 1 +76 1 +77 1 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 diff --git a/evidence/allen-omega-L694/L734/late-code/application.log b/evidence/allen-omega-L694/L734/late-code/application.log new file mode 100644 index 00000000..2e8a428d --- /dev/null +++ b/evidence/allen-omega-L694/L734/late-code/application.log @@ -0,0 +1,182 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 diff --git a/evidence/allen-omega-L694/L734/late-code/binaries.sha256 b/evidence/allen-omega-L694/L734/late-code/binaries.sha256 new file mode 100644 index 00000000..db656bad --- /dev/null +++ b/evidence/allen-omega-L694/L734/late-code/binaries.sha256 @@ -0,0 +1,26 @@ +e5d3907955e236707da8e5b8ed6e34165143caa831f047e2024cba0314a806f4 /home/drakestapleton/handoffs/allen-omega-L694/L734/final/scheduler +ebcf9ea3694e69d069456900d2250c283989fa3525e32b636d57bbeb26dfbb43 /home/drakestapleton/handoffs/allen-omega-L694/L734/final/readback-mutant +878923c2258017161625eb83188b275ca2517e3412916835e68ec1d24e7e570d /home/drakestapleton/handoffs/allen-omega-L694/L734/final/view +c13da7dfc5871d35aa1eab052bf2f7218337ca159b4a8d2ab4701521022b6a03 /home/drakestapleton/handoffs/allen-omega-L694/L734/final/allen +4fb0d8e1b3cc37f828c0cd0f72ac8bab84feed81e0ab767547ae46c273aa0383 /home/drakestapleton/handoffs/allen-omega-L694/L734/final/reply +9b83444c081a485681f61a161aa280fb68d1e635f25adac62cc8892123c3cfc9 /home/drakestapleton/handoffs/allen-omega-L694/L734/final/ackstop-mutant +08040e2787db231623521f3c4084c88a1e0c934564c81ce2b661b67153d5a293 /home/drakestapleton/handoffs/allen-omega-L694/L734/final/hash-mutant +c7798bf8dbbbc479a2547d8d0449aff9707cedb543f08f0870992ecf6a95c7d0 /home/drakestapleton/handoffs/allen-omega-L694/L734/final/golden +16037d607f5ca2278972b7b0c07b5568989a7d19c4f82a84bd8ec65c3ef6322a /home/drakestapleton/handoffs/allen-omega-L694/L734/final/session-mutant +3f8b6e5302e5f165f73abe2e489082216a8c0a72ec569792c3665355952ba061 /home/drakestapleton/handoffs/allen-omega-L694/L734/final/intent +a7fad3f6ed5ab1c8ff8f023c3d6d54d30da029477b3ca7a0b16c107f5fe72a04 /home/drakestapleton/handoffs/allen-omega-L694/L734/final/fixture +b723f84c3dbe8691b3b1c900586870dfad91cae6020fccb992a7327828687a2c /home/drakestapleton/handoffs/allen-omega-L694/L734/final/runtime +e70b23633a58acf37ef50a12ddd0ca0bd70d2f7744573cdd3c3ba98c1f99becc /home/drakestapleton/handoffs/allen-omega-L694/L734/final/code +a9c6e5f82217cff365eae1e121b6414be7d9a52b0202458702f6fda34fe49444 /home/drakestapleton/handoffs/allen-omega-L694/L734/final/edges +5968019310f93974d7ebf26b7b817708fa02058f2b3ea9983560498f96a3fd59 /home/drakestapleton/handoffs/allen-omega-L694/L734/final/appcode-mutant +0ac520c7e2763254d02111b995d23541ea9bc355cecadf2814cce814ee1ff51d /home/drakestapleton/handoffs/allen-omega-L694/L734/final/render +97b4555c4ac9ad831dea927b3833e0be141f995c424ebf452c9859b176755403 /home/drakestapleton/handoffs/allen-omega-L694/L734/final/stale-mutant +0c40d9d2b4e0329b54c616ca16d70c3c66fe286b5d7494686e96f6d1fe0cfccd /home/drakestapleton/handoffs/allen-omega-L694/L734/final/courier +b8e4f1a6991cefa6b637a946dd389d7c92245331f89233df02d64d72c3965439 /home/drakestapleton/handoffs/allen-omega-L694/L734/final/scene +db290f2f155c6fcb9f621784b05a4689e3a699e9a45d92dbc510267bb78500d3 /home/drakestapleton/handoffs/allen-omega-L694/L734/final/pendingwire-mutant +0eee44c73c1dbc196f9a3b8b5242029dbaf99f1585cd4b2a19e35678b60320de /home/drakestapleton/handoffs/allen-omega-L694/L734/final/paint +2ac6c3c5a460a9986ba711e034827d2416ea0c81ef8704a0f50a92bdcf44814d /home/drakestapleton/handoffs/allen-omega-L694/L734/final/crc-mutant +71f99242bcad6ede239b240602470fcf3d5da3267eb47a1ad522241958222367 /home/drakestapleton/handoffs/allen-omega-L694/L734/final/stdio-overflow-input +7c96e2826e75ab48fa2f82be4440f7730bc1b6c439731749e8d641ea901abd57 /home/drakestapleton/handoffs/allen-omega-L694/L734/final/keepalive-mutant +f740bf09552e214294af7aeadfea9a447869b2318aab28383b64a3b2635eeefa /home/drakestapleton/handoffs/allen-omega-L694/L734/final/memory +ba8dd2746d9612599cc96b2d98c0b2e70a9230bfa0dbb3ec003fd08bdd756fec /home/drakestapleton/handoffs/allen-omega-L694/L734/final/application diff --git a/evidence/allen-omega-L694/L734/late-code/code.log b/evidence/allen-omega-L694/L734/late-code/code.log new file mode 100644 index 00000000..e7e197b7 --- /dev/null +++ b/evidence/allen-omega-L694/L734/late-code/code.log @@ -0,0 +1,23 @@ +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 diff --git a/evidence/allen-omega-L694/L734/late-code/counts.json b/evidence/allen-omega-L694/L734/late-code/counts.json new file mode 100644 index 00000000..06b62209 --- /dev/null +++ b/evidence/allen-omega-L694/L734/late-code/counts.json @@ -0,0 +1,20 @@ +{ + "checks": { + "runtime": 28, + "code": 23, + "courier": 24, + "scheduler": 213, + "application": 182, + "memory": 79, + "intent": 8, + "reply": 15, + "view": 13, + "scene": 14, + "paint": 11, + "edges": 352, + "short": 20, + "long": 292 + }, + "total": 1274, + "compiled_mutants_rejected": 9 +} diff --git a/evidence/allen-omega-L694/L734/late-code/courier.log b/evidence/allen-omega-L694/L734/late-code/courier.log new file mode 100644 index 00000000..8402df49 --- /dev/null +++ b/evidence/allen-omega-L694/L734/late-code/courier.log @@ -0,0 +1,24 @@ +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 diff --git a/evidence/allen-omega-L694/L734/late-code/crc-mutant.log b/evidence/allen-omega-L694/L734/late-code/crc-mutant.log new file mode 100644 index 00000000..a0d90bd4 --- /dev/null +++ b/evidence/allen-omega-L694/L734/late-code/crc-mutant.log @@ -0,0 +1,23 @@ +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 1 +117 1 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 diff --git a/evidence/allen-omega-L694/L734/late-code/edges.log b/evidence/allen-omega-L694/L734/late-code/edges.log new file mode 100644 index 00000000..e8d0deea --- /dev/null +++ b/evidence/allen-omega-L694/L734/late-code/edges.log @@ -0,0 +1,352 @@ +1201 0 +1202 0 +1203 0 +1204 0 +1205 0 +1206 0 +1207 0 +1208 0 +1209 0 +1210 0 +1211 0 +1212 0 +1213 0 +1214 0 +1220 0 +1221 0 +1222 0 +1223 0 +1224 0 +1225 0 +1226 0 +1227 0 +1228 0 +1229 0 +1230 0 +1231 0 +1232 0 +1233 0 +1234 0 +1235 0 +1236 0 +1237 0 +1238 0 +1239 0 +1240 0 +1241 0 +1242 0 +1243 0 +1244 0 +1245 0 +1246 0 +1247 0 +1248 0 +1249 0 +1250 0 +1251 0 +1252 0 +1253 0 +1254 0 +1255 0 +1256 0 +1257 0 +1258 0 +1259 0 +1260 0 +1261 0 +1262 0 +1301 0 +1302 0 +1303 0 +1304 0 +1305 0 +1306 0 +1310 0 +1311 0 +1312 0 +1313 0 +1314 0 +1315 0 +1316 0 +1317 0 +1318 0 +1319 0 +1320 0 +1321 0 +1322 0 +1323 0 +1324 0 +1325 0 +1326 0 +1327 0 +1328 0 +1329 0 +1330 0 +1331 0 +1332 0 +1333 0 +1334 0 +1335 0 +1336 0 +1337 0 +1338 0 +1339 0 +1340 0 +1341 0 +1342 0 +1343 0 +1344 0 +1345 0 +1346 0 +1347 0 +1348 0 +1349 0 +1350 0 +1351 0 +1352 0 +1353 0 +1354 0 +1355 0 +1356 0 +1357 0 +1358 0 +1359 0 +1360 0 +1361 0 +1362 0 +1363 0 +1364 0 +1365 0 +1366 0 +1367 0 +1368 0 +1369 0 +1370 0 +1371 0 +1372 0 +1373 0 +1374 0 +1375 0 +1376 0 +1377 0 +1378 0 +1379 0 +1380 0 +1381 0 +1382 0 +1383 0 +1384 0 +1385 0 +1386 0 +1387 0 +1388 0 +1389 0 +1390 0 +1391 0 +1392 0 +1393 0 +1394 0 +1395 0 +1396 0 +1397 0 +1398 0 +1399 0 +1400 0 +1401 0 +1402 0 +1403 0 +1404 0 +1405 0 +1406 0 +1407 0 +1408 0 +1409 0 +1410 0 +1411 0 +1412 0 +1413 0 +1414 0 +1415 0 +1416 0 +1417 0 +1418 0 +1419 0 +1420 0 +1421 0 +1422 0 +1423 0 +1424 0 +1425 0 +1426 0 +1427 0 +1428 0 +1429 0 +1430 0 +1431 0 +1432 0 +1433 0 +1434 0 +1435 0 +1436 0 +1437 0 +1438 0 +1439 0 +1440 0 +1441 0 +1442 0 +1443 0 +1444 0 +1445 0 +1446 0 +1447 0 +1448 0 +1449 0 +1450 0 +1451 0 +1452 0 +1453 0 +1454 0 +1455 0 +1456 0 +1457 0 +1458 0 +1459 0 +1460 0 +1461 0 +1462 0 +1463 0 +1464 0 +1465 0 +1466 0 +1467 0 +1468 0 +1469 0 +1470 0 +1471 0 +1472 0 +1473 0 +1474 0 +1475 0 +1476 0 +1477 0 +1478 0 +1479 0 +1480 0 +1481 0 +1482 0 +1483 0 +1484 0 +1485 0 +1486 0 +1487 0 +1488 0 +1489 0 +1490 0 +1491 0 +1492 0 +1493 0 +1494 0 +1495 0 +1496 0 +1497 0 +1498 0 +1499 0 +1500 0 +1501 0 +1502 0 +1503 0 +1504 0 +1505 0 +1506 0 +1507 0 +1508 0 +1509 0 +1510 0 +1511 0 +1512 0 +1513 0 +1514 0 +1515 0 +1516 0 +1517 0 +1518 0 +1519 0 +1520 0 +1521 0 +1522 0 +1523 0 +1524 0 +1525 0 +1526 0 +1527 0 +1528 0 +1529 0 +1530 0 +1531 0 +1532 0 +1533 0 +1534 0 +1535 0 +1536 0 +1537 0 +1538 0 +1539 0 +1540 0 +1541 0 +1542 0 +1543 0 +1544 0 +1545 0 +1546 0 +1547 0 +1548 0 +1549 0 +1550 0 +1551 0 +1552 0 +1553 0 +1554 0 +1555 0 +1556 0 +1557 0 +1558 0 +1559 0 +1560 0 +1561 0 +1562 0 +1563 0 +1564 0 +1565 0 +1570 0 +1571 0 +1572 0 +1575 0 +1573 0 +1574 0 +1600 0 +1601 0 +1602 0 +1603 0 +1604 0 +1605 0 +1606 0 +1607 0 +1610 0 +1611 0 +1612 0 +1613 0 +1614 0 +1615 0 +1616 0 +1617 0 +1701 0 +1702 0 +1703 0 +1704 0 +1705 0 +1706 0 +1707 0 +1708 0 +1709 0 +1710 0 +1711 0 diff --git a/evidence/allen-omega-L694/L734/late-code/final.exit b/evidence/allen-omega-L694/L734/late-code/final.exit new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/L734/late-code/final.exit @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/L734/late-code/final.log b/evidence/allen-omega-L694/L734/late-code/final.log new file mode 100644 index 00000000..6e989ecf --- /dev/null +++ b/evidence/allen-omega-L694/L734/late-code/final.log @@ -0,0 +1,27 @@ +runtime compile=0 native-exit=0 +code compile=0 native-exit=0 +courier compile=0 native-exit=0 +scheduler compile=0 native-exit=0 +application compile=0 native-exit=0 +memory compile=0 native-exit=0 +intent compile=0 native-exit=0 +reply compile=0 native-exit=0 +view compile=0 native-exit=0 +scene compile=0 native-exit=0 +paint compile=0 native-exit=0 +edges compile=0 native-exit=0 +fixture compile=0 native-exit=0 +golden compile=0 native-exit=0 +render compile=0 native-exit=0 +stdio native-exit=0 golden-cmp=0 +stdio overflow native-exit=65 no-later-command=PASS +stale mutant compile=0 rejected-exit=3 +crc mutant compile=0 rejected-exit=2 +hash mutant compile=0 rejected-exit=2 +readback mutant compile=0 rejected-exit=7 +session mutant compile=0 rejected-exit=1 +keepalive mutant compile=0 rejected-exit=40 +ackstop mutant compile=0 rejected-exit=27 +pendingwire mutant compile=0 rejected-exit=1 +appcode mutant compile=0 rejected-exit=3 +ALLEN_OMEGA_HOST: PASS; target=NOT_RUN; live=NOT_RUN diff --git a/evidence/allen-omega-L694/L734/late-code/hash-mutant.log b/evidence/allen-omega-L694/L734/late-code/hash-mutant.log new file mode 100644 index 00000000..c75cfefb --- /dev/null +++ b/evidence/allen-omega-L694/L734/late-code/hash-mutant.log @@ -0,0 +1,79 @@ +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 1 +310 1 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +362 0 +363 0 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 0 +361 0 diff --git a/evidence/allen-omega-L694/L734/late-code/intent.log b/evidence/allen-omega-L694/L734/late-code/intent.log new file mode 100644 index 00000000..5371bd36 --- /dev/null +++ b/evidence/allen-omega-L694/L734/late-code/intent.log @@ -0,0 +1,8 @@ +501 0 +502 0 +503 0 +504 0 +505 0 +506 0 +507 0 +508 0 diff --git a/evidence/allen-omega-L694/L734/late-code/keepalive-mutant.log b/evidence/allen-omega-L694/L734/late-code/keepalive-mutant.log new file mode 100644 index 00000000..2e3415df --- /dev/null +++ b/evidence/allen-omega-L694/L734/late-code/keepalive-mutant.log @@ -0,0 +1,213 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 1 +19 1 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 1 +54 1 +55 1 +56 1 +57 0 +58 0 +59 1 +60 0 +61 0 +62 0 +63 0 +64 0 +65 1 +66 0 +67 0 +68 0 +69 1 +70 1 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 1 +170 0 +171 1 +172 1 +173 0 +174 1 +175 0 +176 0 +177 0 +178 1 +179 1 +180 1 +181 1 +182 1 +183 1 +184 1 +185 1 +186 1 +187 1 +188 1 +189 1 +190 1 +191 1 +192 1 +193 1 +194 1 +195 1 +196 1 +197 1 +198 0 +199 1 +200 0 +201 0 +202 1 +203 1 +204 1 +205 0 +206 1 +207 1 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 diff --git a/evidence/allen-omega-L694/L734/late-code/latecode-red.exit b/evidence/allen-omega-L694/L734/late-code/latecode-red.exit new file mode 100644 index 00000000..00750edc --- /dev/null +++ b/evidence/allen-omega-L694/L734/late-code/latecode-red.exit @@ -0,0 +1 @@ +3 diff --git a/evidence/allen-omega-L694/L734/late-code/latecode-red.log b/evidence/allen-omega-L694/L734/late-code/latecode-red.log new file mode 100644 index 00000000..02252442 --- /dev/null +++ b/evidence/allen-omega-L694/L734/late-code/latecode-red.log @@ -0,0 +1,182 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 1 +179 0 +180 0 +181 1 +182 1 diff --git a/evidence/allen-omega-L694/L734/late-code/latecode-red.om b/evidence/allen-omega-L694/L734/late-code/latecode-red.om new file mode 100644 index 00000000..bf792141 --- /dev/null +++ b/evidence/allen-omega-L694/L734/late-code/latecode-red.om @@ -0,0 +1,3223 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +note End-to-end application core over real Omega protocol bytes; no socket simulation claim. +text Smallask "hello" +text Codeaskt "Please make me a calculator" +text Finaltxt " 1/1 Model answer." +text Codetxt " 1/1 9 3ce11e06 python print(1)\\n" +text Prefixes "SAY WAIT CODE " +text Againexp "AGAIN 2" +global SavedOut uchar 8192 +global Heldwire uchar 8192 +global Heldlen ulong 2 +fn holdwire to void +put Heldlen 0 get Outlen 0 +put Heldlen 1 get Err 0 +for i ulong get Outlen 0 +put Heldwire i get Outb i +end +end +fn unhold to void +for i ulong get Heldlen 0 +put Outb i get Heldwire i +end +put Outlen 0 get Heldlen 0 +put Err 0 get Heldlen 1 +end +fn samewire to bool +if ne get Outlen 0 get Heldlen 0 +ret false +end +for i ulong get Heldlen 0 +if ne get Outb i get Heldwire i +ret false +end +end +ret eq get Err 0 get Heldlen 1 +end +fn test ok bool to void +n = get Outlen 0 +e = get Err 0 +for i ulong n +put SavedOut i get Outb i +end +check ok add get Checks 0 1 +for i ulong n +put Outb i get SavedOut i +end +put Outlen 0 n +put Err 0 e +end +fn copyout to void +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +end +fn prompt code bool to void +if code +put Inlen 0 len Codeaskt +for i ulong len Codeaskt +put In i get Codeaskt i +end +else +put Inlen 0 len Smallask +for i ulong len Smallask +put In i get Smallask i +end +end +end +fn incoming part ulong seq ulong kind ulong to void +outreset +off = ulong 0 +size = ulong 4 +if eq kind 1 +off = ulong 4 +size = ulong 5 +end +if eq kind 2 +off = ulong 9 +size = ulong 5 +end +for i ulong size +emitb get Prefixes add off i +end +emitn seq +if eq kind 0 +for i ulong len Finaltxt +emitb get Finaltxt i +end +end +if eq kind 2 +for i ulong len Codetxt +emitb get Codetxt i +end +end +copyout +b = packet 2 get Q 1 part 0 0 +copyout +end +fn main to int +test not appinit 0 100 +test appinit 42 100 +test not appinit 43 100 +test eq get Q 0 42 +prompt false +test appask 100 +test eq get R 0 1 +test eq get Q 1 1 +test eq get R 9 1 +test eq get R 1 1 +test eq get A 2 0 +prompt false +test not appask 101 +test eq get R 9 1 +test apppoll 100 true +test eq get T 10 5 +test appsent 100 true +test apppoll 100 true +test eq get T 10 1 +copyout +test pkparse +test eq get N 1 1 +test eq get In get N 5 74 +test appsent 100 true +incoming 1 1 0 +test appreceive 101 +test eq get A 2 1 +test eq get R 1 0 +test eq get R 8 13 +test eq get R 9 2 +test eq get Answer 0 77 +prompt true +test not appask 102 +test eq get R 0 1 +test apppoll 102 true +test eq get T 10 3 +test appsent 102 true +note Code acknowledgement is visible immediately, but missing code requests AGAIN. +prompt true +test appask 103 +test eq get R 0 2 +test eq get Q 1 2 +test eq get R 2 2 +test eq get A 2 1 +test eq get R 8 len Ack +test apppoll 103 true +test appsent 103 false +test apppoll 104 true +test eq get T 10 1 +test appsent 104 true +incoming 1 2 0 +test appreceive 105 +test eq get A 2 2 +test eq get A 1 len Againexp +test eq get R 1 1 +test eq get R 13 1 +test apppoll 105 true +test eq get T 10 3 +test eq get Q 1 2 +test appsent 105 true +test apppoll 106 true +test eq get T 10 1 +test eq get Q 1 3 +test eq get R 0 2 +copyout +test pkparse +test eq get N 6 len Againexp +bad = ulong 0 +for i ulong len Againexp +if ne get In add get N 5 i get Againexp i +bad = add bad 1 +end +end +test eq bad 0 +test appsent 106 true +incoming 1 2 0 +test appreceive 107 +test eq get A 2 3 +test eq get R 1 0 +test eq get A 1 0 +note Reset cancels pending delivery without reusing either counter. +appreset +test eq get R 0 2 +test eq get Q 1 3 +test eq get R 9 0 +prompt false +test appask 108 +test eq get R 0 3 +test eq get Q 1 4 +test apppoll 108 true +test appsent 108 true +note Old CODE must not mutate the code buffer during a newer chat job. +incoming 1 2 2 +test appreceive 109 +test eq get A 2 4 +test eq get C 1 0 +test eq get C 2 0 +test eq get Code 0 0 +test apppoll 109 true +test appsent 109 true +incoming 2 2 0 +test appreceive 109 +test eq get A 2 4 +test eq get R 1 1 +test eq get R 8 0 +test apppoll 109 true +test appsent 109 true +incoming 3 3 0 +test appreceive 110 +test eq get A 2 1 +test eq get R 1 0 +test eq get R 9 2 +test apppoll 110 true +test appsent 110 true +note Cancellation drops an outstanding send and stale response safely. +prompt false +test appask 111 +test apppoll 111 true +appcancel +test eq get R 1 0 +test eq get T 5 0 +test not appsent 111 true +incoming 1 4 0 +test not appreceive 112 +note Complete CODE bytes must arrive before a code response becomes visible. +prompt true +test appask 113 +test eq get R 0 5 +test eq get Q 1 6 +test apppoll 113 true +test appsent 113 true +incoming 1 5 2 +test appreceive 114 +test eq get A 2 0 +test eq codestat 2 +test eq get R 6 0 +test apppoll 114 true +test appsent 114 true +incoming 2 5 0 +test appreceive 115 +test eq get A 2 1 +test eq get R 6 1 +test eq get R 1 0 +test eq get Code 6 49 +test apppoll 115 true +test appsent 115 true +note WAIT updates silence deadline, no answer; slow and timeout cancel both layers. +prompt false +test appask 116 +test eq get R 0 6 +test apppoll 116 true +test appsent 116 true +incoming 1 6 1 +test appreceive 117 +test eq get A 2 0 +test eq get R 4 117 +test apppoll 117 true +test appsent 117 true +v = apppoll 20116 true +test eq get A 2 5 +test eq get R 1 1 +if v +test appsent 20116 true +end +v = apppoll 30116 true +test eq get R 1 1 +if v +test appsent 30116 true +end +v = apppoll 30117 true +test eq get A 2 6 +test eq get R 1 0 +test eq get T 5 0 +test eq get A 1 0 +if v +test appsent 30117 true +end +n = get R 9 +prompt false +test not appask 30116 +test eq get R 9 n +test not apppoll 30116 true +note Invalid prompt never becomes a pending job or transcript line. +put Inlen 0 160 +test not appask 30118 +test eq get R 9 n +test eq get R 0 6 +test eq get Q 1 7 +note Receiving a code completion before send-result reporting cannot replace +note the pending datagram with the newly generated AGAIN text. +prompt true +test appask 30118 +test apppoll 30118 true +test eq get T 10 1 +holdwire +incoming 1 7 0 +unhold +test appreceive 30119 +test eq get A 2 2 +test samewire +test eq get T 10 1 +test appsent 30119 true +test apppoll 30120 true +test eq get T 10 3 +test appsent 30120 true +test apppoll 30121 true +test eq get Q 1 9 +test eq get R 0 7 +test appsent 30121 true +appcancel +note Idle runtime still refuses a new prompt while a HELLO send is outstanding. +test apppoll 32122 true +test eq get T 10 5 +holdwire +n = get R 9 +prompt false +test not appask 32122 +test samewire +test eq get R 9 n +test appsent 32122 true +note Late CODE may complete the original job before queued AGAIN is sent. +prompt true +test appask 32123 +test eq get R 0 8 +test eq get Q 1 10 +test apppoll 32123 true +test appsent 32123 true +incoming 1 8 0 +test appreceive 32124 +test gt get A 1 0 +test apppoll 32124 true +test appsent 32124 true +incoming 2 8 2 +test appreceive 32125 +test eq codestat 2 +test apppoll 32125 true +test appsent 32125 true +incoming 3 8 0 +test appreceive 32126 +test eq get A 2 1 +test eq get R 1 0 +test eq get A 1 0 +test apppoll 32126 true +test appsent 32126 true +test not apppoll 32127 true +test eq get Q 1 10 +ret int get Fails 0 +end diff --git a/evidence/allen-omega-L694/L734/late-code/long.log b/evidence/allen-omega-L694/L734/late-code/long.log new file mode 100644 index 00000000..0a060bc8 --- /dev/null +++ b/evidence/allen-omega-L694/L734/late-code/long.log @@ -0,0 +1,292 @@ +401 0 +410 0 +411 0 +412 0 +413 0 +414 0 +415 0 +416 0 +417 0 +418 0 +419 0 +420 0 +421 0 +422 0 +423 0 +424 0 +425 0 +426 0 +427 0 +428 0 +429 0 +430 0 +431 0 +432 0 +433 0 +434 0 +435 0 +436 0 +437 0 +438 0 +439 0 +440 0 +441 0 +442 0 +443 0 +444 0 +445 0 +446 0 +447 0 +448 0 +449 0 +450 0 +451 0 +452 0 +453 0 +454 0 +455 0 +456 0 +457 0 +458 0 +459 0 +460 0 +461 0 +462 0 +463 0 +464 0 +465 0 +466 0 +467 0 +468 0 +469 0 +470 0 +471 0 +472 0 +473 0 +474 0 +475 0 +476 0 +477 0 +478 0 +479 0 +480 0 +481 0 +482 0 +483 0 +484 0 +485 0 +486 0 +487 0 +488 0 +489 0 +490 0 +491 0 +492 0 +493 0 +494 0 +495 0 +496 0 +497 0 +498 0 +499 0 +500 0 +501 0 +502 0 +503 0 +504 0 +505 0 +506 0 +507 0 +508 0 +509 0 +510 0 +511 0 +512 0 +513 0 +514 0 +515 0 +516 0 +517 0 +518 0 +519 0 +520 0 +521 0 +522 0 +523 0 +524 0 +525 0 +526 0 +527 0 +528 0 +529 0 +530 0 +531 0 +532 0 +533 0 +534 0 +535 0 +536 0 +537 0 +538 0 +539 0 +540 0 +541 0 +542 0 +543 0 +544 0 +545 0 +546 0 +547 0 +548 0 +549 0 +550 0 +402 0 +403 0 +404 0 +405 0 +406 0 +700 0 +701 0 +702 0 +703 0 +704 0 +705 0 +706 0 +707 0 +708 0 +709 0 +710 0 +711 0 +712 0 +713 0 +714 0 +715 0 +716 0 +717 0 +718 0 +719 0 +720 0 +721 0 +722 0 +723 0 +724 0 +725 0 +726 0 +727 0 +728 0 +729 0 +730 0 +731 0 +732 0 +733 0 +734 0 +735 0 +736 0 +737 0 +738 0 +739 0 +740 0 +741 0 +742 0 +743 0 +744 0 +745 0 +746 0 +747 0 +748 0 +749 0 +750 0 +751 0 +752 0 +753 0 +754 0 +755 0 +756 0 +757 0 +758 0 +759 0 +760 0 +761 0 +762 0 +763 0 +764 0 +765 0 +766 0 +767 0 +768 0 +769 0 +770 0 +771 0 +772 0 +773 0 +774 0 +775 0 +776 0 +777 0 +778 0 +779 0 +780 0 +781 0 +782 0 +783 0 +784 0 +785 0 +786 0 +787 0 +788 0 +789 0 +790 0 +791 0 +792 0 +793 0 +794 0 +795 0 +796 0 +797 0 +798 0 +799 0 +800 0 +801 0 +802 0 +803 0 +804 0 +805 0 +806 0 +807 0 +808 0 +809 0 +810 0 +811 0 +812 0 +813 0 +814 0 +815 0 +816 0 +817 0 +818 0 +819 0 +820 0 +821 0 +822 0 +823 0 +824 0 +825 0 +826 0 +827 0 +828 0 +829 0 +830 0 +831 0 +832 0 +833 0 +834 0 +835 0 +836 0 +837 0 +838 0 +839 0 +840 0 +841 0 +407 0 +408 0 +409 0 diff --git a/evidence/allen-omega-L694/L734/late-code/memory.log b/evidence/allen-omega-L694/L734/late-code/memory.log new file mode 100644 index 00000000..5928102e --- /dev/null +++ b/evidence/allen-omega-L694/L734/late-code/memory.log @@ -0,0 +1,79 @@ +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 0 +310 0 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +362 0 +363 0 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 0 +361 0 diff --git a/evidence/allen-omega-L694/L734/late-code/paint.log b/evidence/allen-omega-L694/L734/late-code/paint.log new file mode 100644 index 00000000..281a5bd2 --- /dev/null +++ b/evidence/allen-omega-L694/L734/late-code/paint.log @@ -0,0 +1,11 @@ +1101 0 +1102 0 +1103 0 +1104 0 +1105 0 +1106 0 +1107 0 +1108 0 +1109 0 +1110 0 +1111 0 diff --git a/evidence/allen-omega-L694/L734/late-code/pendingwire-mutant.log b/evidence/allen-omega-L694/L734/late-code/pendingwire-mutant.log new file mode 100644 index 00000000..48fb2008 --- /dev/null +++ b/evidence/allen-omega-L694/L734/late-code/pendingwire-mutant.log @@ -0,0 +1,182 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 1 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 diff --git a/evidence/allen-omega-L694/L734/late-code/readback-mutant.log b/evidence/allen-omega-L694/L734/late-code/readback-mutant.log new file mode 100644 index 00000000..268002ad --- /dev/null +++ b/evidence/allen-omega-L694/L734/late-code/readback-mutant.log @@ -0,0 +1,79 @@ +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 0 +310 0 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 1 +339 1 +340 0 +341 0 +342 0 +343 0 +344 1 +345 0 +346 0 +347 0 +348 0 +349 1 +350 1 +351 0 +352 0 +362 0 +363 0 +353 1 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 1 +361 0 diff --git a/evidence/allen-omega-L694/L734/late-code/reply.log b/evidence/allen-omega-L694/L734/late-code/reply.log new file mode 100644 index 00000000..d11a72ad --- /dev/null +++ b/evidence/allen-omega-L694/L734/late-code/reply.log @@ -0,0 +1,15 @@ +801 0 +802 0 +803 0 +804 0 +805 0 +806 0 +807 0 +808 0 +809 0 +810 0 +811 0 +812 0 +813 0 +814 0 +815 0 diff --git a/evidence/allen-omega-L694/L734/late-code/runtime.log b/evidence/allen-omega-L694/L734/late-code/runtime.log new file mode 100644 index 00000000..5168e6f3 --- /dev/null +++ b/evidence/allen-omega-L694/L734/late-code/runtime.log @@ -0,0 +1,28 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 diff --git a/evidence/allen-omega-L694/L734/late-code/scene.log b/evidence/allen-omega-L694/L734/late-code/scene.log new file mode 100644 index 00000000..44a4b2b1 --- /dev/null +++ b/evidence/allen-omega-L694/L734/late-code/scene.log @@ -0,0 +1,14 @@ +1001 0 +1002 0 +1003 0 +1004 0 +1005 0 +1006 0 +1007 0 +1008 0 +1009 0 +1010 0 +1011 0 +1012 0 +1013 0 +1014 0 diff --git a/evidence/allen-omega-L694/L734/late-code/scheduler.log b/evidence/allen-omega-L694/L734/late-code/scheduler.log new file mode 100644 index 00000000..1d8ffd12 --- /dev/null +++ b/evidence/allen-omega-L694/L734/late-code/scheduler.log @@ -0,0 +1,213 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 +183 0 +184 0 +185 0 +186 0 +187 0 +188 0 +189 0 +190 0 +191 0 +192 0 +193 0 +194 0 +195 0 +196 0 +197 0 +198 0 +199 0 +200 0 +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 diff --git a/evidence/allen-omega-L694/L734/late-code/session-mutant.log b/evidence/allen-omega-L694/L734/late-code/session-mutant.log new file mode 100644 index 00000000..9ce7ef78 --- /dev/null +++ b/evidence/allen-omega-L694/L734/late-code/session-mutant.log @@ -0,0 +1,24 @@ +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 1 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 diff --git a/evidence/allen-omega-L694/L734/late-code/short.log b/evidence/allen-omega-L694/L734/late-code/short.log new file mode 100644 index 00000000..a9da2dc8 --- /dev/null +++ b/evidence/allen-omega-L694/L734/late-code/short.log @@ -0,0 +1,20 @@ +401 0 +410 0 +411 0 +412 0 +413 0 +414 0 +402 0 +403 0 +404 0 +405 0 +406 0 +700 0 +701 0 +702 0 +703 0 +704 0 +705 0 +407 0 +408 0 +409 0 diff --git a/evidence/allen-omega-L694/L734/late-code/source.sha256 b/evidence/allen-omega-L694/L734/late-code/source.sha256 new file mode 100644 index 00000000..5fbe917e --- /dev/null +++ b/evidence/allen-omega-L694/L734/late-code/source.sha256 @@ -0,0 +1,39 @@ +68f02db782e9c5a506e64972123129c9cc761c78ce6f39e40d2eb7c73394bcfe native/omega/allen/application.om +184f4270c72c4eca6a7afdd28b70a608f2e237980b12c8a7bfc2c7d2c3e625b9 native/omega/allen/base.om +795ca28627a19f1088de0f23277e79cdac921ff88451c606c7b655ce0f2e8a5b native/omega/allen/build-one.sh +4d2235ac5d6b237695b1c3112f70ebdfa0cebafa2ec8e691e4be4de37a62199b native/omega/allen/code.om +76ee9cdeaac036905c76dfa29f42bf5a78d1259ad1656adfaa24916c3b93550d native/omega/allen/courier.om +87024b3e838ab15860991cdf5f70cfa4ad2b63ec2b9b843cb2da0276143fcf5f native/omega/allen/gate.sh +9d71a653870eeef678f95df04db9c38aedaadd06e7c74bf3e5d9fde6e28f82f8 native/omega/allen/golden.sh +06087bc573ebb876a0ed80f6025c592fb4b1d23335169c3da402824fd1482c35 native/omega/allen/intent.om +4bc37c95d553364c5d2925d8ff9e8a53b1a61974513e6f492f77b7ebb05bbda4 native/omega/allen/main.om +068292abd04d3a61b063fc5380b22a56c4235a87915c219ebf3b37d16d7bc9c7 native/omega/allen/memory.om +b4d7b6e6cd680d2ba1eec2978b0cbb81ffc63035b73f5c3726bdad97a7b6aa04 native/omega/allen/paint.om +ba47aedd0244c5229f8543aad7fd5120631c6f4cf502fde038ca27e7659cecec native/omega/allen/README.md +e50a7f673aaee92aba4a3aec303aa93b071121c09ad05d4ad1dcc2deb9706dcc native/omega/allen/reply.om +5b01eae03204d08f6d207ef29f2ba09a1d9f249f1738f68f151214675a4ff2ed native/omega/allen/runtime.om +c8d4a437b41538cc1eeb62a2029c6993d41e5ef90cc7b26c8e1c92bc98ec57d3 native/omega/allen/scene.om +615dff78462a715153b3d891b2cfe146c318d3a0a26ae1aaa642484f965c12df native/omega/allen/scheduler.om +f4e6bb5571a0700febdecfc6209ae1c088eab50a82bce4d8a10179408e3abb5f native/omega/allen/tests/application.om +f085198549d1c235a97574ff6f6560ce82217611f4051fc3dbbc8286aab6d536 native/omega/allen/tests/check.om +b76438a85257bd95768115047be286c107e3723628a16a0541870732d0849a42 native/omega/allen/tests/code.om +98105e1c30626f54da07940fe0415637730b7e112ea39ba2aae1f2d648993373 native/omega/allen/tests/courier.om +f524aab74657dc2e9e4330bf42bc05ef01ce3e8f08a05c80371be0c0a33764d3 native/omega/allen/tests/edges.om +a2e8bcde92d522216a4fa99559dd3bcba096aea86127364587dadcc2bfb585af native/omega/allen/tests/fixture.om +c9ef2bee7cbd1c072c6045d62c55f3bdd938901e91792cee72ea57fb8f25a198 native/omega/allen/tests/golden.om +8ba742d85ea510586f3cf86661bc0f28c5d99b59981c2d3fb220705efad24564 native/omega/allen/tests/intent.om +861d9af698b021056cceb6c00ae3458558db415963fe832d3fca7da55731cf7b native/omega/allen/tests/memory.om +13e4db7436165783c6aad48497ffe89fa6e5ba3de928e66a766c29e1e817fcf5 native/omega/allen/tests/paint.om +e6d232d92d74d88423cebbbbfc6e403ea9b865b80c909e1d23087001d905035a native/omega/allen/tests/probe.om +8fbc8a0517900efd771a994686356416a0fea5e20cfd9bc26c787850398113df native/omega/allen/tests/render.om +094a5e833bae7dfd3b013e3f015f143e9d7bd3efe9b9c896a7f58b09e1ec14b8 native/omega/allen/tests/reply.om +bab9b0e853aa4b62918353a5d1625a3171deebfb639e599fe9751b5a61a3df62 native/omega/allen/tests/runtime.om +b9c84d9a58658589137764fe60209d8320550dd8ed99fa6026df65ba48737e4f native/omega/allen/tests/scene.om +bf984fa9cf63ddb569147afc2a028ccdafdbeae2067125cf35d658e5d00f4c94 native/omega/allen/tests/scheduler.om +521fff50f312b64801017b1349d9a31dac6eac50eb989d93d2dbac4e100f5007 native/omega/allen/tests/stdio-overflow.om +89aee5326b428147ea6da9aa739b6679e214ed114ae5f41d3b70299cf864092c native/omega/allen/tests/view.om +0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0 native/omega/allen/vendor/OMEGA-LICENSE +b234738e8ce81b3d67586deb41fdaab4543169d4b69e86fd3dc28a08432ab5fc native/omega/allen/vendor/PROVENANCE.md +992ec4a4957271b442740598136887a5c610effcd8ae9fb9480a006a4f181097 native/omega/allen/vendor/sha256-core.om +0781cdcec18570a57afbe3be4a6717dd2d1fa4c887b49a3e4cb542b594f8a041 native/omega/allen/vendor/sha256.om +abbefd2f7dc48f2ac28b9526f5c2e5b369da4b7c5e84dde6e6a3cd20bd5687ac native/omega/allen/view.om diff --git a/evidence/allen-omega-L694/L734/late-code/stale-mutant.log b/evidence/allen-omega-L694/L734/late-code/stale-mutant.log new file mode 100644 index 00000000..ac2e3d09 --- /dev/null +++ b/evidence/allen-omega-L694/L734/late-code/stale-mutant.log @@ -0,0 +1,28 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 1 +7 1 +8 1 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 diff --git a/evidence/allen-omega-L694/L734/late-code/view.log b/evidence/allen-omega-L694/L734/late-code/view.log new file mode 100644 index 00000000..8b194f11 --- /dev/null +++ b/evidence/allen-omega-L694/L734/late-code/view.log @@ -0,0 +1,13 @@ +901 0 +902 0 +903 0 +904 0 +905 0 +906 0 +907 0 +908 0 +909 0 +910 0 +911 0 +912 0 +913 0 diff --git a/evidence/allen-omega-L694/L734/long.log b/evidence/allen-omega-L694/L734/long.log new file mode 100644 index 00000000..0a060bc8 --- /dev/null +++ b/evidence/allen-omega-L694/L734/long.log @@ -0,0 +1,292 @@ +401 0 +410 0 +411 0 +412 0 +413 0 +414 0 +415 0 +416 0 +417 0 +418 0 +419 0 +420 0 +421 0 +422 0 +423 0 +424 0 +425 0 +426 0 +427 0 +428 0 +429 0 +430 0 +431 0 +432 0 +433 0 +434 0 +435 0 +436 0 +437 0 +438 0 +439 0 +440 0 +441 0 +442 0 +443 0 +444 0 +445 0 +446 0 +447 0 +448 0 +449 0 +450 0 +451 0 +452 0 +453 0 +454 0 +455 0 +456 0 +457 0 +458 0 +459 0 +460 0 +461 0 +462 0 +463 0 +464 0 +465 0 +466 0 +467 0 +468 0 +469 0 +470 0 +471 0 +472 0 +473 0 +474 0 +475 0 +476 0 +477 0 +478 0 +479 0 +480 0 +481 0 +482 0 +483 0 +484 0 +485 0 +486 0 +487 0 +488 0 +489 0 +490 0 +491 0 +492 0 +493 0 +494 0 +495 0 +496 0 +497 0 +498 0 +499 0 +500 0 +501 0 +502 0 +503 0 +504 0 +505 0 +506 0 +507 0 +508 0 +509 0 +510 0 +511 0 +512 0 +513 0 +514 0 +515 0 +516 0 +517 0 +518 0 +519 0 +520 0 +521 0 +522 0 +523 0 +524 0 +525 0 +526 0 +527 0 +528 0 +529 0 +530 0 +531 0 +532 0 +533 0 +534 0 +535 0 +536 0 +537 0 +538 0 +539 0 +540 0 +541 0 +542 0 +543 0 +544 0 +545 0 +546 0 +547 0 +548 0 +549 0 +550 0 +402 0 +403 0 +404 0 +405 0 +406 0 +700 0 +701 0 +702 0 +703 0 +704 0 +705 0 +706 0 +707 0 +708 0 +709 0 +710 0 +711 0 +712 0 +713 0 +714 0 +715 0 +716 0 +717 0 +718 0 +719 0 +720 0 +721 0 +722 0 +723 0 +724 0 +725 0 +726 0 +727 0 +728 0 +729 0 +730 0 +731 0 +732 0 +733 0 +734 0 +735 0 +736 0 +737 0 +738 0 +739 0 +740 0 +741 0 +742 0 +743 0 +744 0 +745 0 +746 0 +747 0 +748 0 +749 0 +750 0 +751 0 +752 0 +753 0 +754 0 +755 0 +756 0 +757 0 +758 0 +759 0 +760 0 +761 0 +762 0 +763 0 +764 0 +765 0 +766 0 +767 0 +768 0 +769 0 +770 0 +771 0 +772 0 +773 0 +774 0 +775 0 +776 0 +777 0 +778 0 +779 0 +780 0 +781 0 +782 0 +783 0 +784 0 +785 0 +786 0 +787 0 +788 0 +789 0 +790 0 +791 0 +792 0 +793 0 +794 0 +795 0 +796 0 +797 0 +798 0 +799 0 +800 0 +801 0 +802 0 +803 0 +804 0 +805 0 +806 0 +807 0 +808 0 +809 0 +810 0 +811 0 +812 0 +813 0 +814 0 +815 0 +816 0 +817 0 +818 0 +819 0 +820 0 +821 0 +822 0 +823 0 +824 0 +825 0 +826 0 +827 0 +828 0 +829 0 +830 0 +831 0 +832 0 +833 0 +834 0 +835 0 +836 0 +837 0 +838 0 +839 0 +840 0 +841 0 +407 0 +408 0 +409 0 diff --git a/evidence/allen-omega-L694/L734/memory.log b/evidence/allen-omega-L694/L734/memory.log new file mode 100644 index 00000000..5928102e --- /dev/null +++ b/evidence/allen-omega-L694/L734/memory.log @@ -0,0 +1,79 @@ +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 0 +310 0 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +362 0 +363 0 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 0 +361 0 diff --git a/evidence/allen-omega-L694/L734/paint.log b/evidence/allen-omega-L694/L734/paint.log new file mode 100644 index 00000000..281a5bd2 --- /dev/null +++ b/evidence/allen-omega-L694/L734/paint.log @@ -0,0 +1,11 @@ +1101 0 +1102 0 +1103 0 +1104 0 +1105 0 +1106 0 +1107 0 +1108 0 +1109 0 +1110 0 +1111 0 diff --git a/evidence/allen-omega-L694/L734/pending-green.exit b/evidence/allen-omega-L694/L734/pending-green.exit new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/L734/pending-green.exit @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/L734/pending-green.log b/evidence/allen-omega-L694/L734/pending-green.log new file mode 100644 index 00000000..9ec18f20 --- /dev/null +++ b/evidence/allen-omega-L694/L734/pending-green.log @@ -0,0 +1,154 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 diff --git a/evidence/allen-omega-L694/L734/pending-red.exit b/evidence/allen-omega-L694/L734/pending-red.exit new file mode 100644 index 00000000..d00491fd --- /dev/null +++ b/evidence/allen-omega-L694/L734/pending-red.exit @@ -0,0 +1 @@ +1 diff --git a/evidence/allen-omega-L694/L734/pending-red.log b/evidence/allen-omega-L694/L734/pending-red.log new file mode 100644 index 00000000..6db2fa74 --- /dev/null +++ b/evidence/allen-omega-L694/L734/pending-red.log @@ -0,0 +1,154 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 1 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 diff --git a/evidence/allen-omega-L694/L734/pending-red.om b/evidence/allen-omega-L694/L734/pending-red.om new file mode 100644 index 00000000..f5a6c061 --- /dev/null +++ b/evidence/allen-omega-L694/L734/pending-red.om @@ -0,0 +1,3167 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +note End-to-end application core over real Omega protocol bytes; no socket simulation claim. +text Smallask "hello" +text Codeaskt "Please make me a calculator" +text Finaltxt " 1/1 Model answer." +text Codetxt " 1/1 9 3ce11e06 python print(1)\\n" +text Prefixes "SAY WAIT CODE " +text Againexp "AGAIN 2" +global SavedOut uchar 8192 +global Heldwire uchar 8192 +global Heldlen ulong 2 +fn holdwire to void +put Heldlen 0 get Outlen 0 +put Heldlen 1 get Err 0 +for i ulong get Outlen 0 +put Heldwire i get Outb i +end +end +fn unhold to void +for i ulong get Heldlen 0 +put Outb i get Heldwire i +end +put Outlen 0 get Heldlen 0 +put Err 0 get Heldlen 1 +end +fn samewire to bool +if ne get Outlen 0 get Heldlen 0 +ret false +end +for i ulong get Heldlen 0 +if ne get Outb i get Heldwire i +ret false +end +end +ret eq get Err 0 get Heldlen 1 +end +fn test ok bool to void +n = get Outlen 0 +e = get Err 0 +for i ulong n +put SavedOut i get Outb i +end +check ok add get Checks 0 1 +for i ulong n +put Outb i get SavedOut i +end +put Outlen 0 n +put Err 0 e +end +fn copyout to void +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +end +fn prompt code bool to void +if code +put Inlen 0 len Codeaskt +for i ulong len Codeaskt +put In i get Codeaskt i +end +else +put Inlen 0 len Smallask +for i ulong len Smallask +put In i get Smallask i +end +end +end +fn incoming part ulong seq ulong kind ulong to void +outreset +off = ulong 0 +size = ulong 4 +if eq kind 1 +off = ulong 4 +size = ulong 5 +end +if eq kind 2 +off = ulong 9 +size = ulong 5 +end +for i ulong size +emitb get Prefixes add off i +end +emitn seq +if eq kind 0 +for i ulong len Finaltxt +emitb get Finaltxt i +end +end +if eq kind 2 +for i ulong len Codetxt +emitb get Codetxt i +end +end +copyout +b = packet 2 get Q 1 part 0 0 +copyout +end +fn main to int +test not appinit 0 100 +test appinit 42 100 +test not appinit 43 100 +test eq get Q 0 42 +prompt false +test appask 100 +test eq get R 0 1 +test eq get Q 1 1 +test eq get R 9 1 +test eq get R 1 1 +test eq get A 2 0 +prompt false +test not appask 101 +test eq get R 9 1 +test apppoll 100 true +test eq get T 10 5 +test appsent 100 true +test apppoll 100 true +test eq get T 10 1 +copyout +test pkparse +test eq get N 1 1 +test eq get In get N 5 74 +test appsent 100 true +incoming 1 1 0 +test appreceive 101 +test eq get A 2 1 +test eq get R 1 0 +test eq get R 8 13 +test eq get R 9 2 +test eq get Answer 0 77 +prompt true +test not appask 102 +test eq get R 0 1 +test apppoll 102 true +test eq get T 10 3 +test appsent 102 true +note Code acknowledgement is visible immediately, but missing code requests AGAIN. +prompt true +test appask 103 +test eq get R 0 2 +test eq get Q 1 2 +test eq get R 2 2 +test eq get A 2 1 +test eq get R 8 len Ack +test apppoll 103 true +test appsent 103 false +test apppoll 104 true +test eq get T 10 1 +test appsent 104 true +incoming 1 2 0 +test appreceive 105 +test eq get A 2 2 +test eq get A 1 len Againexp +test eq get R 1 1 +test eq get R 13 1 +test apppoll 105 true +test eq get T 10 3 +test eq get Q 1 2 +test appsent 105 true +test apppoll 106 true +test eq get T 10 1 +test eq get Q 1 3 +test eq get R 0 2 +copyout +test pkparse +test eq get N 6 len Againexp +bad = ulong 0 +for i ulong len Againexp +if ne get In add get N 5 i get Againexp i +bad = add bad 1 +end +end +test eq bad 0 +test appsent 106 true +incoming 1 2 0 +test appreceive 107 +test eq get A 2 3 +test eq get R 1 0 +test eq get A 1 0 +note Reset cancels pending delivery without reusing either counter. +appreset +test eq get R 0 2 +test eq get Q 1 3 +test eq get R 9 0 +prompt false +test appask 108 +test eq get R 0 3 +test eq get Q 1 4 +test apppoll 108 true +test appsent 108 true +incoming 1 2 0 +test appreceive 109 +test eq get A 2 4 +test eq get R 1 1 +test eq get R 8 0 +test apppoll 109 true +test appsent 109 true +incoming 2 3 0 +test appreceive 110 +test eq get A 2 1 +test eq get R 1 0 +test eq get R 9 2 +test apppoll 110 true +test appsent 110 true +note Cancellation drops an outstanding send and stale response safely. +prompt false +test appask 111 +test apppoll 111 true +appcancel +test eq get R 1 0 +test eq get T 5 0 +test not appsent 111 true +incoming 1 4 0 +test not appreceive 112 +note Complete CODE bytes must arrive before a code response becomes visible. +prompt true +test appask 113 +test eq get R 0 5 +test eq get Q 1 6 +test apppoll 113 true +test appsent 113 true +incoming 1 5 2 +test appreceive 114 +test eq get A 2 0 +test eq codestat 2 +test eq get R 6 0 +test apppoll 114 true +test appsent 114 true +incoming 2 5 0 +test appreceive 115 +test eq get A 2 1 +test eq get R 6 1 +test eq get R 1 0 +test eq get Code 6 49 +test apppoll 115 true +test appsent 115 true +note WAIT updates silence deadline, no answer; slow and timeout cancel both layers. +prompt false +test appask 116 +test eq get R 0 6 +test apppoll 116 true +test appsent 116 true +incoming 1 6 1 +test appreceive 117 +test eq get A 2 0 +test eq get R 4 117 +test apppoll 117 true +test appsent 117 true +v = apppoll 20116 true +test eq get A 2 5 +test eq get R 1 1 +if v +test appsent 20116 true +end +v = apppoll 30116 true +test eq get R 1 1 +if v +test appsent 30116 true +end +v = apppoll 30117 true +test eq get A 2 6 +test eq get R 1 0 +test eq get T 5 0 +test eq get A 1 0 +if v +test appsent 30117 true +end +n = get R 9 +prompt false +test not appask 30116 +test eq get R 9 n +test not apppoll 30116 true +note Invalid prompt never becomes a pending job or transcript line. +put Inlen 0 160 +test not appask 30118 +test eq get R 9 n +test eq get R 0 6 +test eq get Q 1 7 +note Receiving a code completion before send-result reporting cannot replace +note the pending datagram with the newly generated AGAIN text. +prompt true +test appask 30118 +test apppoll 30118 true +test eq get T 10 1 +holdwire +incoming 1 7 0 +unhold +test appreceive 30119 +test eq get A 2 2 +test samewire +test eq get T 10 1 +test appsent 30119 true +test apppoll 30120 true +test eq get T 10 3 +test appsent 30120 true +test apppoll 30121 true +test eq get Q 1 9 +test eq get R 0 7 +test appsent 30121 true +appcancel +note Idle runtime still refuses a new prompt while a HELLO send is outstanding. +test apppoll 32122 true +test eq get T 10 5 +holdwire +n = get R 9 +prompt false +test not appask 32122 +test samewire +test eq get R 9 n +test appsent 32122 true +ret int get Fails 0 +end diff --git a/evidence/allen-omega-L694/L734/pendingwire-mutant.log b/evidence/allen-omega-L694/L734/pendingwire-mutant.log new file mode 100644 index 00000000..09c53f20 --- /dev/null +++ b/evidence/allen-omega-L694/L734/pendingwire-mutant.log @@ -0,0 +1,161 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 1 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 diff --git a/evidence/allen-omega-L694/L734/readback-mutant.log b/evidence/allen-omega-L694/L734/readback-mutant.log new file mode 100644 index 00000000..268002ad --- /dev/null +++ b/evidence/allen-omega-L694/L734/readback-mutant.log @@ -0,0 +1,79 @@ +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 0 +310 0 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 1 +339 1 +340 0 +341 0 +342 0 +343 0 +344 1 +345 0 +346 0 +347 0 +348 0 +349 1 +350 1 +351 0 +352 0 +362 0 +363 0 +353 1 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 1 +361 0 diff --git a/evidence/allen-omega-L694/L734/red.om b/evidence/allen-omega-L694/L734/red.om new file mode 100644 index 00000000..f481e6e5 --- /dev/null +++ b/evidence/allen-omega-L694/L734/red.om @@ -0,0 +1,2921 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Compilable behavioral RED stub only; not product implementation. +global A ulong 4 +global Appjob uchar 4096 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +ret false +end +fn appask now ulong to bool +ret false +end +fn apppoll now ulong link bool to bool +ret false +end +fn appsent now ulong ok bool to bool +ret false +end +fn appreceive now ulong to bool +ret false +end +fn appcancel to void +end +fn appreset to void +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +note End-to-end application core over real Omega protocol bytes; no socket simulation claim. +text Smallask "hello" +text Codeasktest "Please make me a calculator" +text Finalwords " 1/1 Model answer." +text Codewords " 1/1 9 3ce11e06 python print(1)\\n" +text Prefixes "SAY WAIT CODE " +text Againexpected "AGAIN 2" +global SavedOut uchar 8192 +fn test ok bool to void +n = get Outlen 0 +e = get Err 0 +for i ulong n +put SavedOut i get Outb i +end +check ok add get Checks 0 1 +for i ulong n +put Outb i get SavedOut i +end +put Outlen 0 n +put Err 0 e +end +fn copyout to void +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +end +fn prompt code bool to void +if code +put Inlen 0 len Codeasktest +for i ulong len Codeasktest +put In i get Codeasktest i +end +else +put Inlen 0 len Smallask +for i ulong len Smallask +put In i get Smallask i +end +end +end +fn incoming part ulong seq ulong kind ulong to void +outreset +off = ulong 0 +size = ulong 4 +if eq kind 1 +off = ulong 4 +size = ulong 5 +end +if eq kind 2 +off = ulong 9 +size = ulong 5 +end +for i ulong size +emitb get Prefixes add off i +end +emitn seq +if eq kind 0 +for i ulong len Finalwords +emitb get Finalwords i +end +end +if eq kind 2 +for i ulong len Codewords +emitb get Codewords i +end +end +copyout +b = packet 2 get Q 1 part 0 0 +copyout +end +fn main to int +test not appinit 0 100 +test appinit 42 100 +test not appinit 43 100 +test eq get Q 0 42 +prompt false +test appask 100 +test eq get R 0 1 +test eq get Q 1 1 +test eq get R 9 1 +test eq get R 1 1 +test eq get A 2 0 +prompt false +test not appask 101 +test eq get R 9 1 +test apppoll 100 true +test eq get T 10 5 +test appsent 100 true +test apppoll 100 true +test eq get T 10 1 +copyout +test pkparse +test eq get N 1 1 +test eq get In get N 5 74 +test appsent 100 true +incoming 1 1 0 +test appreceive 101 +test eq get A 2 1 +test eq get R 1 0 +test eq get R 8 13 +test eq get R 9 2 +test eq get Answer 0 77 +prompt true +test not appask 102 +test eq get R 0 1 +test apppoll 102 true +test eq get T 10 3 +test appsent 102 true +note Code acknowledgement is visible immediately, but missing code requests AGAIN. +prompt true +test appask 103 +test eq get R 0 2 +test eq get Q 1 2 +test eq get R 2 2 +test eq get A 2 1 +test eq get R 8 len Ack +test apppoll 103 true +test appsent 103 false +test apppoll 104 true +test eq get T 10 1 +test appsent 104 true +incoming 1 2 0 +test appreceive 105 +test eq get A 2 2 +test eq get A 1 len Againexpected +test eq get R 1 1 +test eq get R 13 1 +test apppoll 105 true +test eq get T 10 3 +test eq get Q 1 2 +test appsent 105 true +test apppoll 106 true +test eq get T 10 1 +test eq get Q 1 3 +test eq get R 0 2 +copyout +test pkparse +test eq get N 6 len Againexpected +bad = ulong 0 +for i ulong len Againexpected +if ne get In add get N 5 i get Againexpected i +bad = add bad 1 +end +end +test eq bad 0 +test appsent 106 true +incoming 1 2 0 +test appreceive 107 +test eq get A 2 3 +test eq get R 1 0 +test eq get A 1 0 +note Reset cancels pending delivery without reusing either counter. +appreset +test eq get R 0 2 +test eq get Q 1 3 +test eq get R 9 0 +prompt false +test appask 108 +test eq get R 0 3 +test eq get Q 1 4 +test apppoll 108 true +test appsent 108 true +incoming 1 2 0 +test appreceive 109 +test eq get A 2 4 +test eq get R 1 1 +test eq get R 8 0 +test apppoll 109 true +test appsent 109 true +incoming 2 3 0 +test appreceive 110 +test eq get A 2 1 +test eq get R 1 0 +test eq get R 9 2 +test apppoll 110 true +test appsent 110 true +note Cancellation drops an outstanding send and stale response safely. +prompt false +test appask 111 +test apppoll 111 true +appcancel +test eq get R 1 0 +test eq get T 5 0 +test not appsent 111 true +incoming 1 4 0 +test not appreceive 112 +note Complete CODE bytes must arrive before a code response becomes visible. +prompt true +test appask 113 +test eq get R 0 5 +test eq get Q 1 6 +test apppoll 113 true +test appsent 113 true +incoming 1 5 2 +test appreceive 114 +test eq get A 2 0 +test eq codestat 2 +test eq get R 6 0 +test apppoll 114 true +test appsent 114 true +incoming 2 5 0 +test appreceive 115 +test eq get A 2 1 +test eq get R 6 1 +test eq get R 1 0 +test eq get Code 6 49 +test apppoll 115 true +test appsent 115 true +note WAIT updates silence deadline, no answer; slow and timeout cancel both layers. +prompt false +test appask 116 +test eq get R 0 6 +test apppoll 116 true +test appsent 116 true +incoming 1 6 1 +test appreceive 117 +test eq get A 2 0 +test eq get R 4 117 +test apppoll 117 true +test appsent 117 true +v = apppoll 20116 true +test eq get A 2 5 +test eq get R 1 1 +if v +test appsent 20116 true +end +v = apppoll 30116 true +test eq get R 1 1 +if v +test appsent 30116 true +end +v = apppoll 30117 true +test eq get A 2 6 +test eq get R 1 0 +test eq get T 5 0 +test eq get A 1 0 +if v +test appsent 30117 true +end +n = get R 9 +prompt false +test not appask 30116 +test eq get R 9 n +test not apppoll 30116 true +note Invalid prompt never becomes a pending job or transcript line. +put Inlen 0 160 +test not appask 30118 +test eq get R 9 n +test eq get R 0 6 +test eq get Q 1 7 +ret int get Fails 0 +end diff --git a/evidence/allen-omega-L694/L734/red2.exit b/evidence/allen-omega-L694/L734/red2.exit new file mode 100644 index 00000000..a9c8fe82 --- /dev/null +++ b/evidence/allen-omega-L694/L734/red2.exit @@ -0,0 +1 @@ +103 diff --git a/evidence/allen-omega-L694/L734/red2.log b/evidence/allen-omega-L694/L734/red2.log new file mode 100644 index 00000000..a8f0f1b5 --- /dev/null +++ b/evidence/allen-omega-L694/L734/red2.log @@ -0,0 +1,131 @@ +1 0 +2 1 +3 0 +4 1 +5 1 +6 1 +7 1 +8 1 +9 1 +10 0 +11 0 +12 1 +13 1 +14 1 +15 1 +16 1 +17 1 +18 1 +19 1 +20 1 +21 1 +22 1 +23 1 +24 0 +25 1 +26 1 +27 1 +28 0 +29 1 +30 1 +31 1 +32 1 +33 1 +34 1 +35 1 +36 1 +37 1 +38 1 +39 1 +40 1 +41 1 +42 1 +43 1 +44 1 +45 1 +46 1 +47 1 +48 1 +49 1 +50 1 +51 1 +52 1 +53 1 +54 1 +55 1 +56 1 +57 0 +58 1 +59 1 +60 1 +61 1 +62 1 +63 0 +64 0 +65 1 +66 1 +67 0 +68 1 +69 1 +70 1 +71 1 +72 1 +73 1 +74 1 +75 1 +76 0 +77 1 +78 1 +79 1 +80 1 +81 0 +82 1 +83 1 +84 1 +85 1 +86 1 +87 0 +88 0 +89 0 +90 0 +91 1 +92 1 +93 1 +94 1 +95 1 +96 1 +97 0 +98 1 +99 0 +100 1 +101 1 +102 1 +103 1 +104 1 +105 0 +106 1 +107 1 +108 1 +109 1 +110 1 +111 1 +112 1 +113 1 +114 0 +115 1 +116 1 +117 1 +118 1 +119 1 +120 1 +121 1 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 1 +131 1 diff --git a/evidence/allen-omega-L694/L734/red2.om b/evidence/allen-omega-L694/L734/red2.om new file mode 100644 index 00000000..5f46476a --- /dev/null +++ b/evidence/allen-omega-L694/L734/red2.om @@ -0,0 +1,2921 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Compilable behavioral RED stub only; not product implementation. +global A ulong 4 +global Appjob uchar 4096 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +ret false +end +fn appask now ulong to bool +ret false +end +fn apppoll now ulong link bool to bool +ret false +end +fn appsent now ulong ok bool to bool +ret false +end +fn appreceive now ulong to bool +ret false +end +fn appcancel to void +end +fn appreset to void +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +note End-to-end application core over real Omega protocol bytes; no socket simulation claim. +text Smallask "hello" +text Codeaskt "Please make me a calculator" +text Finaltxt " 1/1 Model answer." +text Codetxt " 1/1 9 3ce11e06 python print(1)\\n" +text Prefixes "SAY WAIT CODE " +text Againexp "AGAIN 2" +global SavedOut uchar 8192 +fn test ok bool to void +n = get Outlen 0 +e = get Err 0 +for i ulong n +put SavedOut i get Outb i +end +check ok add get Checks 0 1 +for i ulong n +put Outb i get SavedOut i +end +put Outlen 0 n +put Err 0 e +end +fn copyout to void +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +end +fn prompt code bool to void +if code +put Inlen 0 len Codeaskt +for i ulong len Codeaskt +put In i get Codeaskt i +end +else +put Inlen 0 len Smallask +for i ulong len Smallask +put In i get Smallask i +end +end +end +fn incoming part ulong seq ulong kind ulong to void +outreset +off = ulong 0 +size = ulong 4 +if eq kind 1 +off = ulong 4 +size = ulong 5 +end +if eq kind 2 +off = ulong 9 +size = ulong 5 +end +for i ulong size +emitb get Prefixes add off i +end +emitn seq +if eq kind 0 +for i ulong len Finaltxt +emitb get Finaltxt i +end +end +if eq kind 2 +for i ulong len Codetxt +emitb get Codetxt i +end +end +copyout +b = packet 2 get Q 1 part 0 0 +copyout +end +fn main to int +test not appinit 0 100 +test appinit 42 100 +test not appinit 43 100 +test eq get Q 0 42 +prompt false +test appask 100 +test eq get R 0 1 +test eq get Q 1 1 +test eq get R 9 1 +test eq get R 1 1 +test eq get A 2 0 +prompt false +test not appask 101 +test eq get R 9 1 +test apppoll 100 true +test eq get T 10 5 +test appsent 100 true +test apppoll 100 true +test eq get T 10 1 +copyout +test pkparse +test eq get N 1 1 +test eq get In get N 5 74 +test appsent 100 true +incoming 1 1 0 +test appreceive 101 +test eq get A 2 1 +test eq get R 1 0 +test eq get R 8 13 +test eq get R 9 2 +test eq get Answer 0 77 +prompt true +test not appask 102 +test eq get R 0 1 +test apppoll 102 true +test eq get T 10 3 +test appsent 102 true +note Code acknowledgement is visible immediately, but missing code requests AGAIN. +prompt true +test appask 103 +test eq get R 0 2 +test eq get Q 1 2 +test eq get R 2 2 +test eq get A 2 1 +test eq get R 8 len Ack +test apppoll 103 true +test appsent 103 false +test apppoll 104 true +test eq get T 10 1 +test appsent 104 true +incoming 1 2 0 +test appreceive 105 +test eq get A 2 2 +test eq get A 1 len Againexp +test eq get R 1 1 +test eq get R 13 1 +test apppoll 105 true +test eq get T 10 3 +test eq get Q 1 2 +test appsent 105 true +test apppoll 106 true +test eq get T 10 1 +test eq get Q 1 3 +test eq get R 0 2 +copyout +test pkparse +test eq get N 6 len Againexp +bad = ulong 0 +for i ulong len Againexp +if ne get In add get N 5 i get Againexp i +bad = add bad 1 +end +end +test eq bad 0 +test appsent 106 true +incoming 1 2 0 +test appreceive 107 +test eq get A 2 3 +test eq get R 1 0 +test eq get A 1 0 +note Reset cancels pending delivery without reusing either counter. +appreset +test eq get R 0 2 +test eq get Q 1 3 +test eq get R 9 0 +prompt false +test appask 108 +test eq get R 0 3 +test eq get Q 1 4 +test apppoll 108 true +test appsent 108 true +incoming 1 2 0 +test appreceive 109 +test eq get A 2 4 +test eq get R 1 1 +test eq get R 8 0 +test apppoll 109 true +test appsent 109 true +incoming 2 3 0 +test appreceive 110 +test eq get A 2 1 +test eq get R 1 0 +test eq get R 9 2 +test apppoll 110 true +test appsent 110 true +note Cancellation drops an outstanding send and stale response safely. +prompt false +test appask 111 +test apppoll 111 true +appcancel +test eq get R 1 0 +test eq get T 5 0 +test not appsent 111 true +incoming 1 4 0 +test not appreceive 112 +note Complete CODE bytes must arrive before a code response becomes visible. +prompt true +test appask 113 +test eq get R 0 5 +test eq get Q 1 6 +test apppoll 113 true +test appsent 113 true +incoming 1 5 2 +test appreceive 114 +test eq get A 2 0 +test eq codestat 2 +test eq get R 6 0 +test apppoll 114 true +test appsent 114 true +incoming 2 5 0 +test appreceive 115 +test eq get A 2 1 +test eq get R 6 1 +test eq get R 1 0 +test eq get Code 6 49 +test apppoll 115 true +test appsent 115 true +note WAIT updates silence deadline, no answer; slow and timeout cancel both layers. +prompt false +test appask 116 +test eq get R 0 6 +test apppoll 116 true +test appsent 116 true +incoming 1 6 1 +test appreceive 117 +test eq get A 2 0 +test eq get R 4 117 +test apppoll 117 true +test appsent 117 true +v = apppoll 20116 true +test eq get A 2 5 +test eq get R 1 1 +if v +test appsent 20116 true +end +v = apppoll 30116 true +test eq get R 1 1 +if v +test appsent 30116 true +end +v = apppoll 30117 true +test eq get A 2 6 +test eq get R 1 0 +test eq get T 5 0 +test eq get A 1 0 +if v +test appsent 30117 true +end +n = get R 9 +prompt false +test not appask 30116 +test eq get R 9 n +test not apppoll 30116 true +note Invalid prompt never becomes a pending job or transcript line. +put Inlen 0 160 +test not appask 30118 +test eq get R 9 n +test eq get R 0 6 +test eq get Q 1 7 +ret int get Fails 0 +end diff --git a/evidence/allen-omega-L694/L734/reply.log b/evidence/allen-omega-L694/L734/reply.log new file mode 100644 index 00000000..d11a72ad --- /dev/null +++ b/evidence/allen-omega-L694/L734/reply.log @@ -0,0 +1,15 @@ +801 0 +802 0 +803 0 +804 0 +805 0 +806 0 +807 0 +808 0 +809 0 +810 0 +811 0 +812 0 +813 0 +814 0 +815 0 diff --git a/evidence/allen-omega-L694/L734/runtime.log b/evidence/allen-omega-L694/L734/runtime.log new file mode 100644 index 00000000..5168e6f3 --- /dev/null +++ b/evidence/allen-omega-L694/L734/runtime.log @@ -0,0 +1,28 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 diff --git a/evidence/allen-omega-L694/L734/scene.log b/evidence/allen-omega-L694/L734/scene.log new file mode 100644 index 00000000..44a4b2b1 --- /dev/null +++ b/evidence/allen-omega-L694/L734/scene.log @@ -0,0 +1,14 @@ +1001 0 +1002 0 +1003 0 +1004 0 +1005 0 +1006 0 +1007 0 +1008 0 +1009 0 +1010 0 +1011 0 +1012 0 +1013 0 +1014 0 diff --git a/evidence/allen-omega-L694/L734/scheduler.log b/evidence/allen-omega-L694/L734/scheduler.log new file mode 100644 index 00000000..1d8ffd12 --- /dev/null +++ b/evidence/allen-omega-L694/L734/scheduler.log @@ -0,0 +1,213 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 +183 0 +184 0 +185 0 +186 0 +187 0 +188 0 +189 0 +190 0 +191 0 +192 0 +193 0 +194 0 +195 0 +196 0 +197 0 +198 0 +199 0 +200 0 +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 diff --git a/evidence/allen-omega-L694/L734/session-mutant.log b/evidence/allen-omega-L694/L734/session-mutant.log new file mode 100644 index 00000000..9ce7ef78 --- /dev/null +++ b/evidence/allen-omega-L694/L734/session-mutant.log @@ -0,0 +1,24 @@ +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 1 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 diff --git a/evidence/allen-omega-L694/L734/short.log b/evidence/allen-omega-L694/L734/short.log new file mode 100644 index 00000000..a9da2dc8 --- /dev/null +++ b/evidence/allen-omega-L694/L734/short.log @@ -0,0 +1,20 @@ +401 0 +410 0 +411 0 +412 0 +413 0 +414 0 +402 0 +403 0 +404 0 +405 0 +406 0 +700 0 +701 0 +702 0 +703 0 +704 0 +705 0 +407 0 +408 0 +409 0 diff --git a/evidence/allen-omega-L694/L734/source.sha256 b/evidence/allen-omega-L694/L734/source.sha256 new file mode 100644 index 00000000..5dfc4a21 --- /dev/null +++ b/evidence/allen-omega-L694/L734/source.sha256 @@ -0,0 +1,39 @@ +3e50df43c5be10dc91c5ee1c996197ca5137930312b7801908209ac1e46297be native/omega/allen/application.om +184f4270c72c4eca6a7afdd28b70a608f2e237980b12c8a7bfc2c7d2c3e625b9 native/omega/allen/base.om +795ca28627a19f1088de0f23277e79cdac921ff88451c606c7b655ce0f2e8a5b native/omega/allen/build-one.sh +4d2235ac5d6b237695b1c3112f70ebdfa0cebafa2ec8e691e4be4de37a62199b native/omega/allen/code.om +76ee9cdeaac036905c76dfa29f42bf5a78d1259ad1656adfaa24916c3b93550d native/omega/allen/courier.om +87024b3e838ab15860991cdf5f70cfa4ad2b63ec2b9b843cb2da0276143fcf5f native/omega/allen/gate.sh +9d71a653870eeef678f95df04db9c38aedaadd06e7c74bf3e5d9fde6e28f82f8 native/omega/allen/golden.sh +06087bc573ebb876a0ed80f6025c592fb4b1d23335169c3da402824fd1482c35 native/omega/allen/intent.om +4bc37c95d553364c5d2925d8ff9e8a53b1a61974513e6f492f77b7ebb05bbda4 native/omega/allen/main.om +068292abd04d3a61b063fc5380b22a56c4235a87915c219ebf3b37d16d7bc9c7 native/omega/allen/memory.om +b4d7b6e6cd680d2ba1eec2978b0cbb81ffc63035b73f5c3726bdad97a7b6aa04 native/omega/allen/paint.om +ba47aedd0244c5229f8543aad7fd5120631c6f4cf502fde038ca27e7659cecec native/omega/allen/README.md +e50a7f673aaee92aba4a3aec303aa93b071121c09ad05d4ad1dcc2deb9706dcc native/omega/allen/reply.om +5b01eae03204d08f6d207ef29f2ba09a1d9f249f1738f68f151214675a4ff2ed native/omega/allen/runtime.om +c8d4a437b41538cc1eeb62a2029c6993d41e5ef90cc7b26c8e1c92bc98ec57d3 native/omega/allen/scene.om +615dff78462a715153b3d891b2cfe146c318d3a0a26ae1aaa642484f965c12df native/omega/allen/scheduler.om +1ee602d161b261f0051f4403592d3e01000b91f63c0b5e157fe105d72f7d44da native/omega/allen/tests/application.om +f085198549d1c235a97574ff6f6560ce82217611f4051fc3dbbc8286aab6d536 native/omega/allen/tests/check.om +b76438a85257bd95768115047be286c107e3723628a16a0541870732d0849a42 native/omega/allen/tests/code.om +98105e1c30626f54da07940fe0415637730b7e112ea39ba2aae1f2d648993373 native/omega/allen/tests/courier.om +f524aab74657dc2e9e4330bf42bc05ef01ce3e8f08a05c80371be0c0a33764d3 native/omega/allen/tests/edges.om +a2e8bcde92d522216a4fa99559dd3bcba096aea86127364587dadcc2bfb585af native/omega/allen/tests/fixture.om +c9ef2bee7cbd1c072c6045d62c55f3bdd938901e91792cee72ea57fb8f25a198 native/omega/allen/tests/golden.om +8ba742d85ea510586f3cf86661bc0f28c5d99b59981c2d3fb220705efad24564 native/omega/allen/tests/intent.om +861d9af698b021056cceb6c00ae3458558db415963fe832d3fca7da55731cf7b native/omega/allen/tests/memory.om +13e4db7436165783c6aad48497ffe89fa6e5ba3de928e66a766c29e1e817fcf5 native/omega/allen/tests/paint.om +e6d232d92d74d88423cebbbbfc6e403ea9b865b80c909e1d23087001d905035a native/omega/allen/tests/probe.om +8fbc8a0517900efd771a994686356416a0fea5e20cfd9bc26c787850398113df native/omega/allen/tests/render.om +094a5e833bae7dfd3b013e3f015f143e9d7bd3efe9b9c896a7f58b09e1ec14b8 native/omega/allen/tests/reply.om +bab9b0e853aa4b62918353a5d1625a3171deebfb639e599fe9751b5a61a3df62 native/omega/allen/tests/runtime.om +b9c84d9a58658589137764fe60209d8320550dd8ed99fa6026df65ba48737e4f native/omega/allen/tests/scene.om +bf984fa9cf63ddb569147afc2a028ccdafdbeae2067125cf35d658e5d00f4c94 native/omega/allen/tests/scheduler.om +521fff50f312b64801017b1349d9a31dac6eac50eb989d93d2dbac4e100f5007 native/omega/allen/tests/stdio-overflow.om +89aee5326b428147ea6da9aa739b6679e214ed114ae5f41d3b70299cf864092c native/omega/allen/tests/view.om +0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0 native/omega/allen/vendor/OMEGA-LICENSE +b234738e8ce81b3d67586deb41fdaab4543169d4b69e86fd3dc28a08432ab5fc native/omega/allen/vendor/PROVENANCE.md +992ec4a4957271b442740598136887a5c610effcd8ae9fb9480a006a4f181097 native/omega/allen/vendor/sha256-core.om +0781cdcec18570a57afbe3be4a6717dd2d1fa4c887b49a3e4cb542b594f8a041 native/omega/allen/vendor/sha256.om +abbefd2f7dc48f2ac28b9526f5c2e5b369da4b7c5e84dde6e6a3cd20bd5687ac native/omega/allen/view.om diff --git a/evidence/allen-omega-L694/L734/stale-mutant.log b/evidence/allen-omega-L694/L734/stale-mutant.log new file mode 100644 index 00000000..ac2e3d09 --- /dev/null +++ b/evidence/allen-omega-L694/L734/stale-mutant.log @@ -0,0 +1,28 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 1 +7 1 +8 1 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 diff --git a/evidence/allen-omega-L694/L734/stalecode-red.exit b/evidence/allen-omega-L694/L734/stalecode-red.exit new file mode 100644 index 00000000..00750edc --- /dev/null +++ b/evidence/allen-omega-L694/L734/stalecode-red.exit @@ -0,0 +1 @@ +3 diff --git a/evidence/allen-omega-L694/L734/stalecode-red.log b/evidence/allen-omega-L694/L734/stalecode-red.log new file mode 100644 index 00000000..a7e8e5a9 --- /dev/null +++ b/evidence/allen-omega-L694/L734/stalecode-red.log @@ -0,0 +1,161 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 1 +76 1 +77 1 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 diff --git a/evidence/allen-omega-L694/L734/stalecode-red.om b/evidence/allen-omega-L694/L734/stalecode-red.om new file mode 100644 index 00000000..1edd6596 --- /dev/null +++ b/evidence/allen-omega-L694/L734/stalecode-red.om @@ -0,0 +1,3193 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +note End-to-end application core over real Omega protocol bytes; no socket simulation claim. +text Smallask "hello" +text Codeaskt "Please make me a calculator" +text Finaltxt " 1/1 Model answer." +text Codetxt " 1/1 9 3ce11e06 python print(1)\\n" +text Prefixes "SAY WAIT CODE " +text Againexp "AGAIN 2" +global SavedOut uchar 8192 +global Heldwire uchar 8192 +global Heldlen ulong 2 +fn holdwire to void +put Heldlen 0 get Outlen 0 +put Heldlen 1 get Err 0 +for i ulong get Outlen 0 +put Heldwire i get Outb i +end +end +fn unhold to void +for i ulong get Heldlen 0 +put Outb i get Heldwire i +end +put Outlen 0 get Heldlen 0 +put Err 0 get Heldlen 1 +end +fn samewire to bool +if ne get Outlen 0 get Heldlen 0 +ret false +end +for i ulong get Heldlen 0 +if ne get Outb i get Heldwire i +ret false +end +end +ret eq get Err 0 get Heldlen 1 +end +fn test ok bool to void +n = get Outlen 0 +e = get Err 0 +for i ulong n +put SavedOut i get Outb i +end +check ok add get Checks 0 1 +for i ulong n +put Outb i get SavedOut i +end +put Outlen 0 n +put Err 0 e +end +fn copyout to void +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +end +fn prompt code bool to void +if code +put Inlen 0 len Codeaskt +for i ulong len Codeaskt +put In i get Codeaskt i +end +else +put Inlen 0 len Smallask +for i ulong len Smallask +put In i get Smallask i +end +end +end +fn incoming part ulong seq ulong kind ulong to void +outreset +off = ulong 0 +size = ulong 4 +if eq kind 1 +off = ulong 4 +size = ulong 5 +end +if eq kind 2 +off = ulong 9 +size = ulong 5 +end +for i ulong size +emitb get Prefixes add off i +end +emitn seq +if eq kind 0 +for i ulong len Finaltxt +emitb get Finaltxt i +end +end +if eq kind 2 +for i ulong len Codetxt +emitb get Codetxt i +end +end +copyout +b = packet 2 get Q 1 part 0 0 +copyout +end +fn main to int +test not appinit 0 100 +test appinit 42 100 +test not appinit 43 100 +test eq get Q 0 42 +prompt false +test appask 100 +test eq get R 0 1 +test eq get Q 1 1 +test eq get R 9 1 +test eq get R 1 1 +test eq get A 2 0 +prompt false +test not appask 101 +test eq get R 9 1 +test apppoll 100 true +test eq get T 10 5 +test appsent 100 true +test apppoll 100 true +test eq get T 10 1 +copyout +test pkparse +test eq get N 1 1 +test eq get In get N 5 74 +test appsent 100 true +incoming 1 1 0 +test appreceive 101 +test eq get A 2 1 +test eq get R 1 0 +test eq get R 8 13 +test eq get R 9 2 +test eq get Answer 0 77 +prompt true +test not appask 102 +test eq get R 0 1 +test apppoll 102 true +test eq get T 10 3 +test appsent 102 true +note Code acknowledgement is visible immediately, but missing code requests AGAIN. +prompt true +test appask 103 +test eq get R 0 2 +test eq get Q 1 2 +test eq get R 2 2 +test eq get A 2 1 +test eq get R 8 len Ack +test apppoll 103 true +test appsent 103 false +test apppoll 104 true +test eq get T 10 1 +test appsent 104 true +incoming 1 2 0 +test appreceive 105 +test eq get A 2 2 +test eq get A 1 len Againexp +test eq get R 1 1 +test eq get R 13 1 +test apppoll 105 true +test eq get T 10 3 +test eq get Q 1 2 +test appsent 105 true +test apppoll 106 true +test eq get T 10 1 +test eq get Q 1 3 +test eq get R 0 2 +copyout +test pkparse +test eq get N 6 len Againexp +bad = ulong 0 +for i ulong len Againexp +if ne get In add get N 5 i get Againexp i +bad = add bad 1 +end +end +test eq bad 0 +test appsent 106 true +incoming 1 2 0 +test appreceive 107 +test eq get A 2 3 +test eq get R 1 0 +test eq get A 1 0 +note Reset cancels pending delivery without reusing either counter. +appreset +test eq get R 0 2 +test eq get Q 1 3 +test eq get R 9 0 +prompt false +test appask 108 +test eq get R 0 3 +test eq get Q 1 4 +test apppoll 108 true +test appsent 108 true +note Old CODE must not mutate the code buffer during a newer chat job. +incoming 1 2 2 +test appreceive 109 +test eq get A 2 4 +test eq get C 1 0 +test eq get C 2 0 +test eq get Code 0 0 +test apppoll 109 true +test appsent 109 true +incoming 2 2 0 +test appreceive 109 +test eq get A 2 4 +test eq get R 1 1 +test eq get R 8 0 +test apppoll 109 true +test appsent 109 true +incoming 3 3 0 +test appreceive 110 +test eq get A 2 1 +test eq get R 1 0 +test eq get R 9 2 +test apppoll 110 true +test appsent 110 true +note Cancellation drops an outstanding send and stale response safely. +prompt false +test appask 111 +test apppoll 111 true +appcancel +test eq get R 1 0 +test eq get T 5 0 +test not appsent 111 true +incoming 1 4 0 +test not appreceive 112 +note Complete CODE bytes must arrive before a code response becomes visible. +prompt true +test appask 113 +test eq get R 0 5 +test eq get Q 1 6 +test apppoll 113 true +test appsent 113 true +incoming 1 5 2 +test appreceive 114 +test eq get A 2 0 +test eq codestat 2 +test eq get R 6 0 +test apppoll 114 true +test appsent 114 true +incoming 2 5 0 +test appreceive 115 +test eq get A 2 1 +test eq get R 6 1 +test eq get R 1 0 +test eq get Code 6 49 +test apppoll 115 true +test appsent 115 true +note WAIT updates silence deadline, no answer; slow and timeout cancel both layers. +prompt false +test appask 116 +test eq get R 0 6 +test apppoll 116 true +test appsent 116 true +incoming 1 6 1 +test appreceive 117 +test eq get A 2 0 +test eq get R 4 117 +test apppoll 117 true +test appsent 117 true +v = apppoll 20116 true +test eq get A 2 5 +test eq get R 1 1 +if v +test appsent 20116 true +end +v = apppoll 30116 true +test eq get R 1 1 +if v +test appsent 30116 true +end +v = apppoll 30117 true +test eq get A 2 6 +test eq get R 1 0 +test eq get T 5 0 +test eq get A 1 0 +if v +test appsent 30117 true +end +n = get R 9 +prompt false +test not appask 30116 +test eq get R 9 n +test not apppoll 30116 true +note Invalid prompt never becomes a pending job or transcript line. +put Inlen 0 160 +test not appask 30118 +test eq get R 9 n +test eq get R 0 6 +test eq get Q 1 7 +note Receiving a code completion before send-result reporting cannot replace +note the pending datagram with the newly generated AGAIN text. +prompt true +test appask 30118 +test apppoll 30118 true +test eq get T 10 1 +holdwire +incoming 1 7 0 +unhold +test appreceive 30119 +test eq get A 2 2 +test samewire +test eq get T 10 1 +test appsent 30119 true +test apppoll 30120 true +test eq get T 10 3 +test appsent 30120 true +test apppoll 30121 true +test eq get Q 1 9 +test eq get R 0 7 +test appsent 30121 true +appcancel +note Idle runtime still refuses a new prompt while a HELLO send is outstanding. +test apppoll 32122 true +test eq get T 10 5 +holdwire +n = get R 9 +prompt false +test not appask 32122 +test samewire +test eq get R 9 n +test appsent 32122 true +ret int get Fails 0 +end diff --git a/evidence/allen-omega-L694/L734/stdio-overflow.stderr b/evidence/allen-omega-L694/L734/stdio-overflow.stderr new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L734/stdio-overflow.stdout b/evidence/allen-omega-L694/L734/stdio-overflow.stdout new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L734/view.log b/evidence/allen-omega-L694/L734/view.log new file mode 100644 index 00000000..8b194f11 --- /dev/null +++ b/evidence/allen-omega-L694/L734/view.log @@ -0,0 +1,13 @@ +901 0 +902 0 +903 0 +904 0 +905 0 +906 0 +907 0 +908 0 +909 0 +910 0 +911 0 +912 0 +913 0 diff --git a/evidence/allen-omega-L694/L740/README.md b/evidence/allen-omega-L694/L740/README.md new file mode 100644 index 00000000..7b82875b --- /dev/null +++ b/evidence/allen-omega-L694/L740/README.md @@ -0,0 +1,23 @@ +# L740 native scene-input normalization + +Host-only seeded Omega component, based on8d0d11b. Invocation on Spark: +`quiet-build native/omega/allen/gate.sh ~/handoffs/allen-omega-L694/L740/full`. +All new executable fixture/decoder code is handwritten Omega. Existing host +utilities only compile, inspect, compare and collect receipts. + +Initial RED: compilable stub,54 checks,30 failures,exit30 (`red2`). Earlier +compile-only failure was an unsupported backslash-r literal; the Omega fixture +now constructs CR explicitly as byte13. That compiler error is not RED evidence. + +Initial implementation passed54/54. Expanded boundary tests exposed nested-prefix +handling and mood/fallback decisions after the strict parser's twelve-line cap: +63 checks,4 failures,exit4 (`boundary-red`). Replaced nested prefix handling with +one iterative scanner and restricted fallback/mood eligibility to the same +canonical-line cap. Unchanged63-check suite then passed. Full native suite +passes; exact counts and eleven rejected behavioral mutants in counts.json. +Original checks, memory/stdio goldens and oversized-stdio refusal remain intact. + +The published source inventory was verified byte-for-byte immediately before +commit. Full gate built all native components together. Independent review of +this new decoder remains pending. scdecode is not yet attached to the application +reply/display provider; this is neither full UI parity nor target/live proof. diff --git a/evidence/allen-omega-L694/L740/ackstop-mutant.log b/evidence/allen-omega-L694/L740/ackstop-mutant.log new file mode 100644 index 00000000..5d0598cb --- /dev/null +++ b/evidence/allen-omega-L694/L740/ackstop-mutant.log @@ -0,0 +1,213 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 1 +65 1 +66 0 +67 0 +68 0 +69 1 +70 1 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 1 +165 0 +166 0 +167 0 +168 0 +169 1 +170 0 +171 1 +172 1 +173 0 +174 1 +175 0 +176 0 +177 0 +178 1 +179 0 +180 1 +181 0 +182 1 +183 0 +184 1 +185 0 +186 1 +187 0 +188 1 +189 0 +190 1 +191 0 +192 1 +193 0 +194 1 +195 1 +196 1 +197 1 +198 0 +199 1 +200 0 +201 0 +202 1 +203 1 +204 1 +205 0 +206 1 +207 1 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 diff --git a/evidence/allen-omega-L694/L740/appcode-mutant.log b/evidence/allen-omega-L694/L740/appcode-mutant.log new file mode 100644 index 00000000..c9c50601 --- /dev/null +++ b/evidence/allen-omega-L694/L740/appcode-mutant.log @@ -0,0 +1,182 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 1 +76 1 +77 1 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 diff --git a/evidence/allen-omega-L694/L740/application.log b/evidence/allen-omega-L694/L740/application.log new file mode 100644 index 00000000..2e8a428d --- /dev/null +++ b/evidence/allen-omega-L694/L740/application.log @@ -0,0 +1,182 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 diff --git a/evidence/allen-omega-L694/L740/binaries.sha256 b/evidence/allen-omega-L694/L740/binaries.sha256 new file mode 100644 index 00000000..e8f8e0ee --- /dev/null +++ b/evidence/allen-omega-L694/L740/binaries.sha256 @@ -0,0 +1,29 @@ +fc6b2a7c80f2074e23da4b2629696e0b44b09fe29c8f0a60452f3388e03addcf /home/drakestapleton/handoffs/allen-omega-L694/L740/full/scheduler +ac1de3d32e6d184fe83ad07fdbf46d5d613f82509be52262f347d3035ee82282 /home/drakestapleton/handoffs/allen-omega-L694/L740/full/readback-mutant +e33d72f80c931c5e04bc1b1e401bae634ac045aee36516d2b90e5f23f43fe4d4 /home/drakestapleton/handoffs/allen-omega-L694/L740/full/view +f436de24380b65ec512aa08297c4e283625db769f0315a1f7930e576ab4fc8e0 /home/drakestapleton/handoffs/allen-omega-L694/L740/full/allen +80f65ed7d474f5732f2d0aa51067d1d1196b657f03593c0d883684e2e81a652a /home/drakestapleton/handoffs/allen-omega-L694/L740/full/reply +16dc0ff6f370d518c5c3df72daddbebd383bd91c7bf09d9fb6fcba9d420ee2e9 /home/drakestapleton/handoffs/allen-omega-L694/L740/full/thinking-mutant +7ce2961880ae32232e36b77b015a96c686bf7e9e20d733f9882abe1a99f24588 /home/drakestapleton/handoffs/allen-omega-L694/L740/full/ackstop-mutant +1c3dd929f1f2925f7c8e502ec113e6dc64ec96fc47946f778066bded0e8576fe /home/drakestapleton/handoffs/allen-omega-L694/L740/full/hash-mutant +111882afad305486a00a9802271f8a500d7450c47b6189671eff7f14b44349ee /home/drakestapleton/handoffs/allen-omega-L694/L740/full/golden +02200fd42e88326192df118a71257347d91fd9d1c689b97c2a7518a7d3db2574 /home/drakestapleton/handoffs/allen-omega-L694/L740/full/session-mutant +d2e24d3d808b4665a12c13709e79dfd534346fda27b3fec8db0443912aef68bc /home/drakestapleton/handoffs/allen-omega-L694/L740/full/scene-input +0de2beb20699d540e9ee272ad0ae11023f5c0e139a690c704b167b945d9a3431 /home/drakestapleton/handoffs/allen-omega-L694/L740/full/intent +9b6d128eb0ead62fd21d4df9939b76a157a6bc1ae06d290063f841dd57cb42be /home/drakestapleton/handoffs/allen-omega-L694/L740/full/fixture +09328c9765e0e49501e5edc93e80ce9cf939bb25ad75c2a7f978e6dcb21f808b /home/drakestapleton/handoffs/allen-omega-L694/L740/full/runtime +a759d9d92a369d67b9160b633e792a9281c28d8c33e12b0f35cc11044b08b2e9 /home/drakestapleton/handoffs/allen-omega-L694/L740/full/code +3549fa6a28094b7c91f9506063b4d7db74a7cddf47c88b02312110757c0293ad /home/drakestapleton/handoffs/allen-omega-L694/L740/full/edges +66345ef16f9ba058529e4132460499cde8297f7d77834d62259512f842ac42b3 /home/drakestapleton/handoffs/allen-omega-L694/L740/full/appcode-mutant +42cb832125b210279ce72f888d02945dee926e090cbfcc4ec6bb9ae82ba592f0 /home/drakestapleton/handoffs/allen-omega-L694/L740/full/render +86d17146d30fe250bef091ff08bb731611ec617d81d171acc99a962cd242836f /home/drakestapleton/handoffs/allen-omega-L694/L740/full/stale-mutant +4a25e2fbcca906827f311b7df9289b803c1e306c2334da530520a163dae6667f /home/drakestapleton/handoffs/allen-omega-L694/L740/full/courier +e4b572cc127b72c04d90c40fa04bdbf56c3367ebc2e39b622e180c3a66955093 /home/drakestapleton/handoffs/allen-omega-L694/L740/full/scene +4a678078a364618e7bbd7b5392bf5b96c3892111bc470404baba942cd059ea16 /home/drakestapleton/handoffs/allen-omega-L694/L740/full/pendingwire-mutant +3fd5baca3fb6dd3bc590c6348513b105b7927b584aaf14c59d48b690dd5fc3d7 /home/drakestapleton/handoffs/allen-omega-L694/L740/full/scenecap-mutant +95021b9839810159ac055fcdc38cec1aa6c086da2f5672c6ac25696845e8cfe8 /home/drakestapleton/handoffs/allen-omega-L694/L740/full/paint +a11bc634f57064ef3ecc8e9acbad9396916169b97629cfcc434576f869d73708 /home/drakestapleton/handoffs/allen-omega-L694/L740/full/crc-mutant +71f99242bcad6ede239b240602470fcf3d5da3267eb47a1ad522241958222367 /home/drakestapleton/handoffs/allen-omega-L694/L740/full/stdio-overflow-input +74e92e88b14f2b5c41922ec90c6c607a132fce3d26963fcc503dba024eeaa0b7 /home/drakestapleton/handoffs/allen-omega-L694/L740/full/keepalive-mutant +0251d77464363cbbc20228c913cebd5dac4f4824976cf0d1eba74d58d1316c0a /home/drakestapleton/handoffs/allen-omega-L694/L740/full/memory +3c516b1017cec2445585eede96debe51edcd0c75ffe21dbaf35d75017b90d121 /home/drakestapleton/handoffs/allen-omega-L694/L740/full/application diff --git a/evidence/allen-omega-L694/L740/boundary-green.exit b/evidence/allen-omega-L694/L740/boundary-green.exit new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/L740/boundary-green.exit @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/L740/boundary-green.log b/evidence/allen-omega-L694/L740/boundary-green.log new file mode 100644 index 00000000..edd8e122 --- /dev/null +++ b/evidence/allen-omega-L694/L740/boundary-green.log @@ -0,0 +1,63 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 diff --git a/evidence/allen-omega-L694/L740/boundary-red.exit b/evidence/allen-omega-L694/L740/boundary-red.exit new file mode 100644 index 00000000..b8626c4c --- /dev/null +++ b/evidence/allen-omega-L694/L740/boundary-red.exit @@ -0,0 +1 @@ +4 diff --git a/evidence/allen-omega-L694/L740/boundary-red.log b/evidence/allen-omega-L694/L740/boundary-red.log new file mode 100644 index 00000000..ca5964d7 --- /dev/null +++ b/evidence/allen-omega-L694/L740/boundary-red.log @@ -0,0 +1,63 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 1 +57 0 +58 0 +59 1 +60 0 +61 0 +62 1 +63 1 diff --git a/evidence/allen-omega-L694/L740/boundary-red.om b/evidence/allen-omega-L694/L740/boundary-red.om new file mode 100644 index 00000000..fcbd919c --- /dev/null +++ b/evidence/allen-omega-L694/L740/boundary-red.om @@ -0,0 +1,3458 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes. Input and its length are restored. +global Nm ulong 8 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn nprefix to ulong +s = ulong 0 +n = get Nm 4 +while lt s n +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if not nlead get Nline add s 1 +ret s +end +s = add s 1 +put Nm 2 add get Nm 2 1 +else +if isdigit c +p = s +while lt p n +if isdigit get Nline p +p = add p 1 +else +ret nnumber s p n +end +end +ret s +else +ret s +end +end +while lt s n +if eq get Nline s 32 +s = add s 1 +else +ret npmore s +end +end +end +ret s +end +note Continue stripping nested marks without recursive calls or hidden state. +fn npmore s ulong to ulong +n = get Nm 4 +p = s +while lt p n +if not nmark get Nline p +if isdigit get Nline p +q = p +while lt q n +if isdigit get Nline q +q = add q 1 +else +ret nnumber p q n +end +end +end +ret p +end +if eq add p 1 n +ret n +end +if not nlead get Nline add p 1 +ret p +end +p = add p 1 +put Nm 2 add get Nm 2 1 +while lt p n +if eq get Nline p 32 +p = add p 1 +else +ret npword p +end +end +end +ret p +end +fn npword s ulong to ulong +note Star/hash runs need only skip repeated marks; ordinary words stop the loop. +p = s +n = get Nm 4 +while lt p n +if not nmark get Nline p +ret p +end +if eq add p 1 n +ret n +end +if not nlead get Nline add p 1 +ret p +end +p = add p 1 +put Nm 2 add get Nm 2 1 +end +ret p +end +fn nnumber original ulong p ulong n ulong to ulong +if ge add p 1 n +ret original +end +if not or eq get Nline p 46 eq get Nline p 41 +ret original +end +if ne get Nline add p 1 32 +ret original +end +p = add p 2 +put Nm 2 add get Nm 2 1 +ret npword p +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +put Nm 5 1 +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 8 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +text Fancy "\t- **SaY**:\tKeep My CASE.~\n> NOTE RIGHT WARM: Title | Body TEXT\n" +text Private "say secret\nnote: secret | hidden\n\n```scene\nsay Visible\n```\n" +text Inline "say public secret\nsay Safe\n" +text Unclosed "never closed\nsay secret\n" +text Plain "Hello there.\nAnother sentence.\n" +text Mixed "Unrecognized text.\nnote: Heading | Body\n" +text Invalid "number: nope\n" +text Moodonly "MOOD Dawn Lively\n" +text Listmark "1. note left: Heading | Body\n" +text Wanted "Keep My CASE." +text Vis "Visible" +text Hello "Hello there." +text Nested "- > - **SaY**: Nested works.\n" +text Negative "-3 is negative.\n" +global Savedin uchar 2048 +fn test ok bool to void +check ok add get Checks 0 1 +end +fn load which ulong to void +if eq which 0 +put Inlen 0 len Fancy +for i ulong len Fancy +c = get Fancy i +if eq c 126 +c = uchar 13 +end +put In i c +end +end +if eq which 1 +put Inlen 0 len Private +for i ulong len Private +put In i get Private i +end +end +if eq which 2 +put Inlen 0 len Inline +for i ulong len Inline +put In i get Inline i +end +end +if eq which 3 +put Inlen 0 len Unclosed +for i ulong len Unclosed +put In i get Unclosed i +end +end +if eq which 4 +put Inlen 0 len Plain +for i ulong len Plain +put In i get Plain i +end +end +if eq which 5 +put Inlen 0 len Mixed +for i ulong len Mixed +put In i get Mixed i +end +end +if eq which 6 +put Inlen 0 len Invalid +for i ulong len Invalid +put In i get Invalid i +end +end +if eq which 7 +put Inlen 0 len Moodonly +for i ulong len Moodonly +put In i get Moodonly i +end +end +if eq which 8 +put Inlen 0 len Listmark +for i ulong len Listmark +put In i get Listmark i +end +end +end +fn main to int +load 0 +n = get Inlen 0 +for i ulong n +put Savedin i get In i +end +test scdecode +test eq get Sc 2 1 +test eq get Sc 3 1 +test eq get Things 0 1 +test eq get Things 1 2 +test eq get Things 4 1 +test gt get Nm 2 0 +test eq get Inlen 0 n +same = true +for i ulong n +if ne get In i get Savedin i +same = false +end +end +test same +same = true +for i ulong len Wanted +if ne get Stext add get Sw 3 i get Wanted i +same = false +end +end +test same +test eq get Stext add get Sw 3 len Wanted 0 +load 1 +test scdecode +test eq get Sc 2 1 +test eq get Sc 3 0 +test eq get Nm 3 3 +same = true +for i ulong len Vis +if ne get Stext add get Sw 3 i get Vis i +same = false +end +end +test same +test eq get Stext add get Sw 3 len Vis 0 +load 2 +test scdecode +test eq get Nm 3 1 +test eq get Stext get Sw 3 83 +load 3 +test not scdecode +test eq get Sc 2 0 +test eq get Sc 3 0 +test eq get Nm 0 1 +load 4 +test scdecode +test eq get Sc 2 1 +test eq get Sc 3 0 +same = true +for i ulong len Hello +if ne get Stext add get Sw 3 i get Hello i +same = false +end +end +test same +load 5 +test scdecode +test eq get Sc 2 0 +test eq get Sc 3 1 +load 6 +test not scdecode +test eq get Sc 2 0 +test eq get Sc 3 0 +load 7 +test scdecode +test eq get Sc 0 1 +test eq get Sc 1 2 +test eq get Sc 2 0 +load 8 +test scdecode +test eq get Things 1 1 +put Inlen 0 160 +for i ulong 160 +put In i 120 +end +test not scdecode +test eq get Sc 2 0 +put Inlen 0 159 +test scdecode +test eq get Sc 2 1 +test eq get Stext add get Sw 3 159 0 +put Inlen 0 2049 +test not scdecode +test eq get Nm 6 1 +test eq get Sc 2 0 +test eq get Sc 3 0 +load 4 +put In 2 0 +test not scdecode +test eq get Nm 6 1 +test eq get In 2 0 +put Inlen 0 0 +test not scdecode +test eq get Sc 2 0 +put Inlen 0 len Nested +for i ulong len Nested +put In i get Nested i +end +test scdecode +test eq get Stext get Sw 3 78 +put Inlen 0 len Negative +for i ulong len Negative +put In i get Negative i +end +test scdecode +test eq get Stext get Sw 3 45 +note A thirteenth line cannot enable mood or plain fallback after twelve refusals. +for k ulong 12 +for i ulong len Invalid +put In add mul k len Invalid i get Invalid i +end +end +n = mul 12 len Invalid +for i ulong len Moodonly +put In add n i get Moodonly i +end +put Inlen 0 add n len Moodonly +test not scdecode +test eq get Sc 0 0 +test eq get Sc 7 1 +for i ulong len Plain +put In add n i get Plain i +end +put Inlen 0 add n len Plain +test not scdecode +test eq get Sc 2 0 +ret int get Fails 0 +end diff --git a/evidence/allen-omega-L694/L740/code.log b/evidence/allen-omega-L694/L740/code.log new file mode 100644 index 00000000..e7e197b7 --- /dev/null +++ b/evidence/allen-omega-L694/L740/code.log @@ -0,0 +1,23 @@ +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 diff --git a/evidence/allen-omega-L694/L740/counts.json b/evidence/allen-omega-L694/L740/counts.json new file mode 100644 index 00000000..6c1ee741 --- /dev/null +++ b/evidence/allen-omega-L694/L740/counts.json @@ -0,0 +1,33 @@ +{ + "checks": { + "runtime": 28, + "code": 23, + "courier": 24, + "scheduler": 213, + "application": 182, + "memory": 79, + "intent": 8, + "reply": 15, + "view": 13, + "scene": 14, + "scene-input": 63, + "paint": 11, + "edges": 352, + "short": 20, + "long": 292 + }, + "total": 1337, + "mutant_failures": { + "stale": 3, + "crc": 2, + "hash": 2, + "readback": 7, + "session": 1, + "keepalive": 40, + "ackstop": 27, + "pendingwire": 1, + "appcode": 3, + "thinking": 6, + "scenecap": 3 + } +} diff --git a/evidence/allen-omega-L694/L740/courier.log b/evidence/allen-omega-L694/L740/courier.log new file mode 100644 index 00000000..8402df49 --- /dev/null +++ b/evidence/allen-omega-L694/L740/courier.log @@ -0,0 +1,24 @@ +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 diff --git a/evidence/allen-omega-L694/L740/crc-mutant.log b/evidence/allen-omega-L694/L740/crc-mutant.log new file mode 100644 index 00000000..a0d90bd4 --- /dev/null +++ b/evidence/allen-omega-L694/L740/crc-mutant.log @@ -0,0 +1,23 @@ +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 1 +117 1 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 diff --git a/evidence/allen-omega-L694/L740/edges.log b/evidence/allen-omega-L694/L740/edges.log new file mode 100644 index 00000000..e8d0deea --- /dev/null +++ b/evidence/allen-omega-L694/L740/edges.log @@ -0,0 +1,352 @@ +1201 0 +1202 0 +1203 0 +1204 0 +1205 0 +1206 0 +1207 0 +1208 0 +1209 0 +1210 0 +1211 0 +1212 0 +1213 0 +1214 0 +1220 0 +1221 0 +1222 0 +1223 0 +1224 0 +1225 0 +1226 0 +1227 0 +1228 0 +1229 0 +1230 0 +1231 0 +1232 0 +1233 0 +1234 0 +1235 0 +1236 0 +1237 0 +1238 0 +1239 0 +1240 0 +1241 0 +1242 0 +1243 0 +1244 0 +1245 0 +1246 0 +1247 0 +1248 0 +1249 0 +1250 0 +1251 0 +1252 0 +1253 0 +1254 0 +1255 0 +1256 0 +1257 0 +1258 0 +1259 0 +1260 0 +1261 0 +1262 0 +1301 0 +1302 0 +1303 0 +1304 0 +1305 0 +1306 0 +1310 0 +1311 0 +1312 0 +1313 0 +1314 0 +1315 0 +1316 0 +1317 0 +1318 0 +1319 0 +1320 0 +1321 0 +1322 0 +1323 0 +1324 0 +1325 0 +1326 0 +1327 0 +1328 0 +1329 0 +1330 0 +1331 0 +1332 0 +1333 0 +1334 0 +1335 0 +1336 0 +1337 0 +1338 0 +1339 0 +1340 0 +1341 0 +1342 0 +1343 0 +1344 0 +1345 0 +1346 0 +1347 0 +1348 0 +1349 0 +1350 0 +1351 0 +1352 0 +1353 0 +1354 0 +1355 0 +1356 0 +1357 0 +1358 0 +1359 0 +1360 0 +1361 0 +1362 0 +1363 0 +1364 0 +1365 0 +1366 0 +1367 0 +1368 0 +1369 0 +1370 0 +1371 0 +1372 0 +1373 0 +1374 0 +1375 0 +1376 0 +1377 0 +1378 0 +1379 0 +1380 0 +1381 0 +1382 0 +1383 0 +1384 0 +1385 0 +1386 0 +1387 0 +1388 0 +1389 0 +1390 0 +1391 0 +1392 0 +1393 0 +1394 0 +1395 0 +1396 0 +1397 0 +1398 0 +1399 0 +1400 0 +1401 0 +1402 0 +1403 0 +1404 0 +1405 0 +1406 0 +1407 0 +1408 0 +1409 0 +1410 0 +1411 0 +1412 0 +1413 0 +1414 0 +1415 0 +1416 0 +1417 0 +1418 0 +1419 0 +1420 0 +1421 0 +1422 0 +1423 0 +1424 0 +1425 0 +1426 0 +1427 0 +1428 0 +1429 0 +1430 0 +1431 0 +1432 0 +1433 0 +1434 0 +1435 0 +1436 0 +1437 0 +1438 0 +1439 0 +1440 0 +1441 0 +1442 0 +1443 0 +1444 0 +1445 0 +1446 0 +1447 0 +1448 0 +1449 0 +1450 0 +1451 0 +1452 0 +1453 0 +1454 0 +1455 0 +1456 0 +1457 0 +1458 0 +1459 0 +1460 0 +1461 0 +1462 0 +1463 0 +1464 0 +1465 0 +1466 0 +1467 0 +1468 0 +1469 0 +1470 0 +1471 0 +1472 0 +1473 0 +1474 0 +1475 0 +1476 0 +1477 0 +1478 0 +1479 0 +1480 0 +1481 0 +1482 0 +1483 0 +1484 0 +1485 0 +1486 0 +1487 0 +1488 0 +1489 0 +1490 0 +1491 0 +1492 0 +1493 0 +1494 0 +1495 0 +1496 0 +1497 0 +1498 0 +1499 0 +1500 0 +1501 0 +1502 0 +1503 0 +1504 0 +1505 0 +1506 0 +1507 0 +1508 0 +1509 0 +1510 0 +1511 0 +1512 0 +1513 0 +1514 0 +1515 0 +1516 0 +1517 0 +1518 0 +1519 0 +1520 0 +1521 0 +1522 0 +1523 0 +1524 0 +1525 0 +1526 0 +1527 0 +1528 0 +1529 0 +1530 0 +1531 0 +1532 0 +1533 0 +1534 0 +1535 0 +1536 0 +1537 0 +1538 0 +1539 0 +1540 0 +1541 0 +1542 0 +1543 0 +1544 0 +1545 0 +1546 0 +1547 0 +1548 0 +1549 0 +1550 0 +1551 0 +1552 0 +1553 0 +1554 0 +1555 0 +1556 0 +1557 0 +1558 0 +1559 0 +1560 0 +1561 0 +1562 0 +1563 0 +1564 0 +1565 0 +1570 0 +1571 0 +1572 0 +1575 0 +1573 0 +1574 0 +1600 0 +1601 0 +1602 0 +1603 0 +1604 0 +1605 0 +1606 0 +1607 0 +1610 0 +1611 0 +1612 0 +1613 0 +1614 0 +1615 0 +1616 0 +1617 0 +1701 0 +1702 0 +1703 0 +1704 0 +1705 0 +1706 0 +1707 0 +1708 0 +1709 0 +1710 0 +1711 0 diff --git a/evidence/allen-omega-L694/L740/full.exit b/evidence/allen-omega-L694/L740/full.exit new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/L740/full.exit @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/L740/full.log b/evidence/allen-omega-L694/L740/full.log new file mode 100644 index 00000000..8d6f5639 --- /dev/null +++ b/evidence/allen-omega-L694/L740/full.log @@ -0,0 +1,30 @@ +runtime compile=0 native-exit=0 +code compile=0 native-exit=0 +courier compile=0 native-exit=0 +scheduler compile=0 native-exit=0 +application compile=0 native-exit=0 +memory compile=0 native-exit=0 +intent compile=0 native-exit=0 +reply compile=0 native-exit=0 +view compile=0 native-exit=0 +scene compile=0 native-exit=0 +scene-input compile=0 native-exit=0 +paint compile=0 native-exit=0 +edges compile=0 native-exit=0 +fixture compile=0 native-exit=0 +golden compile=0 native-exit=0 +render compile=0 native-exit=0 +stdio native-exit=0 golden-cmp=0 +stdio overflow native-exit=65 no-later-command=PASS +stale mutant compile=0 rejected-exit=3 +crc mutant compile=0 rejected-exit=2 +hash mutant compile=0 rejected-exit=2 +readback mutant compile=0 rejected-exit=7 +session mutant compile=0 rejected-exit=1 +keepalive mutant compile=0 rejected-exit=40 +ackstop mutant compile=0 rejected-exit=27 +pendingwire mutant compile=0 rejected-exit=1 +appcode mutant compile=0 rejected-exit=3 +thinking mutant compile=0 rejected-exit=6 +scenecap mutant compile=0 rejected-exit=3 +ALLEN_OMEGA_HOST: PASS; target=NOT_RUN; live=NOT_RUN diff --git a/evidence/allen-omega-L694/L740/hash-mutant.log b/evidence/allen-omega-L694/L740/hash-mutant.log new file mode 100644 index 00000000..c75cfefb --- /dev/null +++ b/evidence/allen-omega-L694/L740/hash-mutant.log @@ -0,0 +1,79 @@ +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 1 +310 1 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +362 0 +363 0 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 0 +361 0 diff --git a/evidence/allen-omega-L694/L740/independent-review/outputs/scene-independent-full.om b/evidence/allen-omega-L694/L740/independent-review/outputs/scene-independent-full.om new file mode 100644 index 00000000..903ff4fd --- /dev/null +++ b/evidence/allen-omega-L694/L740/independent-review/outputs/scene-independent-full.om @@ -0,0 +1,2923 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +text Thought "secret\nsay: hidden\n\nsay: KeEp My CASE\n" +text Bad "number: nope\n" +text Fallback "Plain words survive.\n" +global Saved uchar 2048 +fn test ok bool to void +check ok get Checks 0 +end +fn main to int +put Inlen 0 len Thought +for i ulong len Thought +put In i get Thought i +put Saved i get Thought i +end +test scdecode +test eq get Nm 3 2 +test eq get Sc 2 1 +same = true +for i ulong len Thought +if ne get In i get Saved i +same = false +end +end +test same +test eq get Inlen 0 len Thought +test eq get Stext get Sw 3 75 +put Inlen 0 len Bad +for i ulong len Bad +put In i get Bad i +end +test not scdecode +test eq get Sc 2 0 +test eq get Sc 3 0 +test eq get Nm 0 0 +test eq get Inlen 0 len Bad +for i ulong len Bad +test eq get In i get Bad i +end +put Inlen 0 len Fallback +for i ulong len Fallback +put In i get Fallback i +end +test scdecode +test eq get Sc 2 1 +test eq get Stext get Sw 3 80 +put Inlen 0 2048 +for i ulong 2048 +put In i 120 +end +test not scdecode +test eq get Nm 6 1 +test eq get Sc 2 0 +test eq get Sc 3 0 +test eq get Inlen 0 2048 +for i ulong 2048 +test eq get In i 120 +end +ret int get Fails 0 +end diff --git a/evidence/allen-omega-L694/L740/independent-review/outputs/scene-independent-v2.log b/evidence/allen-omega-L694/L740/independent-review/outputs/scene-independent-v2.log new file mode 100644 index 00000000..b980e71e --- /dev/null +++ b/evidence/allen-omega-L694/L740/independent-review/outputs/scene-independent-v2.log @@ -0,0 +1,2080 @@ +0 0 +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 +183 0 +184 0 +185 0 +186 0 +187 0 +188 0 +189 0 +190 0 +191 0 +192 0 +193 0 +194 0 +195 0 +196 0 +197 0 +198 0 +199 0 +200 0 +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 +225 0 +226 0 +227 0 +228 0 +229 0 +230 0 +231 0 +232 0 +233 0 +234 0 +235 0 +236 0 +237 0 +238 0 +239 0 +240 0 +241 0 +242 0 +243 0 +244 0 +245 0 +246 0 +247 0 +248 0 +249 0 +250 0 +251 0 +252 0 +253 0 +254 0 +255 0 +256 0 +257 0 +258 0 +259 0 +260 0 +261 0 +262 0 +263 0 +264 0 +265 0 +266 0 +267 0 +268 0 +269 0 +270 0 +271 0 +272 0 +273 0 +274 0 +275 0 +276 0 +277 0 +278 0 +279 0 +280 0 +281 0 +282 0 +283 0 +284 0 +285 0 +286 0 +287 0 +288 0 +289 0 +290 0 +291 0 +292 0 +293 0 +294 0 +295 0 +296 0 +297 0 +298 0 +299 0 +300 0 +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 0 +310 0 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +361 0 +362 0 +363 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 0 +380 0 +381 0 +382 0 +383 0 +384 0 +385 0 +386 0 +387 0 +388 0 +389 0 +390 0 +391 0 +392 0 +393 0 +394 0 +395 0 +396 0 +397 0 +398 0 +399 0 +400 0 +401 0 +402 0 +403 0 +404 0 +405 0 +406 0 +407 0 +408 0 +409 0 +410 0 +411 0 +412 0 +413 0 +414 0 +415 0 +416 0 +417 0 +418 0 +419 0 +420 0 +421 0 +422 0 +423 0 +424 0 +425 0 +426 0 +427 0 +428 0 +429 0 +430 0 +431 0 +432 0 +433 0 +434 0 +435 0 +436 0 +437 0 +438 0 +439 0 +440 0 +441 0 +442 0 +443 0 +444 0 +445 0 +446 0 +447 0 +448 0 +449 0 +450 0 +451 0 +452 0 +453 0 +454 0 +455 0 +456 0 +457 0 +458 0 +459 0 +460 0 +461 0 +462 0 +463 0 +464 0 +465 0 +466 0 +467 0 +468 0 +469 0 +470 0 +471 0 +472 0 +473 0 +474 0 +475 0 +476 0 +477 0 +478 0 +479 0 +480 0 +481 0 +482 0 +483 0 +484 0 +485 0 +486 0 +487 0 +488 0 +489 0 +490 0 +491 0 +492 0 +493 0 +494 0 +495 0 +496 0 +497 0 +498 0 +499 0 +500 0 +501 0 +502 0 +503 0 +504 0 +505 0 +506 0 +507 0 +508 0 +509 0 +510 0 +511 0 +512 0 +513 0 +514 0 +515 0 +516 0 +517 0 +518 0 +519 0 +520 0 +521 0 +522 0 +523 0 +524 0 +525 0 +526 0 +527 0 +528 0 +529 0 +530 0 +531 0 +532 0 +533 0 +534 0 +535 0 +536 0 +537 0 +538 0 +539 0 +540 0 +541 0 +542 0 +543 0 +544 0 +545 0 +546 0 +547 0 +548 0 +549 0 +550 0 +551 0 +552 0 +553 0 +554 0 +555 0 +556 0 +557 0 +558 0 +559 0 +560 0 +561 0 +562 0 +563 0 +564 0 +565 0 +566 0 +567 0 +568 0 +569 0 +570 0 +571 0 +572 0 +573 0 +574 0 +575 0 +576 0 +577 0 +578 0 +579 0 +580 0 +581 0 +582 0 +583 0 +584 0 +585 0 +586 0 +587 0 +588 0 +589 0 +590 0 +591 0 +592 0 +593 0 +594 0 +595 0 +596 0 +597 0 +598 0 +599 0 +600 0 +601 0 +602 0 +603 0 +604 0 +605 0 +606 0 +607 0 +608 0 +609 0 +610 0 +611 0 +612 0 +613 0 +614 0 +615 0 +616 0 +617 0 +618 0 +619 0 +620 0 +621 0 +622 0 +623 0 +624 0 +625 0 +626 0 +627 0 +628 0 +629 0 +630 0 +631 0 +632 0 +633 0 +634 0 +635 0 +636 0 +637 0 +638 0 +639 0 +640 0 +641 0 +642 0 +643 0 +644 0 +645 0 +646 0 +647 0 +648 0 +649 0 +650 0 +651 0 +652 0 +653 0 +654 0 +655 0 +656 0 +657 0 +658 0 +659 0 +660 0 +661 0 +662 0 +663 0 +664 0 +665 0 +666 0 +667 0 +668 0 +669 0 +670 0 +671 0 +672 0 +673 0 +674 0 +675 0 +676 0 +677 0 +678 0 +679 0 +680 0 +681 0 +682 0 +683 0 +684 0 +685 0 +686 0 +687 0 +688 0 +689 0 +690 0 +691 0 +692 0 +693 0 +694 0 +695 0 +696 0 +697 0 +698 0 +699 0 +700 0 +701 0 +702 0 +703 0 +704 0 +705 0 +706 0 +707 0 +708 0 +709 0 +710 0 +711 0 +712 0 +713 0 +714 0 +715 0 +716 0 +717 0 +718 0 +719 0 +720 0 +721 0 +722 0 +723 0 +724 0 +725 0 +726 0 +727 0 +728 0 +729 0 +730 0 +731 0 +732 0 +733 0 +734 0 +735 0 +736 0 +737 0 +738 0 +739 0 +740 0 +741 0 +742 0 +743 0 +744 0 +745 0 +746 0 +747 0 +748 0 +749 0 +750 0 +751 0 +752 0 +753 0 +754 0 +755 0 +756 0 +757 0 +758 0 +759 0 +760 0 +761 0 +762 0 +763 0 +764 0 +765 0 +766 0 +767 0 +768 0 +769 0 +770 0 +771 0 +772 0 +773 0 +774 0 +775 0 +776 0 +777 0 +778 0 +779 0 +780 0 +781 0 +782 0 +783 0 +784 0 +785 0 +786 0 +787 0 +788 0 +789 0 +790 0 +791 0 +792 0 +793 0 +794 0 +795 0 +796 0 +797 0 +798 0 +799 0 +800 0 +801 0 +802 0 +803 0 +804 0 +805 0 +806 0 +807 0 +808 0 +809 0 +810 0 +811 0 +812 0 +813 0 +814 0 +815 0 +816 0 +817 0 +818 0 +819 0 +820 0 +821 0 +822 0 +823 0 +824 0 +825 0 +826 0 +827 0 +828 0 +829 0 +830 0 +831 0 +832 0 +833 0 +834 0 +835 0 +836 0 +837 0 +838 0 +839 0 +840 0 +841 0 +842 0 +843 0 +844 0 +845 0 +846 0 +847 0 +848 0 +849 0 +850 0 +851 0 +852 0 +853 0 +854 0 +855 0 +856 0 +857 0 +858 0 +859 0 +860 0 +861 0 +862 0 +863 0 +864 0 +865 0 +866 0 +867 0 +868 0 +869 0 +870 0 +871 0 +872 0 +873 0 +874 0 +875 0 +876 0 +877 0 +878 0 +879 0 +880 0 +881 0 +882 0 +883 0 +884 0 +885 0 +886 0 +887 0 +888 0 +889 0 +890 0 +891 0 +892 0 +893 0 +894 0 +895 0 +896 0 +897 0 +898 0 +899 0 +900 0 +901 0 +902 0 +903 0 +904 0 +905 0 +906 0 +907 0 +908 0 +909 0 +910 0 +911 0 +912 0 +913 0 +914 0 +915 0 +916 0 +917 0 +918 0 +919 0 +920 0 +921 0 +922 0 +923 0 +924 0 +925 0 +926 0 +927 0 +928 0 +929 0 +930 0 +931 0 +932 0 +933 0 +934 0 +935 0 +936 0 +937 0 +938 0 +939 0 +940 0 +941 0 +942 0 +943 0 +944 0 +945 0 +946 0 +947 0 +948 0 +949 0 +950 0 +951 0 +952 0 +953 0 +954 0 +955 0 +956 0 +957 0 +958 0 +959 0 +960 0 +961 0 +962 0 +963 0 +964 0 +965 0 +966 0 +967 0 +968 0 +969 0 +970 0 +971 0 +972 0 +973 0 +974 0 +975 0 +976 0 +977 0 +978 0 +979 0 +980 0 +981 0 +982 0 +983 0 +984 0 +985 0 +986 0 +987 0 +988 0 +989 0 +990 0 +991 0 +992 0 +993 0 +994 0 +995 0 +996 0 +997 0 +998 0 +999 0 +1000 0 +1001 0 +1002 0 +1003 0 +1004 0 +1005 0 +1006 0 +1007 0 +1008 0 +1009 0 +1010 0 +1011 0 +1012 0 +1013 0 +1014 0 +1015 0 +1016 0 +1017 0 +1018 0 +1019 0 +1020 0 +1021 0 +1022 0 +1023 0 +1024 0 +1025 0 +1026 0 +1027 0 +1028 0 +1029 0 +1030 0 +1031 0 +1032 0 +1033 0 +1034 0 +1035 0 +1036 0 +1037 0 +1038 0 +1039 0 +1040 0 +1041 0 +1042 0 +1043 0 +1044 0 +1045 0 +1046 0 +1047 0 +1048 0 +1049 0 +1050 0 +1051 0 +1052 0 +1053 0 +1054 0 +1055 0 +1056 0 +1057 0 +1058 0 +1059 0 +1060 0 +1061 0 +1062 0 +1063 0 +1064 0 +1065 0 +1066 0 +1067 0 +1068 0 +1069 0 +1070 0 +1071 0 +1072 0 +1073 0 +1074 0 +1075 0 +1076 0 +1077 0 +1078 0 +1079 0 +1080 0 +1081 0 +1082 0 +1083 0 +1084 0 +1085 0 +1086 0 +1087 0 +1088 0 +1089 0 +1090 0 +1091 0 +1092 0 +1093 0 +1094 0 +1095 0 +1096 0 +1097 0 +1098 0 +1099 0 +1100 0 +1101 0 +1102 0 +1103 0 +1104 0 +1105 0 +1106 0 +1107 0 +1108 0 +1109 0 +1110 0 +1111 0 +1112 0 +1113 0 +1114 0 +1115 0 +1116 0 +1117 0 +1118 0 +1119 0 +1120 0 +1121 0 +1122 0 +1123 0 +1124 0 +1125 0 +1126 0 +1127 0 +1128 0 +1129 0 +1130 0 +1131 0 +1132 0 +1133 0 +1134 0 +1135 0 +1136 0 +1137 0 +1138 0 +1139 0 +1140 0 +1141 0 +1142 0 +1143 0 +1144 0 +1145 0 +1146 0 +1147 0 +1148 0 +1149 0 +1150 0 +1151 0 +1152 0 +1153 0 +1154 0 +1155 0 +1156 0 +1157 0 +1158 0 +1159 0 +1160 0 +1161 0 +1162 0 +1163 0 +1164 0 +1165 0 +1166 0 +1167 0 +1168 0 +1169 0 +1170 0 +1171 0 +1172 0 +1173 0 +1174 0 +1175 0 +1176 0 +1177 0 +1178 0 +1179 0 +1180 0 +1181 0 +1182 0 +1183 0 +1184 0 +1185 0 +1186 0 +1187 0 +1188 0 +1189 0 +1190 0 +1191 0 +1192 0 +1193 0 +1194 0 +1195 0 +1196 0 +1197 0 +1198 0 +1199 0 +1200 0 +1201 0 +1202 0 +1203 0 +1204 0 +1205 0 +1206 0 +1207 0 +1208 0 +1209 0 +1210 0 +1211 0 +1212 0 +1213 0 +1214 0 +1215 0 +1216 0 +1217 0 +1218 0 +1219 0 +1220 0 +1221 0 +1222 0 +1223 0 +1224 0 +1225 0 +1226 0 +1227 0 +1228 0 +1229 0 +1230 0 +1231 0 +1232 0 +1233 0 +1234 0 +1235 0 +1236 0 +1237 0 +1238 0 +1239 0 +1240 0 +1241 0 +1242 0 +1243 0 +1244 0 +1245 0 +1246 0 +1247 0 +1248 0 +1249 0 +1250 0 +1251 0 +1252 0 +1253 0 +1254 0 +1255 0 +1256 0 +1257 0 +1258 0 +1259 0 +1260 0 +1261 0 +1262 0 +1263 0 +1264 0 +1265 0 +1266 0 +1267 0 +1268 0 +1269 0 +1270 0 +1271 0 +1272 0 +1273 0 +1274 0 +1275 0 +1276 0 +1277 0 +1278 0 +1279 0 +1280 0 +1281 0 +1282 0 +1283 0 +1284 0 +1285 0 +1286 0 +1287 0 +1288 0 +1289 0 +1290 0 +1291 0 +1292 0 +1293 0 +1294 0 +1295 0 +1296 0 +1297 0 +1298 0 +1299 0 +1300 0 +1301 0 +1302 0 +1303 0 +1304 0 +1305 0 +1306 0 +1307 0 +1308 0 +1309 0 +1310 0 +1311 0 +1312 0 +1313 0 +1314 0 +1315 0 +1316 0 +1317 0 +1318 0 +1319 0 +1320 0 +1321 0 +1322 0 +1323 0 +1324 0 +1325 0 +1326 0 +1327 0 +1328 0 +1329 0 +1330 0 +1331 0 +1332 0 +1333 0 +1334 0 +1335 0 +1336 0 +1337 0 +1338 0 +1339 0 +1340 0 +1341 0 +1342 0 +1343 0 +1344 0 +1345 0 +1346 0 +1347 0 +1348 0 +1349 0 +1350 0 +1351 0 +1352 0 +1353 0 +1354 0 +1355 0 +1356 0 +1357 0 +1358 0 +1359 0 +1360 0 +1361 0 +1362 0 +1363 0 +1364 0 +1365 0 +1366 0 +1367 0 +1368 0 +1369 0 +1370 0 +1371 0 +1372 0 +1373 0 +1374 0 +1375 0 +1376 0 +1377 0 +1378 0 +1379 0 +1380 0 +1381 0 +1382 0 +1383 0 +1384 0 +1385 0 +1386 0 +1387 0 +1388 0 +1389 0 +1390 0 +1391 0 +1392 0 +1393 0 +1394 0 +1395 0 +1396 0 +1397 0 +1398 0 +1399 0 +1400 0 +1401 0 +1402 0 +1403 0 +1404 0 +1405 0 +1406 0 +1407 0 +1408 0 +1409 0 +1410 0 +1411 0 +1412 0 +1413 0 +1414 0 +1415 0 +1416 0 +1417 0 +1418 0 +1419 0 +1420 0 +1421 0 +1422 0 +1423 0 +1424 0 +1425 0 +1426 0 +1427 0 +1428 0 +1429 0 +1430 0 +1431 0 +1432 0 +1433 0 +1434 0 +1435 0 +1436 0 +1437 0 +1438 0 +1439 0 +1440 0 +1441 0 +1442 0 +1443 0 +1444 0 +1445 0 +1446 0 +1447 0 +1448 0 +1449 0 +1450 0 +1451 0 +1452 0 +1453 0 +1454 0 +1455 0 +1456 0 +1457 0 +1458 0 +1459 0 +1460 0 +1461 0 +1462 0 +1463 0 +1464 0 +1465 0 +1466 0 +1467 0 +1468 0 +1469 0 +1470 0 +1471 0 +1472 0 +1473 0 +1474 0 +1475 0 +1476 0 +1477 0 +1478 0 +1479 0 +1480 0 +1481 0 +1482 0 +1483 0 +1484 0 +1485 0 +1486 0 +1487 0 +1488 0 +1489 0 +1490 0 +1491 0 +1492 0 +1493 0 +1494 0 +1495 0 +1496 0 +1497 0 +1498 0 +1499 0 +1500 0 +1501 0 +1502 0 +1503 0 +1504 0 +1505 0 +1506 0 +1507 0 +1508 0 +1509 0 +1510 0 +1511 0 +1512 0 +1513 0 +1514 0 +1515 0 +1516 0 +1517 0 +1518 0 +1519 0 +1520 0 +1521 0 +1522 0 +1523 0 +1524 0 +1525 0 +1526 0 +1527 0 +1528 0 +1529 0 +1530 0 +1531 0 +1532 0 +1533 0 +1534 0 +1535 0 +1536 0 +1537 0 +1538 0 +1539 0 +1540 0 +1541 0 +1542 0 +1543 0 +1544 0 +1545 0 +1546 0 +1547 0 +1548 0 +1549 0 +1550 0 +1551 0 +1552 0 +1553 0 +1554 0 +1555 0 +1556 0 +1557 0 +1558 0 +1559 0 +1560 0 +1561 0 +1562 0 +1563 0 +1564 0 +1565 0 +1566 0 +1567 0 +1568 0 +1569 0 +1570 0 +1571 0 +1572 0 +1573 0 +1574 0 +1575 0 +1576 0 +1577 0 +1578 0 +1579 0 +1580 0 +1581 0 +1582 0 +1583 0 +1584 0 +1585 0 +1586 0 +1587 0 +1588 0 +1589 0 +1590 0 +1591 0 +1592 0 +1593 0 +1594 0 +1595 0 +1596 0 +1597 0 +1598 0 +1599 0 +1600 0 +1601 0 +1602 0 +1603 0 +1604 0 +1605 0 +1606 0 +1607 0 +1608 0 +1609 0 +1610 0 +1611 0 +1612 0 +1613 0 +1614 0 +1615 0 +1616 0 +1617 0 +1618 0 +1619 0 +1620 0 +1621 0 +1622 0 +1623 0 +1624 0 +1625 0 +1626 0 +1627 0 +1628 0 +1629 0 +1630 0 +1631 0 +1632 0 +1633 0 +1634 0 +1635 0 +1636 0 +1637 0 +1638 0 +1639 0 +1640 0 +1641 0 +1642 0 +1643 0 +1644 0 +1645 0 +1646 0 +1647 0 +1648 0 +1649 0 +1650 0 +1651 0 +1652 0 +1653 0 +1654 0 +1655 0 +1656 0 +1657 0 +1658 0 +1659 0 +1660 0 +1661 0 +1662 0 +1663 0 +1664 0 +1665 0 +1666 0 +1667 0 +1668 0 +1669 0 +1670 0 +1671 0 +1672 0 +1673 0 +1674 0 +1675 0 +1676 0 +1677 0 +1678 0 +1679 0 +1680 0 +1681 0 +1682 0 +1683 0 +1684 0 +1685 0 +1686 0 +1687 0 +1688 0 +1689 0 +1690 0 +1691 0 +1692 0 +1693 0 +1694 0 +1695 0 +1696 0 +1697 0 +1698 0 +1699 0 +1700 0 +1701 0 +1702 0 +1703 0 +1704 0 +1705 0 +1706 0 +1707 0 +1708 0 +1709 0 +1710 0 +1711 0 +1712 0 +1713 0 +1714 0 +1715 0 +1716 0 +1717 0 +1718 0 +1719 0 +1720 0 +1721 0 +1722 0 +1723 0 +1724 0 +1725 0 +1726 0 +1727 0 +1728 0 +1729 0 +1730 0 +1731 0 +1732 0 +1733 0 +1734 0 +1735 0 +1736 0 +1737 0 +1738 0 +1739 0 +1740 0 +1741 0 +1742 0 +1743 0 +1744 0 +1745 0 +1746 0 +1747 0 +1748 0 +1749 0 +1750 0 +1751 0 +1752 0 +1753 0 +1754 0 +1755 0 +1756 0 +1757 0 +1758 0 +1759 0 +1760 0 +1761 0 +1762 0 +1763 0 +1764 0 +1765 0 +1766 0 +1767 0 +1768 0 +1769 0 +1770 0 +1771 0 +1772 0 +1773 0 +1774 0 +1775 0 +1776 0 +1777 0 +1778 0 +1779 0 +1780 0 +1781 0 +1782 0 +1783 0 +1784 0 +1785 0 +1786 0 +1787 0 +1788 0 +1789 0 +1790 0 +1791 0 +1792 0 +1793 0 +1794 0 +1795 0 +1796 0 +1797 0 +1798 0 +1799 0 +1800 0 +1801 0 +1802 0 +1803 0 +1804 0 +1805 0 +1806 0 +1807 0 +1808 0 +1809 0 +1810 0 +1811 0 +1812 0 +1813 0 +1814 0 +1815 0 +1816 0 +1817 0 +1818 0 +1819 0 +1820 0 +1821 0 +1822 0 +1823 0 +1824 0 +1825 0 +1826 0 +1827 0 +1828 0 +1829 0 +1830 0 +1831 0 +1832 0 +1833 0 +1834 0 +1835 0 +1836 0 +1837 0 +1838 0 +1839 0 +1840 0 +1841 0 +1842 0 +1843 0 +1844 0 +1845 0 +1846 0 +1847 0 +1848 0 +1849 0 +1850 0 +1851 0 +1852 0 +1853 0 +1854 0 +1855 0 +1856 0 +1857 0 +1858 0 +1859 0 +1860 0 +1861 0 +1862 0 +1863 0 +1864 0 +1865 0 +1866 0 +1867 0 +1868 0 +1869 0 +1870 0 +1871 0 +1872 0 +1873 0 +1874 0 +1875 0 +1876 0 +1877 0 +1878 0 +1879 0 +1880 0 +1881 0 +1882 0 +1883 0 +1884 0 +1885 0 +1886 0 +1887 0 +1888 0 +1889 0 +1890 0 +1891 0 +1892 0 +1893 0 +1894 0 +1895 0 +1896 0 +1897 0 +1898 0 +1899 0 +1900 0 +1901 0 +1902 0 +1903 0 +1904 0 +1905 0 +1906 0 +1907 0 +1908 0 +1909 0 +1910 0 +1911 0 +1912 0 +1913 0 +1914 0 +1915 0 +1916 0 +1917 0 +1918 0 +1919 0 +1920 0 +1921 0 +1922 0 +1923 0 +1924 0 +1925 0 +1926 0 +1927 0 +1928 0 +1929 0 +1930 0 +1931 0 +1932 0 +1933 0 +1934 0 +1935 0 +1936 0 +1937 0 +1938 0 +1939 0 +1940 0 +1941 0 +1942 0 +1943 0 +1944 0 +1945 0 +1946 0 +1947 0 +1948 0 +1949 0 +1950 0 +1951 0 +1952 0 +1953 0 +1954 0 +1955 0 +1956 0 +1957 0 +1958 0 +1959 0 +1960 0 +1961 0 +1962 0 +1963 0 +1964 0 +1965 0 +1966 0 +1967 0 +1968 0 +1969 0 +1970 0 +1971 0 +1972 0 +1973 0 +1974 0 +1975 0 +1976 0 +1977 0 +1978 0 +1979 0 +1980 0 +1981 0 +1982 0 +1983 0 +1984 0 +1985 0 +1986 0 +1987 0 +1988 0 +1989 0 +1990 0 +1991 0 +1992 0 +1993 0 +1994 0 +1995 0 +1996 0 +1997 0 +1998 0 +1999 0 +2000 0 +2001 0 +2002 0 +2003 0 +2004 0 +2005 0 +2006 0 +2007 0 +2008 0 +2009 0 +2010 0 +2011 0 +2012 0 +2013 0 +2014 0 +2015 0 +2016 0 +2017 0 +2018 0 +2019 0 +2020 0 +2021 0 +2022 0 +2023 0 +2024 0 +2025 0 +2026 0 +2027 0 +2028 0 +2029 0 +2030 0 +2031 0 +2032 0 +2033 0 +2034 0 +2035 0 +2036 0 +2037 0 +2038 0 +2039 0 +2040 0 +2041 0 +2042 0 +2043 0 +2044 0 +2045 0 +2046 0 +2047 0 +2048 0 +2049 0 +2050 0 +2051 0 +2052 0 +2053 0 +2054 0 +2055 0 +2056 0 +2057 0 +2058 0 +2059 0 +2060 0 +2061 0 +2062 0 +2063 0 +2064 0 +2065 0 +2066 0 +2067 0 +2068 0 +2069 0 +2070 0 +2071 0 +2072 0 +2073 0 +2074 0 +2075 0 +2076 0 +2077 0 +2078 0 +2079 0 diff --git a/evidence/allen-omega-L694/L740/independent-review/outputs/scene-independent-v2.om b/evidence/allen-omega-L694/L740/independent-review/outputs/scene-independent-v2.om new file mode 100644 index 00000000..a76a572a --- /dev/null +++ b/evidence/allen-omega-L694/L740/independent-review/outputs/scene-independent-v2.om @@ -0,0 +1,2923 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +text Thought "secret\nsay: hidden\n\nsay: KeEp My CASE\n" +text Bad "number: nope\n" +text Fallback "Plain words survive.\n" +global Saved uchar 2048 +fn test ok bool to void +check ok get Checks 0 +end +fn main to int +put Inlen 0 len Thought +for i ulong len Thought +put In i get Thought i +put Saved i get Thought i +end +test scdecode +test eq get Nm 3 3 +test eq get Sc 2 1 +same = true +for i ulong len Thought +if ne get In i get Saved i +same = false +end +end +test same +test eq get Inlen 0 len Thought +test eq get Stext get Sw 3 75 +put Inlen 0 len Bad +for i ulong len Bad +put In i get Bad i +end +test not scdecode +test eq get Sc 2 0 +test eq get Sc 3 0 +test eq get Nm 0 0 +test eq get Inlen 0 len Bad +for i ulong len Bad +test eq get In i get Bad i +end +put Inlen 0 len Fallback +for i ulong len Fallback +put In i get Fallback i +end +test scdecode +test eq get Sc 2 1 +test eq get Stext get Sw 3 80 +put Inlen 0 2048 +for i ulong 2048 +put In i 120 +end +test not scdecode +test eq get Nm 6 1 +test eq get Sc 2 0 +test eq get Sc 3 0 +test eq get Inlen 0 2048 +for i ulong 2048 +test eq get In i 120 +end +ret int get Fails 0 +end diff --git a/evidence/allen-omega-L694/L740/independent-review/outputs/scene-independent-v3.full.om b/evidence/allen-omega-L694/L740/independent-review/outputs/scene-independent-v3.full.om new file mode 100644 index 00000000..7955c036 --- /dev/null +++ b/evidence/allen-omega-L694/L740/independent-review/outputs/scene-independent-v3.full.om @@ -0,0 +1,2931 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +text Thought "secret\nsay: hidden\n\nsay: KeEp My CASE\n" +text Bad "number: nope\n" +text Fallback "Plain words survive.\n" +global Saved uchar 2048 +fn test ok bool to void +check ok get Checks 0 +end +fn main to int +put Inlen 0 len Thought +for i ulong len Thought +put In i get Thought i +put Saved i get Thought i +end +test scdecode +test eq get Nm 3 3 +test eq get Sc 2 1 +same = true +for i ulong len Thought +if ne get In i get Saved i +same = false +end +end +test same +test eq get Inlen 0 len Thought +test eq get Stext get Sw 3 75 +put Inlen 0 len Bad +for i ulong len Bad +put In i get Bad i +end +test not scdecode +test eq get Sc 2 0 +test eq get Sc 3 0 +test eq get Nm 0 0 +test eq get Inlen 0 len Bad +for i ulong len Bad +test eq get In i get Bad i +end +put Inlen 0 len Fallback +for i ulong len Fallback +put In i get Fallback i +end +test scdecode +test eq get Sc 2 1 +test eq get Stext get Sw 3 80 +put Inlen 0 2047 +for i ulong 2047 +put In i 120 +end +test not scdecode +test eq get Nm 6 0 +test eq get Nm 1 2048 +test eq get Inlen 0 2047 +put Inlen 0 2048 +for i ulong 2048 +put In i 120 +end +test not scdecode +test eq get Nm 6 1 +test eq get Sc 2 0 +test eq get Sc 3 0 +test eq get Inlen 0 2048 +for i ulong 2048 +test eq get In i 120 +end +ret int get Fails 0 +end diff --git a/evidence/allen-omega-L694/L740/independent-review/outputs/scene-independent-v3.log b/evidence/allen-omega-L694/L740/independent-review/outputs/scene-independent-v3.log new file mode 100644 index 00000000..0a9fc972 --- /dev/null +++ b/evidence/allen-omega-L694/L740/independent-review/outputs/scene-independent-v3.log @@ -0,0 +1,2084 @@ +0 0 +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 +183 0 +184 0 +185 0 +186 0 +187 0 +188 0 +189 0 +190 0 +191 0 +192 0 +193 0 +194 0 +195 0 +196 0 +197 0 +198 0 +199 0 +200 0 +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 +225 0 +226 0 +227 0 +228 0 +229 0 +230 0 +231 0 +232 0 +233 0 +234 0 +235 0 +236 0 +237 0 +238 0 +239 0 +240 0 +241 0 +242 0 +243 0 +244 0 +245 0 +246 0 +247 0 +248 0 +249 0 +250 0 +251 0 +252 0 +253 0 +254 0 +255 0 +256 0 +257 0 +258 0 +259 0 +260 0 +261 0 +262 0 +263 0 +264 0 +265 0 +266 0 +267 0 +268 0 +269 0 +270 0 +271 0 +272 0 +273 0 +274 0 +275 0 +276 0 +277 0 +278 0 +279 0 +280 0 +281 0 +282 0 +283 0 +284 0 +285 0 +286 0 +287 0 +288 0 +289 0 +290 0 +291 0 +292 0 +293 0 +294 0 +295 0 +296 0 +297 0 +298 0 +299 0 +300 0 +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 0 +310 0 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +361 0 +362 0 +363 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 0 +380 0 +381 0 +382 0 +383 0 +384 0 +385 0 +386 0 +387 0 +388 0 +389 0 +390 0 +391 0 +392 0 +393 0 +394 0 +395 0 +396 0 +397 0 +398 0 +399 0 +400 0 +401 0 +402 0 +403 0 +404 0 +405 0 +406 0 +407 0 +408 0 +409 0 +410 0 +411 0 +412 0 +413 0 +414 0 +415 0 +416 0 +417 0 +418 0 +419 0 +420 0 +421 0 +422 0 +423 0 +424 0 +425 0 +426 0 +427 0 +428 0 +429 0 +430 0 +431 0 +432 0 +433 0 +434 0 +435 0 +436 0 +437 0 +438 0 +439 0 +440 0 +441 0 +442 0 +443 0 +444 0 +445 0 +446 0 +447 0 +448 0 +449 0 +450 0 +451 0 +452 0 +453 0 +454 0 +455 0 +456 0 +457 0 +458 0 +459 0 +460 0 +461 0 +462 0 +463 0 +464 0 +465 0 +466 0 +467 0 +468 0 +469 0 +470 0 +471 0 +472 0 +473 0 +474 0 +475 0 +476 0 +477 0 +478 0 +479 0 +480 0 +481 0 +482 0 +483 0 +484 0 +485 0 +486 0 +487 0 +488 0 +489 0 +490 0 +491 0 +492 0 +493 0 +494 0 +495 0 +496 0 +497 0 +498 0 +499 0 +500 0 +501 0 +502 0 +503 0 +504 0 +505 0 +506 0 +507 0 +508 0 +509 0 +510 0 +511 0 +512 0 +513 0 +514 0 +515 0 +516 0 +517 0 +518 0 +519 0 +520 0 +521 0 +522 0 +523 0 +524 0 +525 0 +526 0 +527 0 +528 0 +529 0 +530 0 +531 0 +532 0 +533 0 +534 0 +535 0 +536 0 +537 0 +538 0 +539 0 +540 0 +541 0 +542 0 +543 0 +544 0 +545 0 +546 0 +547 0 +548 0 +549 0 +550 0 +551 0 +552 0 +553 0 +554 0 +555 0 +556 0 +557 0 +558 0 +559 0 +560 0 +561 0 +562 0 +563 0 +564 0 +565 0 +566 0 +567 0 +568 0 +569 0 +570 0 +571 0 +572 0 +573 0 +574 0 +575 0 +576 0 +577 0 +578 0 +579 0 +580 0 +581 0 +582 0 +583 0 +584 0 +585 0 +586 0 +587 0 +588 0 +589 0 +590 0 +591 0 +592 0 +593 0 +594 0 +595 0 +596 0 +597 0 +598 0 +599 0 +600 0 +601 0 +602 0 +603 0 +604 0 +605 0 +606 0 +607 0 +608 0 +609 0 +610 0 +611 0 +612 0 +613 0 +614 0 +615 0 +616 0 +617 0 +618 0 +619 0 +620 0 +621 0 +622 0 +623 0 +624 0 +625 0 +626 0 +627 0 +628 0 +629 0 +630 0 +631 0 +632 0 +633 0 +634 0 +635 0 +636 0 +637 0 +638 0 +639 0 +640 0 +641 0 +642 0 +643 0 +644 0 +645 0 +646 0 +647 0 +648 0 +649 0 +650 0 +651 0 +652 0 +653 0 +654 0 +655 0 +656 0 +657 0 +658 0 +659 0 +660 0 +661 0 +662 0 +663 0 +664 0 +665 0 +666 0 +667 0 +668 0 +669 0 +670 0 +671 0 +672 0 +673 0 +674 0 +675 0 +676 0 +677 0 +678 0 +679 0 +680 0 +681 0 +682 0 +683 0 +684 0 +685 0 +686 0 +687 0 +688 0 +689 0 +690 0 +691 0 +692 0 +693 0 +694 0 +695 0 +696 0 +697 0 +698 0 +699 0 +700 0 +701 0 +702 0 +703 0 +704 0 +705 0 +706 0 +707 0 +708 0 +709 0 +710 0 +711 0 +712 0 +713 0 +714 0 +715 0 +716 0 +717 0 +718 0 +719 0 +720 0 +721 0 +722 0 +723 0 +724 0 +725 0 +726 0 +727 0 +728 0 +729 0 +730 0 +731 0 +732 0 +733 0 +734 0 +735 0 +736 0 +737 0 +738 0 +739 0 +740 0 +741 0 +742 0 +743 0 +744 0 +745 0 +746 0 +747 0 +748 0 +749 0 +750 0 +751 0 +752 0 +753 0 +754 0 +755 0 +756 0 +757 0 +758 0 +759 0 +760 0 +761 0 +762 0 +763 0 +764 0 +765 0 +766 0 +767 0 +768 0 +769 0 +770 0 +771 0 +772 0 +773 0 +774 0 +775 0 +776 0 +777 0 +778 0 +779 0 +780 0 +781 0 +782 0 +783 0 +784 0 +785 0 +786 0 +787 0 +788 0 +789 0 +790 0 +791 0 +792 0 +793 0 +794 0 +795 0 +796 0 +797 0 +798 0 +799 0 +800 0 +801 0 +802 0 +803 0 +804 0 +805 0 +806 0 +807 0 +808 0 +809 0 +810 0 +811 0 +812 0 +813 0 +814 0 +815 0 +816 0 +817 0 +818 0 +819 0 +820 0 +821 0 +822 0 +823 0 +824 0 +825 0 +826 0 +827 0 +828 0 +829 0 +830 0 +831 0 +832 0 +833 0 +834 0 +835 0 +836 0 +837 0 +838 0 +839 0 +840 0 +841 0 +842 0 +843 0 +844 0 +845 0 +846 0 +847 0 +848 0 +849 0 +850 0 +851 0 +852 0 +853 0 +854 0 +855 0 +856 0 +857 0 +858 0 +859 0 +860 0 +861 0 +862 0 +863 0 +864 0 +865 0 +866 0 +867 0 +868 0 +869 0 +870 0 +871 0 +872 0 +873 0 +874 0 +875 0 +876 0 +877 0 +878 0 +879 0 +880 0 +881 0 +882 0 +883 0 +884 0 +885 0 +886 0 +887 0 +888 0 +889 0 +890 0 +891 0 +892 0 +893 0 +894 0 +895 0 +896 0 +897 0 +898 0 +899 0 +900 0 +901 0 +902 0 +903 0 +904 0 +905 0 +906 0 +907 0 +908 0 +909 0 +910 0 +911 0 +912 0 +913 0 +914 0 +915 0 +916 0 +917 0 +918 0 +919 0 +920 0 +921 0 +922 0 +923 0 +924 0 +925 0 +926 0 +927 0 +928 0 +929 0 +930 0 +931 0 +932 0 +933 0 +934 0 +935 0 +936 0 +937 0 +938 0 +939 0 +940 0 +941 0 +942 0 +943 0 +944 0 +945 0 +946 0 +947 0 +948 0 +949 0 +950 0 +951 0 +952 0 +953 0 +954 0 +955 0 +956 0 +957 0 +958 0 +959 0 +960 0 +961 0 +962 0 +963 0 +964 0 +965 0 +966 0 +967 0 +968 0 +969 0 +970 0 +971 0 +972 0 +973 0 +974 0 +975 0 +976 0 +977 0 +978 0 +979 0 +980 0 +981 0 +982 0 +983 0 +984 0 +985 0 +986 0 +987 0 +988 0 +989 0 +990 0 +991 0 +992 0 +993 0 +994 0 +995 0 +996 0 +997 0 +998 0 +999 0 +1000 0 +1001 0 +1002 0 +1003 0 +1004 0 +1005 0 +1006 0 +1007 0 +1008 0 +1009 0 +1010 0 +1011 0 +1012 0 +1013 0 +1014 0 +1015 0 +1016 0 +1017 0 +1018 0 +1019 0 +1020 0 +1021 0 +1022 0 +1023 0 +1024 0 +1025 0 +1026 0 +1027 0 +1028 0 +1029 0 +1030 0 +1031 0 +1032 0 +1033 0 +1034 0 +1035 0 +1036 0 +1037 0 +1038 0 +1039 0 +1040 0 +1041 0 +1042 0 +1043 0 +1044 0 +1045 0 +1046 0 +1047 0 +1048 0 +1049 0 +1050 0 +1051 0 +1052 0 +1053 0 +1054 0 +1055 0 +1056 0 +1057 0 +1058 0 +1059 0 +1060 0 +1061 0 +1062 0 +1063 0 +1064 0 +1065 0 +1066 0 +1067 0 +1068 0 +1069 0 +1070 0 +1071 0 +1072 0 +1073 0 +1074 0 +1075 0 +1076 0 +1077 0 +1078 0 +1079 0 +1080 0 +1081 0 +1082 0 +1083 0 +1084 0 +1085 0 +1086 0 +1087 0 +1088 0 +1089 0 +1090 0 +1091 0 +1092 0 +1093 0 +1094 0 +1095 0 +1096 0 +1097 0 +1098 0 +1099 0 +1100 0 +1101 0 +1102 0 +1103 0 +1104 0 +1105 0 +1106 0 +1107 0 +1108 0 +1109 0 +1110 0 +1111 0 +1112 0 +1113 0 +1114 0 +1115 0 +1116 0 +1117 0 +1118 0 +1119 0 +1120 0 +1121 0 +1122 0 +1123 0 +1124 0 +1125 0 +1126 0 +1127 0 +1128 0 +1129 0 +1130 0 +1131 0 +1132 0 +1133 0 +1134 0 +1135 0 +1136 0 +1137 0 +1138 0 +1139 0 +1140 0 +1141 0 +1142 0 +1143 0 +1144 0 +1145 0 +1146 0 +1147 0 +1148 0 +1149 0 +1150 0 +1151 0 +1152 0 +1153 0 +1154 0 +1155 0 +1156 0 +1157 0 +1158 0 +1159 0 +1160 0 +1161 0 +1162 0 +1163 0 +1164 0 +1165 0 +1166 0 +1167 0 +1168 0 +1169 0 +1170 0 +1171 0 +1172 0 +1173 0 +1174 0 +1175 0 +1176 0 +1177 0 +1178 0 +1179 0 +1180 0 +1181 0 +1182 0 +1183 0 +1184 0 +1185 0 +1186 0 +1187 0 +1188 0 +1189 0 +1190 0 +1191 0 +1192 0 +1193 0 +1194 0 +1195 0 +1196 0 +1197 0 +1198 0 +1199 0 +1200 0 +1201 0 +1202 0 +1203 0 +1204 0 +1205 0 +1206 0 +1207 0 +1208 0 +1209 0 +1210 0 +1211 0 +1212 0 +1213 0 +1214 0 +1215 0 +1216 0 +1217 0 +1218 0 +1219 0 +1220 0 +1221 0 +1222 0 +1223 0 +1224 0 +1225 0 +1226 0 +1227 0 +1228 0 +1229 0 +1230 0 +1231 0 +1232 0 +1233 0 +1234 0 +1235 0 +1236 0 +1237 0 +1238 0 +1239 0 +1240 0 +1241 0 +1242 0 +1243 0 +1244 0 +1245 0 +1246 0 +1247 0 +1248 0 +1249 0 +1250 0 +1251 0 +1252 0 +1253 0 +1254 0 +1255 0 +1256 0 +1257 0 +1258 0 +1259 0 +1260 0 +1261 0 +1262 0 +1263 0 +1264 0 +1265 0 +1266 0 +1267 0 +1268 0 +1269 0 +1270 0 +1271 0 +1272 0 +1273 0 +1274 0 +1275 0 +1276 0 +1277 0 +1278 0 +1279 0 +1280 0 +1281 0 +1282 0 +1283 0 +1284 0 +1285 0 +1286 0 +1287 0 +1288 0 +1289 0 +1290 0 +1291 0 +1292 0 +1293 0 +1294 0 +1295 0 +1296 0 +1297 0 +1298 0 +1299 0 +1300 0 +1301 0 +1302 0 +1303 0 +1304 0 +1305 0 +1306 0 +1307 0 +1308 0 +1309 0 +1310 0 +1311 0 +1312 0 +1313 0 +1314 0 +1315 0 +1316 0 +1317 0 +1318 0 +1319 0 +1320 0 +1321 0 +1322 0 +1323 0 +1324 0 +1325 0 +1326 0 +1327 0 +1328 0 +1329 0 +1330 0 +1331 0 +1332 0 +1333 0 +1334 0 +1335 0 +1336 0 +1337 0 +1338 0 +1339 0 +1340 0 +1341 0 +1342 0 +1343 0 +1344 0 +1345 0 +1346 0 +1347 0 +1348 0 +1349 0 +1350 0 +1351 0 +1352 0 +1353 0 +1354 0 +1355 0 +1356 0 +1357 0 +1358 0 +1359 0 +1360 0 +1361 0 +1362 0 +1363 0 +1364 0 +1365 0 +1366 0 +1367 0 +1368 0 +1369 0 +1370 0 +1371 0 +1372 0 +1373 0 +1374 0 +1375 0 +1376 0 +1377 0 +1378 0 +1379 0 +1380 0 +1381 0 +1382 0 +1383 0 +1384 0 +1385 0 +1386 0 +1387 0 +1388 0 +1389 0 +1390 0 +1391 0 +1392 0 +1393 0 +1394 0 +1395 0 +1396 0 +1397 0 +1398 0 +1399 0 +1400 0 +1401 0 +1402 0 +1403 0 +1404 0 +1405 0 +1406 0 +1407 0 +1408 0 +1409 0 +1410 0 +1411 0 +1412 0 +1413 0 +1414 0 +1415 0 +1416 0 +1417 0 +1418 0 +1419 0 +1420 0 +1421 0 +1422 0 +1423 0 +1424 0 +1425 0 +1426 0 +1427 0 +1428 0 +1429 0 +1430 0 +1431 0 +1432 0 +1433 0 +1434 0 +1435 0 +1436 0 +1437 0 +1438 0 +1439 0 +1440 0 +1441 0 +1442 0 +1443 0 +1444 0 +1445 0 +1446 0 +1447 0 +1448 0 +1449 0 +1450 0 +1451 0 +1452 0 +1453 0 +1454 0 +1455 0 +1456 0 +1457 0 +1458 0 +1459 0 +1460 0 +1461 0 +1462 0 +1463 0 +1464 0 +1465 0 +1466 0 +1467 0 +1468 0 +1469 0 +1470 0 +1471 0 +1472 0 +1473 0 +1474 0 +1475 0 +1476 0 +1477 0 +1478 0 +1479 0 +1480 0 +1481 0 +1482 0 +1483 0 +1484 0 +1485 0 +1486 0 +1487 0 +1488 0 +1489 0 +1490 0 +1491 0 +1492 0 +1493 0 +1494 0 +1495 0 +1496 0 +1497 0 +1498 0 +1499 0 +1500 0 +1501 0 +1502 0 +1503 0 +1504 0 +1505 0 +1506 0 +1507 0 +1508 0 +1509 0 +1510 0 +1511 0 +1512 0 +1513 0 +1514 0 +1515 0 +1516 0 +1517 0 +1518 0 +1519 0 +1520 0 +1521 0 +1522 0 +1523 0 +1524 0 +1525 0 +1526 0 +1527 0 +1528 0 +1529 0 +1530 0 +1531 0 +1532 0 +1533 0 +1534 0 +1535 0 +1536 0 +1537 0 +1538 0 +1539 0 +1540 0 +1541 0 +1542 0 +1543 0 +1544 0 +1545 0 +1546 0 +1547 0 +1548 0 +1549 0 +1550 0 +1551 0 +1552 0 +1553 0 +1554 0 +1555 0 +1556 0 +1557 0 +1558 0 +1559 0 +1560 0 +1561 0 +1562 0 +1563 0 +1564 0 +1565 0 +1566 0 +1567 0 +1568 0 +1569 0 +1570 0 +1571 0 +1572 0 +1573 0 +1574 0 +1575 0 +1576 0 +1577 0 +1578 0 +1579 0 +1580 0 +1581 0 +1582 0 +1583 0 +1584 0 +1585 0 +1586 0 +1587 0 +1588 0 +1589 0 +1590 0 +1591 0 +1592 0 +1593 0 +1594 0 +1595 0 +1596 0 +1597 0 +1598 0 +1599 0 +1600 0 +1601 0 +1602 0 +1603 0 +1604 0 +1605 0 +1606 0 +1607 0 +1608 0 +1609 0 +1610 0 +1611 0 +1612 0 +1613 0 +1614 0 +1615 0 +1616 0 +1617 0 +1618 0 +1619 0 +1620 0 +1621 0 +1622 0 +1623 0 +1624 0 +1625 0 +1626 0 +1627 0 +1628 0 +1629 0 +1630 0 +1631 0 +1632 0 +1633 0 +1634 0 +1635 0 +1636 0 +1637 0 +1638 0 +1639 0 +1640 0 +1641 0 +1642 0 +1643 0 +1644 0 +1645 0 +1646 0 +1647 0 +1648 0 +1649 0 +1650 0 +1651 0 +1652 0 +1653 0 +1654 0 +1655 0 +1656 0 +1657 0 +1658 0 +1659 0 +1660 0 +1661 0 +1662 0 +1663 0 +1664 0 +1665 0 +1666 0 +1667 0 +1668 0 +1669 0 +1670 0 +1671 0 +1672 0 +1673 0 +1674 0 +1675 0 +1676 0 +1677 0 +1678 0 +1679 0 +1680 0 +1681 0 +1682 0 +1683 0 +1684 0 +1685 0 +1686 0 +1687 0 +1688 0 +1689 0 +1690 0 +1691 0 +1692 0 +1693 0 +1694 0 +1695 0 +1696 0 +1697 0 +1698 0 +1699 0 +1700 0 +1701 0 +1702 0 +1703 0 +1704 0 +1705 0 +1706 0 +1707 0 +1708 0 +1709 0 +1710 0 +1711 0 +1712 0 +1713 0 +1714 0 +1715 0 +1716 0 +1717 0 +1718 0 +1719 0 +1720 0 +1721 0 +1722 0 +1723 0 +1724 0 +1725 0 +1726 0 +1727 0 +1728 0 +1729 0 +1730 0 +1731 0 +1732 0 +1733 0 +1734 0 +1735 0 +1736 0 +1737 0 +1738 0 +1739 0 +1740 0 +1741 0 +1742 0 +1743 0 +1744 0 +1745 0 +1746 0 +1747 0 +1748 0 +1749 0 +1750 0 +1751 0 +1752 0 +1753 0 +1754 0 +1755 0 +1756 0 +1757 0 +1758 0 +1759 0 +1760 0 +1761 0 +1762 0 +1763 0 +1764 0 +1765 0 +1766 0 +1767 0 +1768 0 +1769 0 +1770 0 +1771 0 +1772 0 +1773 0 +1774 0 +1775 0 +1776 0 +1777 0 +1778 0 +1779 0 +1780 0 +1781 0 +1782 0 +1783 0 +1784 0 +1785 0 +1786 0 +1787 0 +1788 0 +1789 0 +1790 0 +1791 0 +1792 0 +1793 0 +1794 0 +1795 0 +1796 0 +1797 0 +1798 0 +1799 0 +1800 0 +1801 0 +1802 0 +1803 0 +1804 0 +1805 0 +1806 0 +1807 0 +1808 0 +1809 0 +1810 0 +1811 0 +1812 0 +1813 0 +1814 0 +1815 0 +1816 0 +1817 0 +1818 0 +1819 0 +1820 0 +1821 0 +1822 0 +1823 0 +1824 0 +1825 0 +1826 0 +1827 0 +1828 0 +1829 0 +1830 0 +1831 0 +1832 0 +1833 0 +1834 0 +1835 0 +1836 0 +1837 0 +1838 0 +1839 0 +1840 0 +1841 0 +1842 0 +1843 0 +1844 0 +1845 0 +1846 0 +1847 0 +1848 0 +1849 0 +1850 0 +1851 0 +1852 0 +1853 0 +1854 0 +1855 0 +1856 0 +1857 0 +1858 0 +1859 0 +1860 0 +1861 0 +1862 0 +1863 0 +1864 0 +1865 0 +1866 0 +1867 0 +1868 0 +1869 0 +1870 0 +1871 0 +1872 0 +1873 0 +1874 0 +1875 0 +1876 0 +1877 0 +1878 0 +1879 0 +1880 0 +1881 0 +1882 0 +1883 0 +1884 0 +1885 0 +1886 0 +1887 0 +1888 0 +1889 0 +1890 0 +1891 0 +1892 0 +1893 0 +1894 0 +1895 0 +1896 0 +1897 0 +1898 0 +1899 0 +1900 0 +1901 0 +1902 0 +1903 0 +1904 0 +1905 0 +1906 0 +1907 0 +1908 0 +1909 0 +1910 0 +1911 0 +1912 0 +1913 0 +1914 0 +1915 0 +1916 0 +1917 0 +1918 0 +1919 0 +1920 0 +1921 0 +1922 0 +1923 0 +1924 0 +1925 0 +1926 0 +1927 0 +1928 0 +1929 0 +1930 0 +1931 0 +1932 0 +1933 0 +1934 0 +1935 0 +1936 0 +1937 0 +1938 0 +1939 0 +1940 0 +1941 0 +1942 0 +1943 0 +1944 0 +1945 0 +1946 0 +1947 0 +1948 0 +1949 0 +1950 0 +1951 0 +1952 0 +1953 0 +1954 0 +1955 0 +1956 0 +1957 0 +1958 0 +1959 0 +1960 0 +1961 0 +1962 0 +1963 0 +1964 0 +1965 0 +1966 0 +1967 0 +1968 0 +1969 0 +1970 0 +1971 0 +1972 0 +1973 0 +1974 0 +1975 0 +1976 0 +1977 0 +1978 0 +1979 0 +1980 0 +1981 0 +1982 0 +1983 0 +1984 0 +1985 0 +1986 0 +1987 0 +1988 0 +1989 0 +1990 0 +1991 0 +1992 0 +1993 0 +1994 0 +1995 0 +1996 0 +1997 0 +1998 0 +1999 0 +2000 0 +2001 0 +2002 0 +2003 0 +2004 0 +2005 0 +2006 0 +2007 0 +2008 0 +2009 0 +2010 0 +2011 0 +2012 0 +2013 0 +2014 0 +2015 0 +2016 0 +2017 0 +2018 0 +2019 0 +2020 0 +2021 0 +2022 0 +2023 0 +2024 0 +2025 0 +2026 0 +2027 0 +2028 0 +2029 0 +2030 0 +2031 0 +2032 0 +2033 0 +2034 0 +2035 0 +2036 0 +2037 0 +2038 0 +2039 0 +2040 0 +2041 0 +2042 0 +2043 0 +2044 0 +2045 0 +2046 0 +2047 0 +2048 0 +2049 0 +2050 0 +2051 0 +2052 0 +2053 0 +2054 0 +2055 0 +2056 0 +2057 0 +2058 0 +2059 0 +2060 0 +2061 0 +2062 0 +2063 0 +2064 0 +2065 0 +2066 0 +2067 0 +2068 0 +2069 0 +2070 0 +2071 0 +2072 0 +2073 0 +2074 0 +2075 0 +2076 0 +2077 0 +2078 0 +2079 0 +2080 0 +2081 0 +2082 0 +2083 0 diff --git a/evidence/allen-omega-L694/L740/independent-review/outputs/scene-independent.log b/evidence/allen-omega-L694/L740/independent-review/outputs/scene-independent.log new file mode 100644 index 00000000..d1c1d167 --- /dev/null +++ b/evidence/allen-omega-L694/L740/independent-review/outputs/scene-independent.log @@ -0,0 +1,2080 @@ +0 0 +1 1 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 +183 0 +184 0 +185 0 +186 0 +187 0 +188 0 +189 0 +190 0 +191 0 +192 0 +193 0 +194 0 +195 0 +196 0 +197 0 +198 0 +199 0 +200 0 +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 +225 0 +226 0 +227 0 +228 0 +229 0 +230 0 +231 0 +232 0 +233 0 +234 0 +235 0 +236 0 +237 0 +238 0 +239 0 +240 0 +241 0 +242 0 +243 0 +244 0 +245 0 +246 0 +247 0 +248 0 +249 0 +250 0 +251 0 +252 0 +253 0 +254 0 +255 0 +256 0 +257 0 +258 0 +259 0 +260 0 +261 0 +262 0 +263 0 +264 0 +265 0 +266 0 +267 0 +268 0 +269 0 +270 0 +271 0 +272 0 +273 0 +274 0 +275 0 +276 0 +277 0 +278 0 +279 0 +280 0 +281 0 +282 0 +283 0 +284 0 +285 0 +286 0 +287 0 +288 0 +289 0 +290 0 +291 0 +292 0 +293 0 +294 0 +295 0 +296 0 +297 0 +298 0 +299 0 +300 0 +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 0 +310 0 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +361 0 +362 0 +363 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 0 +380 0 +381 0 +382 0 +383 0 +384 0 +385 0 +386 0 +387 0 +388 0 +389 0 +390 0 +391 0 +392 0 +393 0 +394 0 +395 0 +396 0 +397 0 +398 0 +399 0 +400 0 +401 0 +402 0 +403 0 +404 0 +405 0 +406 0 +407 0 +408 0 +409 0 +410 0 +411 0 +412 0 +413 0 +414 0 +415 0 +416 0 +417 0 +418 0 +419 0 +420 0 +421 0 +422 0 +423 0 +424 0 +425 0 +426 0 +427 0 +428 0 +429 0 +430 0 +431 0 +432 0 +433 0 +434 0 +435 0 +436 0 +437 0 +438 0 +439 0 +440 0 +441 0 +442 0 +443 0 +444 0 +445 0 +446 0 +447 0 +448 0 +449 0 +450 0 +451 0 +452 0 +453 0 +454 0 +455 0 +456 0 +457 0 +458 0 +459 0 +460 0 +461 0 +462 0 +463 0 +464 0 +465 0 +466 0 +467 0 +468 0 +469 0 +470 0 +471 0 +472 0 +473 0 +474 0 +475 0 +476 0 +477 0 +478 0 +479 0 +480 0 +481 0 +482 0 +483 0 +484 0 +485 0 +486 0 +487 0 +488 0 +489 0 +490 0 +491 0 +492 0 +493 0 +494 0 +495 0 +496 0 +497 0 +498 0 +499 0 +500 0 +501 0 +502 0 +503 0 +504 0 +505 0 +506 0 +507 0 +508 0 +509 0 +510 0 +511 0 +512 0 +513 0 +514 0 +515 0 +516 0 +517 0 +518 0 +519 0 +520 0 +521 0 +522 0 +523 0 +524 0 +525 0 +526 0 +527 0 +528 0 +529 0 +530 0 +531 0 +532 0 +533 0 +534 0 +535 0 +536 0 +537 0 +538 0 +539 0 +540 0 +541 0 +542 0 +543 0 +544 0 +545 0 +546 0 +547 0 +548 0 +549 0 +550 0 +551 0 +552 0 +553 0 +554 0 +555 0 +556 0 +557 0 +558 0 +559 0 +560 0 +561 0 +562 0 +563 0 +564 0 +565 0 +566 0 +567 0 +568 0 +569 0 +570 0 +571 0 +572 0 +573 0 +574 0 +575 0 +576 0 +577 0 +578 0 +579 0 +580 0 +581 0 +582 0 +583 0 +584 0 +585 0 +586 0 +587 0 +588 0 +589 0 +590 0 +591 0 +592 0 +593 0 +594 0 +595 0 +596 0 +597 0 +598 0 +599 0 +600 0 +601 0 +602 0 +603 0 +604 0 +605 0 +606 0 +607 0 +608 0 +609 0 +610 0 +611 0 +612 0 +613 0 +614 0 +615 0 +616 0 +617 0 +618 0 +619 0 +620 0 +621 0 +622 0 +623 0 +624 0 +625 0 +626 0 +627 0 +628 0 +629 0 +630 0 +631 0 +632 0 +633 0 +634 0 +635 0 +636 0 +637 0 +638 0 +639 0 +640 0 +641 0 +642 0 +643 0 +644 0 +645 0 +646 0 +647 0 +648 0 +649 0 +650 0 +651 0 +652 0 +653 0 +654 0 +655 0 +656 0 +657 0 +658 0 +659 0 +660 0 +661 0 +662 0 +663 0 +664 0 +665 0 +666 0 +667 0 +668 0 +669 0 +670 0 +671 0 +672 0 +673 0 +674 0 +675 0 +676 0 +677 0 +678 0 +679 0 +680 0 +681 0 +682 0 +683 0 +684 0 +685 0 +686 0 +687 0 +688 0 +689 0 +690 0 +691 0 +692 0 +693 0 +694 0 +695 0 +696 0 +697 0 +698 0 +699 0 +700 0 +701 0 +702 0 +703 0 +704 0 +705 0 +706 0 +707 0 +708 0 +709 0 +710 0 +711 0 +712 0 +713 0 +714 0 +715 0 +716 0 +717 0 +718 0 +719 0 +720 0 +721 0 +722 0 +723 0 +724 0 +725 0 +726 0 +727 0 +728 0 +729 0 +730 0 +731 0 +732 0 +733 0 +734 0 +735 0 +736 0 +737 0 +738 0 +739 0 +740 0 +741 0 +742 0 +743 0 +744 0 +745 0 +746 0 +747 0 +748 0 +749 0 +750 0 +751 0 +752 0 +753 0 +754 0 +755 0 +756 0 +757 0 +758 0 +759 0 +760 0 +761 0 +762 0 +763 0 +764 0 +765 0 +766 0 +767 0 +768 0 +769 0 +770 0 +771 0 +772 0 +773 0 +774 0 +775 0 +776 0 +777 0 +778 0 +779 0 +780 0 +781 0 +782 0 +783 0 +784 0 +785 0 +786 0 +787 0 +788 0 +789 0 +790 0 +791 0 +792 0 +793 0 +794 0 +795 0 +796 0 +797 0 +798 0 +799 0 +800 0 +801 0 +802 0 +803 0 +804 0 +805 0 +806 0 +807 0 +808 0 +809 0 +810 0 +811 0 +812 0 +813 0 +814 0 +815 0 +816 0 +817 0 +818 0 +819 0 +820 0 +821 0 +822 0 +823 0 +824 0 +825 0 +826 0 +827 0 +828 0 +829 0 +830 0 +831 0 +832 0 +833 0 +834 0 +835 0 +836 0 +837 0 +838 0 +839 0 +840 0 +841 0 +842 0 +843 0 +844 0 +845 0 +846 0 +847 0 +848 0 +849 0 +850 0 +851 0 +852 0 +853 0 +854 0 +855 0 +856 0 +857 0 +858 0 +859 0 +860 0 +861 0 +862 0 +863 0 +864 0 +865 0 +866 0 +867 0 +868 0 +869 0 +870 0 +871 0 +872 0 +873 0 +874 0 +875 0 +876 0 +877 0 +878 0 +879 0 +880 0 +881 0 +882 0 +883 0 +884 0 +885 0 +886 0 +887 0 +888 0 +889 0 +890 0 +891 0 +892 0 +893 0 +894 0 +895 0 +896 0 +897 0 +898 0 +899 0 +900 0 +901 0 +902 0 +903 0 +904 0 +905 0 +906 0 +907 0 +908 0 +909 0 +910 0 +911 0 +912 0 +913 0 +914 0 +915 0 +916 0 +917 0 +918 0 +919 0 +920 0 +921 0 +922 0 +923 0 +924 0 +925 0 +926 0 +927 0 +928 0 +929 0 +930 0 +931 0 +932 0 +933 0 +934 0 +935 0 +936 0 +937 0 +938 0 +939 0 +940 0 +941 0 +942 0 +943 0 +944 0 +945 0 +946 0 +947 0 +948 0 +949 0 +950 0 +951 0 +952 0 +953 0 +954 0 +955 0 +956 0 +957 0 +958 0 +959 0 +960 0 +961 0 +962 0 +963 0 +964 0 +965 0 +966 0 +967 0 +968 0 +969 0 +970 0 +971 0 +972 0 +973 0 +974 0 +975 0 +976 0 +977 0 +978 0 +979 0 +980 0 +981 0 +982 0 +983 0 +984 0 +985 0 +986 0 +987 0 +988 0 +989 0 +990 0 +991 0 +992 0 +993 0 +994 0 +995 0 +996 0 +997 0 +998 0 +999 0 +1000 0 +1001 0 +1002 0 +1003 0 +1004 0 +1005 0 +1006 0 +1007 0 +1008 0 +1009 0 +1010 0 +1011 0 +1012 0 +1013 0 +1014 0 +1015 0 +1016 0 +1017 0 +1018 0 +1019 0 +1020 0 +1021 0 +1022 0 +1023 0 +1024 0 +1025 0 +1026 0 +1027 0 +1028 0 +1029 0 +1030 0 +1031 0 +1032 0 +1033 0 +1034 0 +1035 0 +1036 0 +1037 0 +1038 0 +1039 0 +1040 0 +1041 0 +1042 0 +1043 0 +1044 0 +1045 0 +1046 0 +1047 0 +1048 0 +1049 0 +1050 0 +1051 0 +1052 0 +1053 0 +1054 0 +1055 0 +1056 0 +1057 0 +1058 0 +1059 0 +1060 0 +1061 0 +1062 0 +1063 0 +1064 0 +1065 0 +1066 0 +1067 0 +1068 0 +1069 0 +1070 0 +1071 0 +1072 0 +1073 0 +1074 0 +1075 0 +1076 0 +1077 0 +1078 0 +1079 0 +1080 0 +1081 0 +1082 0 +1083 0 +1084 0 +1085 0 +1086 0 +1087 0 +1088 0 +1089 0 +1090 0 +1091 0 +1092 0 +1093 0 +1094 0 +1095 0 +1096 0 +1097 0 +1098 0 +1099 0 +1100 0 +1101 0 +1102 0 +1103 0 +1104 0 +1105 0 +1106 0 +1107 0 +1108 0 +1109 0 +1110 0 +1111 0 +1112 0 +1113 0 +1114 0 +1115 0 +1116 0 +1117 0 +1118 0 +1119 0 +1120 0 +1121 0 +1122 0 +1123 0 +1124 0 +1125 0 +1126 0 +1127 0 +1128 0 +1129 0 +1130 0 +1131 0 +1132 0 +1133 0 +1134 0 +1135 0 +1136 0 +1137 0 +1138 0 +1139 0 +1140 0 +1141 0 +1142 0 +1143 0 +1144 0 +1145 0 +1146 0 +1147 0 +1148 0 +1149 0 +1150 0 +1151 0 +1152 0 +1153 0 +1154 0 +1155 0 +1156 0 +1157 0 +1158 0 +1159 0 +1160 0 +1161 0 +1162 0 +1163 0 +1164 0 +1165 0 +1166 0 +1167 0 +1168 0 +1169 0 +1170 0 +1171 0 +1172 0 +1173 0 +1174 0 +1175 0 +1176 0 +1177 0 +1178 0 +1179 0 +1180 0 +1181 0 +1182 0 +1183 0 +1184 0 +1185 0 +1186 0 +1187 0 +1188 0 +1189 0 +1190 0 +1191 0 +1192 0 +1193 0 +1194 0 +1195 0 +1196 0 +1197 0 +1198 0 +1199 0 +1200 0 +1201 0 +1202 0 +1203 0 +1204 0 +1205 0 +1206 0 +1207 0 +1208 0 +1209 0 +1210 0 +1211 0 +1212 0 +1213 0 +1214 0 +1215 0 +1216 0 +1217 0 +1218 0 +1219 0 +1220 0 +1221 0 +1222 0 +1223 0 +1224 0 +1225 0 +1226 0 +1227 0 +1228 0 +1229 0 +1230 0 +1231 0 +1232 0 +1233 0 +1234 0 +1235 0 +1236 0 +1237 0 +1238 0 +1239 0 +1240 0 +1241 0 +1242 0 +1243 0 +1244 0 +1245 0 +1246 0 +1247 0 +1248 0 +1249 0 +1250 0 +1251 0 +1252 0 +1253 0 +1254 0 +1255 0 +1256 0 +1257 0 +1258 0 +1259 0 +1260 0 +1261 0 +1262 0 +1263 0 +1264 0 +1265 0 +1266 0 +1267 0 +1268 0 +1269 0 +1270 0 +1271 0 +1272 0 +1273 0 +1274 0 +1275 0 +1276 0 +1277 0 +1278 0 +1279 0 +1280 0 +1281 0 +1282 0 +1283 0 +1284 0 +1285 0 +1286 0 +1287 0 +1288 0 +1289 0 +1290 0 +1291 0 +1292 0 +1293 0 +1294 0 +1295 0 +1296 0 +1297 0 +1298 0 +1299 0 +1300 0 +1301 0 +1302 0 +1303 0 +1304 0 +1305 0 +1306 0 +1307 0 +1308 0 +1309 0 +1310 0 +1311 0 +1312 0 +1313 0 +1314 0 +1315 0 +1316 0 +1317 0 +1318 0 +1319 0 +1320 0 +1321 0 +1322 0 +1323 0 +1324 0 +1325 0 +1326 0 +1327 0 +1328 0 +1329 0 +1330 0 +1331 0 +1332 0 +1333 0 +1334 0 +1335 0 +1336 0 +1337 0 +1338 0 +1339 0 +1340 0 +1341 0 +1342 0 +1343 0 +1344 0 +1345 0 +1346 0 +1347 0 +1348 0 +1349 0 +1350 0 +1351 0 +1352 0 +1353 0 +1354 0 +1355 0 +1356 0 +1357 0 +1358 0 +1359 0 +1360 0 +1361 0 +1362 0 +1363 0 +1364 0 +1365 0 +1366 0 +1367 0 +1368 0 +1369 0 +1370 0 +1371 0 +1372 0 +1373 0 +1374 0 +1375 0 +1376 0 +1377 0 +1378 0 +1379 0 +1380 0 +1381 0 +1382 0 +1383 0 +1384 0 +1385 0 +1386 0 +1387 0 +1388 0 +1389 0 +1390 0 +1391 0 +1392 0 +1393 0 +1394 0 +1395 0 +1396 0 +1397 0 +1398 0 +1399 0 +1400 0 +1401 0 +1402 0 +1403 0 +1404 0 +1405 0 +1406 0 +1407 0 +1408 0 +1409 0 +1410 0 +1411 0 +1412 0 +1413 0 +1414 0 +1415 0 +1416 0 +1417 0 +1418 0 +1419 0 +1420 0 +1421 0 +1422 0 +1423 0 +1424 0 +1425 0 +1426 0 +1427 0 +1428 0 +1429 0 +1430 0 +1431 0 +1432 0 +1433 0 +1434 0 +1435 0 +1436 0 +1437 0 +1438 0 +1439 0 +1440 0 +1441 0 +1442 0 +1443 0 +1444 0 +1445 0 +1446 0 +1447 0 +1448 0 +1449 0 +1450 0 +1451 0 +1452 0 +1453 0 +1454 0 +1455 0 +1456 0 +1457 0 +1458 0 +1459 0 +1460 0 +1461 0 +1462 0 +1463 0 +1464 0 +1465 0 +1466 0 +1467 0 +1468 0 +1469 0 +1470 0 +1471 0 +1472 0 +1473 0 +1474 0 +1475 0 +1476 0 +1477 0 +1478 0 +1479 0 +1480 0 +1481 0 +1482 0 +1483 0 +1484 0 +1485 0 +1486 0 +1487 0 +1488 0 +1489 0 +1490 0 +1491 0 +1492 0 +1493 0 +1494 0 +1495 0 +1496 0 +1497 0 +1498 0 +1499 0 +1500 0 +1501 0 +1502 0 +1503 0 +1504 0 +1505 0 +1506 0 +1507 0 +1508 0 +1509 0 +1510 0 +1511 0 +1512 0 +1513 0 +1514 0 +1515 0 +1516 0 +1517 0 +1518 0 +1519 0 +1520 0 +1521 0 +1522 0 +1523 0 +1524 0 +1525 0 +1526 0 +1527 0 +1528 0 +1529 0 +1530 0 +1531 0 +1532 0 +1533 0 +1534 0 +1535 0 +1536 0 +1537 0 +1538 0 +1539 0 +1540 0 +1541 0 +1542 0 +1543 0 +1544 0 +1545 0 +1546 0 +1547 0 +1548 0 +1549 0 +1550 0 +1551 0 +1552 0 +1553 0 +1554 0 +1555 0 +1556 0 +1557 0 +1558 0 +1559 0 +1560 0 +1561 0 +1562 0 +1563 0 +1564 0 +1565 0 +1566 0 +1567 0 +1568 0 +1569 0 +1570 0 +1571 0 +1572 0 +1573 0 +1574 0 +1575 0 +1576 0 +1577 0 +1578 0 +1579 0 +1580 0 +1581 0 +1582 0 +1583 0 +1584 0 +1585 0 +1586 0 +1587 0 +1588 0 +1589 0 +1590 0 +1591 0 +1592 0 +1593 0 +1594 0 +1595 0 +1596 0 +1597 0 +1598 0 +1599 0 +1600 0 +1601 0 +1602 0 +1603 0 +1604 0 +1605 0 +1606 0 +1607 0 +1608 0 +1609 0 +1610 0 +1611 0 +1612 0 +1613 0 +1614 0 +1615 0 +1616 0 +1617 0 +1618 0 +1619 0 +1620 0 +1621 0 +1622 0 +1623 0 +1624 0 +1625 0 +1626 0 +1627 0 +1628 0 +1629 0 +1630 0 +1631 0 +1632 0 +1633 0 +1634 0 +1635 0 +1636 0 +1637 0 +1638 0 +1639 0 +1640 0 +1641 0 +1642 0 +1643 0 +1644 0 +1645 0 +1646 0 +1647 0 +1648 0 +1649 0 +1650 0 +1651 0 +1652 0 +1653 0 +1654 0 +1655 0 +1656 0 +1657 0 +1658 0 +1659 0 +1660 0 +1661 0 +1662 0 +1663 0 +1664 0 +1665 0 +1666 0 +1667 0 +1668 0 +1669 0 +1670 0 +1671 0 +1672 0 +1673 0 +1674 0 +1675 0 +1676 0 +1677 0 +1678 0 +1679 0 +1680 0 +1681 0 +1682 0 +1683 0 +1684 0 +1685 0 +1686 0 +1687 0 +1688 0 +1689 0 +1690 0 +1691 0 +1692 0 +1693 0 +1694 0 +1695 0 +1696 0 +1697 0 +1698 0 +1699 0 +1700 0 +1701 0 +1702 0 +1703 0 +1704 0 +1705 0 +1706 0 +1707 0 +1708 0 +1709 0 +1710 0 +1711 0 +1712 0 +1713 0 +1714 0 +1715 0 +1716 0 +1717 0 +1718 0 +1719 0 +1720 0 +1721 0 +1722 0 +1723 0 +1724 0 +1725 0 +1726 0 +1727 0 +1728 0 +1729 0 +1730 0 +1731 0 +1732 0 +1733 0 +1734 0 +1735 0 +1736 0 +1737 0 +1738 0 +1739 0 +1740 0 +1741 0 +1742 0 +1743 0 +1744 0 +1745 0 +1746 0 +1747 0 +1748 0 +1749 0 +1750 0 +1751 0 +1752 0 +1753 0 +1754 0 +1755 0 +1756 0 +1757 0 +1758 0 +1759 0 +1760 0 +1761 0 +1762 0 +1763 0 +1764 0 +1765 0 +1766 0 +1767 0 +1768 0 +1769 0 +1770 0 +1771 0 +1772 0 +1773 0 +1774 0 +1775 0 +1776 0 +1777 0 +1778 0 +1779 0 +1780 0 +1781 0 +1782 0 +1783 0 +1784 0 +1785 0 +1786 0 +1787 0 +1788 0 +1789 0 +1790 0 +1791 0 +1792 0 +1793 0 +1794 0 +1795 0 +1796 0 +1797 0 +1798 0 +1799 0 +1800 0 +1801 0 +1802 0 +1803 0 +1804 0 +1805 0 +1806 0 +1807 0 +1808 0 +1809 0 +1810 0 +1811 0 +1812 0 +1813 0 +1814 0 +1815 0 +1816 0 +1817 0 +1818 0 +1819 0 +1820 0 +1821 0 +1822 0 +1823 0 +1824 0 +1825 0 +1826 0 +1827 0 +1828 0 +1829 0 +1830 0 +1831 0 +1832 0 +1833 0 +1834 0 +1835 0 +1836 0 +1837 0 +1838 0 +1839 0 +1840 0 +1841 0 +1842 0 +1843 0 +1844 0 +1845 0 +1846 0 +1847 0 +1848 0 +1849 0 +1850 0 +1851 0 +1852 0 +1853 0 +1854 0 +1855 0 +1856 0 +1857 0 +1858 0 +1859 0 +1860 0 +1861 0 +1862 0 +1863 0 +1864 0 +1865 0 +1866 0 +1867 0 +1868 0 +1869 0 +1870 0 +1871 0 +1872 0 +1873 0 +1874 0 +1875 0 +1876 0 +1877 0 +1878 0 +1879 0 +1880 0 +1881 0 +1882 0 +1883 0 +1884 0 +1885 0 +1886 0 +1887 0 +1888 0 +1889 0 +1890 0 +1891 0 +1892 0 +1893 0 +1894 0 +1895 0 +1896 0 +1897 0 +1898 0 +1899 0 +1900 0 +1901 0 +1902 0 +1903 0 +1904 0 +1905 0 +1906 0 +1907 0 +1908 0 +1909 0 +1910 0 +1911 0 +1912 0 +1913 0 +1914 0 +1915 0 +1916 0 +1917 0 +1918 0 +1919 0 +1920 0 +1921 0 +1922 0 +1923 0 +1924 0 +1925 0 +1926 0 +1927 0 +1928 0 +1929 0 +1930 0 +1931 0 +1932 0 +1933 0 +1934 0 +1935 0 +1936 0 +1937 0 +1938 0 +1939 0 +1940 0 +1941 0 +1942 0 +1943 0 +1944 0 +1945 0 +1946 0 +1947 0 +1948 0 +1949 0 +1950 0 +1951 0 +1952 0 +1953 0 +1954 0 +1955 0 +1956 0 +1957 0 +1958 0 +1959 0 +1960 0 +1961 0 +1962 0 +1963 0 +1964 0 +1965 0 +1966 0 +1967 0 +1968 0 +1969 0 +1970 0 +1971 0 +1972 0 +1973 0 +1974 0 +1975 0 +1976 0 +1977 0 +1978 0 +1979 0 +1980 0 +1981 0 +1982 0 +1983 0 +1984 0 +1985 0 +1986 0 +1987 0 +1988 0 +1989 0 +1990 0 +1991 0 +1992 0 +1993 0 +1994 0 +1995 0 +1996 0 +1997 0 +1998 0 +1999 0 +2000 0 +2001 0 +2002 0 +2003 0 +2004 0 +2005 0 +2006 0 +2007 0 +2008 0 +2009 0 +2010 0 +2011 0 +2012 0 +2013 0 +2014 0 +2015 0 +2016 0 +2017 0 +2018 0 +2019 0 +2020 0 +2021 0 +2022 0 +2023 0 +2024 0 +2025 0 +2026 0 +2027 0 +2028 0 +2029 0 +2030 0 +2031 0 +2032 0 +2033 0 +2034 0 +2035 0 +2036 0 +2037 0 +2038 0 +2039 0 +2040 0 +2041 0 +2042 0 +2043 0 +2044 0 +2045 0 +2046 0 +2047 0 +2048 0 +2049 0 +2050 0 +2051 0 +2052 0 +2053 0 +2054 0 +2055 0 +2056 0 +2057 0 +2058 0 +2059 0 +2060 0 +2061 0 +2062 0 +2063 0 +2064 0 +2065 0 +2066 0 +2067 0 +2068 0 +2069 0 +2070 0 +2071 0 +2072 0 +2073 0 +2074 0 +2075 0 +2076 0 +2077 0 +2078 0 +2079 0 diff --git a/evidence/allen-omega-L694/L740/independent-review/outputs/upstream-scene-test.log b/evidence/allen-omega-L694/L740/independent-review/outputs/upstream-scene-test.log new file mode 100644 index 00000000..edd8e122 --- /dev/null +++ b/evidence/allen-omega-L694/L740/independent-review/outputs/upstream-scene-test.log @@ -0,0 +1,63 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 diff --git a/evidence/allen-omega-L694/L740/independent-review/outputs/upstream-scene-test.om b/evidence/allen-omega-L694/L740/independent-review/outputs/upstream-scene-test.om new file mode 100644 index 00000000..6d71533a --- /dev/null +++ b/evidence/allen-omega-L694/L740/independent-review/outputs/upstream-scene-test.om @@ -0,0 +1,3078 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +text Fancy "\t- **SaY**:\tKeep My CASE.~\n> NOTE RIGHT WARM: Title | Body TEXT\n" +text Private "say secret\nnote: secret | hidden\n\n```scene\nsay Visible\n```\n" +text Inline "say public secret\nsay Safe\n" +text Unclosed "never closed\nsay secret\n" +text Plain "Hello there.\nAnother sentence.\n" +text Mixed "Unrecognized text.\nnote: Heading | Body\n" +text Invalid "number: nope\n" +text Moodonly "MOOD Dawn Lively\n" +text Listmark "1. note left: Heading | Body\n" +text Wanted "Keep My CASE." +text Vis "Visible" +text Hello "Hello there." +text Nested "- > - **SaY**: Nested works.\n" +text Negative "-3 is negative.\n" +global Savedin uchar 2048 +fn test ok bool to void +check ok add get Checks 0 1 +end +fn load which ulong to void +if eq which 0 +put Inlen 0 len Fancy +for i ulong len Fancy +c = get Fancy i +if eq c 126 +c = uchar 13 +end +put In i c +end +end +if eq which 1 +put Inlen 0 len Private +for i ulong len Private +put In i get Private i +end +end +if eq which 2 +put Inlen 0 len Inline +for i ulong len Inline +put In i get Inline i +end +end +if eq which 3 +put Inlen 0 len Unclosed +for i ulong len Unclosed +put In i get Unclosed i +end +end +if eq which 4 +put Inlen 0 len Plain +for i ulong len Plain +put In i get Plain i +end +end +if eq which 5 +put Inlen 0 len Mixed +for i ulong len Mixed +put In i get Mixed i +end +end +if eq which 6 +put Inlen 0 len Invalid +for i ulong len Invalid +put In i get Invalid i +end +end +if eq which 7 +put Inlen 0 len Moodonly +for i ulong len Moodonly +put In i get Moodonly i +end +end +if eq which 8 +put Inlen 0 len Listmark +for i ulong len Listmark +put In i get Listmark i +end +end +end +fn main to int +load 0 +n = get Inlen 0 +for i ulong n +put Savedin i get In i +end +test scdecode +test eq get Sc 2 1 +test eq get Sc 3 1 +test eq get Things 0 1 +test eq get Things 1 2 +test eq get Things 4 1 +test gt get Nm 2 0 +test eq get Inlen 0 n +same = true +for i ulong n +if ne get In i get Savedin i +same = false +end +end +test same +same = true +for i ulong len Wanted +if ne get Stext add get Sw 3 i get Wanted i +same = false +end +end +test same +test eq get Stext add get Sw 3 len Wanted 0 +load 1 +test scdecode +test eq get Sc 2 1 +test eq get Sc 3 0 +test eq get Nm 3 3 +same = true +for i ulong len Vis +if ne get Stext add get Sw 3 i get Vis i +same = false +end +end +test same +test eq get Stext add get Sw 3 len Vis 0 +load 2 +test scdecode +test eq get Nm 3 1 +test eq get Stext get Sw 3 83 +load 3 +test not scdecode +test eq get Sc 2 0 +test eq get Sc 3 0 +test eq get Nm 0 1 +load 4 +test scdecode +test eq get Sc 2 1 +test eq get Sc 3 0 +same = true +for i ulong len Hello +if ne get Stext add get Sw 3 i get Hello i +same = false +end +end +test same +load 5 +test scdecode +test eq get Sc 2 0 +test eq get Sc 3 1 +load 6 +test not scdecode +test eq get Sc 2 0 +test eq get Sc 3 0 +load 7 +test scdecode +test eq get Sc 0 1 +test eq get Sc 1 2 +test eq get Sc 2 0 +load 8 +test scdecode +test eq get Things 1 1 +put Inlen 0 160 +for i ulong 160 +put In i 120 +end +test not scdecode +test eq get Sc 2 0 +put Inlen 0 159 +test scdecode +test eq get Sc 2 1 +test eq get Stext add get Sw 3 159 0 +put Inlen 0 2049 +test not scdecode +test eq get Nm 6 1 +test eq get Sc 2 0 +test eq get Sc 3 0 +load 4 +put In 2 0 +test not scdecode +test eq get Nm 6 1 +test eq get In 2 0 +put Inlen 0 0 +test not scdecode +test eq get Sc 2 0 +put Inlen 0 len Nested +for i ulong len Nested +put In i get Nested i +end +test scdecode +test eq get Stext get Sw 3 78 +put Inlen 0 len Negative +for i ulong len Negative +put In i get Negative i +end +test scdecode +test eq get Stext get Sw 3 45 +note A thirteenth line cannot enable mood or plain fallback after twelve refusals. +for k ulong 12 +for i ulong len Invalid +put In add mul k len Invalid i get Invalid i +end +end +n = mul 12 len Invalid +for i ulong len Moodonly +put In add n i get Moodonly i +end +put Inlen 0 add n len Moodonly +test not scdecode +test eq get Sc 0 0 +test eq get Sc 7 1 +for i ulong len Plain +put In add n i get Plain i +end +put Inlen 0 add n len Plain +test not scdecode +test eq get Sc 2 0 +ret int get Fails 0 +end diff --git a/evidence/allen-omega-L694/L740/independent-review/parent-probe.log b/evidence/allen-omega-L694/L740/independent-review/parent-probe.log new file mode 100644 index 00000000..0a9fc972 --- /dev/null +++ b/evidence/allen-omega-L694/L740/independent-review/parent-probe.log @@ -0,0 +1,2084 @@ +0 0 +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 +183 0 +184 0 +185 0 +186 0 +187 0 +188 0 +189 0 +190 0 +191 0 +192 0 +193 0 +194 0 +195 0 +196 0 +197 0 +198 0 +199 0 +200 0 +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 +225 0 +226 0 +227 0 +228 0 +229 0 +230 0 +231 0 +232 0 +233 0 +234 0 +235 0 +236 0 +237 0 +238 0 +239 0 +240 0 +241 0 +242 0 +243 0 +244 0 +245 0 +246 0 +247 0 +248 0 +249 0 +250 0 +251 0 +252 0 +253 0 +254 0 +255 0 +256 0 +257 0 +258 0 +259 0 +260 0 +261 0 +262 0 +263 0 +264 0 +265 0 +266 0 +267 0 +268 0 +269 0 +270 0 +271 0 +272 0 +273 0 +274 0 +275 0 +276 0 +277 0 +278 0 +279 0 +280 0 +281 0 +282 0 +283 0 +284 0 +285 0 +286 0 +287 0 +288 0 +289 0 +290 0 +291 0 +292 0 +293 0 +294 0 +295 0 +296 0 +297 0 +298 0 +299 0 +300 0 +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 0 +310 0 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +361 0 +362 0 +363 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 0 +380 0 +381 0 +382 0 +383 0 +384 0 +385 0 +386 0 +387 0 +388 0 +389 0 +390 0 +391 0 +392 0 +393 0 +394 0 +395 0 +396 0 +397 0 +398 0 +399 0 +400 0 +401 0 +402 0 +403 0 +404 0 +405 0 +406 0 +407 0 +408 0 +409 0 +410 0 +411 0 +412 0 +413 0 +414 0 +415 0 +416 0 +417 0 +418 0 +419 0 +420 0 +421 0 +422 0 +423 0 +424 0 +425 0 +426 0 +427 0 +428 0 +429 0 +430 0 +431 0 +432 0 +433 0 +434 0 +435 0 +436 0 +437 0 +438 0 +439 0 +440 0 +441 0 +442 0 +443 0 +444 0 +445 0 +446 0 +447 0 +448 0 +449 0 +450 0 +451 0 +452 0 +453 0 +454 0 +455 0 +456 0 +457 0 +458 0 +459 0 +460 0 +461 0 +462 0 +463 0 +464 0 +465 0 +466 0 +467 0 +468 0 +469 0 +470 0 +471 0 +472 0 +473 0 +474 0 +475 0 +476 0 +477 0 +478 0 +479 0 +480 0 +481 0 +482 0 +483 0 +484 0 +485 0 +486 0 +487 0 +488 0 +489 0 +490 0 +491 0 +492 0 +493 0 +494 0 +495 0 +496 0 +497 0 +498 0 +499 0 +500 0 +501 0 +502 0 +503 0 +504 0 +505 0 +506 0 +507 0 +508 0 +509 0 +510 0 +511 0 +512 0 +513 0 +514 0 +515 0 +516 0 +517 0 +518 0 +519 0 +520 0 +521 0 +522 0 +523 0 +524 0 +525 0 +526 0 +527 0 +528 0 +529 0 +530 0 +531 0 +532 0 +533 0 +534 0 +535 0 +536 0 +537 0 +538 0 +539 0 +540 0 +541 0 +542 0 +543 0 +544 0 +545 0 +546 0 +547 0 +548 0 +549 0 +550 0 +551 0 +552 0 +553 0 +554 0 +555 0 +556 0 +557 0 +558 0 +559 0 +560 0 +561 0 +562 0 +563 0 +564 0 +565 0 +566 0 +567 0 +568 0 +569 0 +570 0 +571 0 +572 0 +573 0 +574 0 +575 0 +576 0 +577 0 +578 0 +579 0 +580 0 +581 0 +582 0 +583 0 +584 0 +585 0 +586 0 +587 0 +588 0 +589 0 +590 0 +591 0 +592 0 +593 0 +594 0 +595 0 +596 0 +597 0 +598 0 +599 0 +600 0 +601 0 +602 0 +603 0 +604 0 +605 0 +606 0 +607 0 +608 0 +609 0 +610 0 +611 0 +612 0 +613 0 +614 0 +615 0 +616 0 +617 0 +618 0 +619 0 +620 0 +621 0 +622 0 +623 0 +624 0 +625 0 +626 0 +627 0 +628 0 +629 0 +630 0 +631 0 +632 0 +633 0 +634 0 +635 0 +636 0 +637 0 +638 0 +639 0 +640 0 +641 0 +642 0 +643 0 +644 0 +645 0 +646 0 +647 0 +648 0 +649 0 +650 0 +651 0 +652 0 +653 0 +654 0 +655 0 +656 0 +657 0 +658 0 +659 0 +660 0 +661 0 +662 0 +663 0 +664 0 +665 0 +666 0 +667 0 +668 0 +669 0 +670 0 +671 0 +672 0 +673 0 +674 0 +675 0 +676 0 +677 0 +678 0 +679 0 +680 0 +681 0 +682 0 +683 0 +684 0 +685 0 +686 0 +687 0 +688 0 +689 0 +690 0 +691 0 +692 0 +693 0 +694 0 +695 0 +696 0 +697 0 +698 0 +699 0 +700 0 +701 0 +702 0 +703 0 +704 0 +705 0 +706 0 +707 0 +708 0 +709 0 +710 0 +711 0 +712 0 +713 0 +714 0 +715 0 +716 0 +717 0 +718 0 +719 0 +720 0 +721 0 +722 0 +723 0 +724 0 +725 0 +726 0 +727 0 +728 0 +729 0 +730 0 +731 0 +732 0 +733 0 +734 0 +735 0 +736 0 +737 0 +738 0 +739 0 +740 0 +741 0 +742 0 +743 0 +744 0 +745 0 +746 0 +747 0 +748 0 +749 0 +750 0 +751 0 +752 0 +753 0 +754 0 +755 0 +756 0 +757 0 +758 0 +759 0 +760 0 +761 0 +762 0 +763 0 +764 0 +765 0 +766 0 +767 0 +768 0 +769 0 +770 0 +771 0 +772 0 +773 0 +774 0 +775 0 +776 0 +777 0 +778 0 +779 0 +780 0 +781 0 +782 0 +783 0 +784 0 +785 0 +786 0 +787 0 +788 0 +789 0 +790 0 +791 0 +792 0 +793 0 +794 0 +795 0 +796 0 +797 0 +798 0 +799 0 +800 0 +801 0 +802 0 +803 0 +804 0 +805 0 +806 0 +807 0 +808 0 +809 0 +810 0 +811 0 +812 0 +813 0 +814 0 +815 0 +816 0 +817 0 +818 0 +819 0 +820 0 +821 0 +822 0 +823 0 +824 0 +825 0 +826 0 +827 0 +828 0 +829 0 +830 0 +831 0 +832 0 +833 0 +834 0 +835 0 +836 0 +837 0 +838 0 +839 0 +840 0 +841 0 +842 0 +843 0 +844 0 +845 0 +846 0 +847 0 +848 0 +849 0 +850 0 +851 0 +852 0 +853 0 +854 0 +855 0 +856 0 +857 0 +858 0 +859 0 +860 0 +861 0 +862 0 +863 0 +864 0 +865 0 +866 0 +867 0 +868 0 +869 0 +870 0 +871 0 +872 0 +873 0 +874 0 +875 0 +876 0 +877 0 +878 0 +879 0 +880 0 +881 0 +882 0 +883 0 +884 0 +885 0 +886 0 +887 0 +888 0 +889 0 +890 0 +891 0 +892 0 +893 0 +894 0 +895 0 +896 0 +897 0 +898 0 +899 0 +900 0 +901 0 +902 0 +903 0 +904 0 +905 0 +906 0 +907 0 +908 0 +909 0 +910 0 +911 0 +912 0 +913 0 +914 0 +915 0 +916 0 +917 0 +918 0 +919 0 +920 0 +921 0 +922 0 +923 0 +924 0 +925 0 +926 0 +927 0 +928 0 +929 0 +930 0 +931 0 +932 0 +933 0 +934 0 +935 0 +936 0 +937 0 +938 0 +939 0 +940 0 +941 0 +942 0 +943 0 +944 0 +945 0 +946 0 +947 0 +948 0 +949 0 +950 0 +951 0 +952 0 +953 0 +954 0 +955 0 +956 0 +957 0 +958 0 +959 0 +960 0 +961 0 +962 0 +963 0 +964 0 +965 0 +966 0 +967 0 +968 0 +969 0 +970 0 +971 0 +972 0 +973 0 +974 0 +975 0 +976 0 +977 0 +978 0 +979 0 +980 0 +981 0 +982 0 +983 0 +984 0 +985 0 +986 0 +987 0 +988 0 +989 0 +990 0 +991 0 +992 0 +993 0 +994 0 +995 0 +996 0 +997 0 +998 0 +999 0 +1000 0 +1001 0 +1002 0 +1003 0 +1004 0 +1005 0 +1006 0 +1007 0 +1008 0 +1009 0 +1010 0 +1011 0 +1012 0 +1013 0 +1014 0 +1015 0 +1016 0 +1017 0 +1018 0 +1019 0 +1020 0 +1021 0 +1022 0 +1023 0 +1024 0 +1025 0 +1026 0 +1027 0 +1028 0 +1029 0 +1030 0 +1031 0 +1032 0 +1033 0 +1034 0 +1035 0 +1036 0 +1037 0 +1038 0 +1039 0 +1040 0 +1041 0 +1042 0 +1043 0 +1044 0 +1045 0 +1046 0 +1047 0 +1048 0 +1049 0 +1050 0 +1051 0 +1052 0 +1053 0 +1054 0 +1055 0 +1056 0 +1057 0 +1058 0 +1059 0 +1060 0 +1061 0 +1062 0 +1063 0 +1064 0 +1065 0 +1066 0 +1067 0 +1068 0 +1069 0 +1070 0 +1071 0 +1072 0 +1073 0 +1074 0 +1075 0 +1076 0 +1077 0 +1078 0 +1079 0 +1080 0 +1081 0 +1082 0 +1083 0 +1084 0 +1085 0 +1086 0 +1087 0 +1088 0 +1089 0 +1090 0 +1091 0 +1092 0 +1093 0 +1094 0 +1095 0 +1096 0 +1097 0 +1098 0 +1099 0 +1100 0 +1101 0 +1102 0 +1103 0 +1104 0 +1105 0 +1106 0 +1107 0 +1108 0 +1109 0 +1110 0 +1111 0 +1112 0 +1113 0 +1114 0 +1115 0 +1116 0 +1117 0 +1118 0 +1119 0 +1120 0 +1121 0 +1122 0 +1123 0 +1124 0 +1125 0 +1126 0 +1127 0 +1128 0 +1129 0 +1130 0 +1131 0 +1132 0 +1133 0 +1134 0 +1135 0 +1136 0 +1137 0 +1138 0 +1139 0 +1140 0 +1141 0 +1142 0 +1143 0 +1144 0 +1145 0 +1146 0 +1147 0 +1148 0 +1149 0 +1150 0 +1151 0 +1152 0 +1153 0 +1154 0 +1155 0 +1156 0 +1157 0 +1158 0 +1159 0 +1160 0 +1161 0 +1162 0 +1163 0 +1164 0 +1165 0 +1166 0 +1167 0 +1168 0 +1169 0 +1170 0 +1171 0 +1172 0 +1173 0 +1174 0 +1175 0 +1176 0 +1177 0 +1178 0 +1179 0 +1180 0 +1181 0 +1182 0 +1183 0 +1184 0 +1185 0 +1186 0 +1187 0 +1188 0 +1189 0 +1190 0 +1191 0 +1192 0 +1193 0 +1194 0 +1195 0 +1196 0 +1197 0 +1198 0 +1199 0 +1200 0 +1201 0 +1202 0 +1203 0 +1204 0 +1205 0 +1206 0 +1207 0 +1208 0 +1209 0 +1210 0 +1211 0 +1212 0 +1213 0 +1214 0 +1215 0 +1216 0 +1217 0 +1218 0 +1219 0 +1220 0 +1221 0 +1222 0 +1223 0 +1224 0 +1225 0 +1226 0 +1227 0 +1228 0 +1229 0 +1230 0 +1231 0 +1232 0 +1233 0 +1234 0 +1235 0 +1236 0 +1237 0 +1238 0 +1239 0 +1240 0 +1241 0 +1242 0 +1243 0 +1244 0 +1245 0 +1246 0 +1247 0 +1248 0 +1249 0 +1250 0 +1251 0 +1252 0 +1253 0 +1254 0 +1255 0 +1256 0 +1257 0 +1258 0 +1259 0 +1260 0 +1261 0 +1262 0 +1263 0 +1264 0 +1265 0 +1266 0 +1267 0 +1268 0 +1269 0 +1270 0 +1271 0 +1272 0 +1273 0 +1274 0 +1275 0 +1276 0 +1277 0 +1278 0 +1279 0 +1280 0 +1281 0 +1282 0 +1283 0 +1284 0 +1285 0 +1286 0 +1287 0 +1288 0 +1289 0 +1290 0 +1291 0 +1292 0 +1293 0 +1294 0 +1295 0 +1296 0 +1297 0 +1298 0 +1299 0 +1300 0 +1301 0 +1302 0 +1303 0 +1304 0 +1305 0 +1306 0 +1307 0 +1308 0 +1309 0 +1310 0 +1311 0 +1312 0 +1313 0 +1314 0 +1315 0 +1316 0 +1317 0 +1318 0 +1319 0 +1320 0 +1321 0 +1322 0 +1323 0 +1324 0 +1325 0 +1326 0 +1327 0 +1328 0 +1329 0 +1330 0 +1331 0 +1332 0 +1333 0 +1334 0 +1335 0 +1336 0 +1337 0 +1338 0 +1339 0 +1340 0 +1341 0 +1342 0 +1343 0 +1344 0 +1345 0 +1346 0 +1347 0 +1348 0 +1349 0 +1350 0 +1351 0 +1352 0 +1353 0 +1354 0 +1355 0 +1356 0 +1357 0 +1358 0 +1359 0 +1360 0 +1361 0 +1362 0 +1363 0 +1364 0 +1365 0 +1366 0 +1367 0 +1368 0 +1369 0 +1370 0 +1371 0 +1372 0 +1373 0 +1374 0 +1375 0 +1376 0 +1377 0 +1378 0 +1379 0 +1380 0 +1381 0 +1382 0 +1383 0 +1384 0 +1385 0 +1386 0 +1387 0 +1388 0 +1389 0 +1390 0 +1391 0 +1392 0 +1393 0 +1394 0 +1395 0 +1396 0 +1397 0 +1398 0 +1399 0 +1400 0 +1401 0 +1402 0 +1403 0 +1404 0 +1405 0 +1406 0 +1407 0 +1408 0 +1409 0 +1410 0 +1411 0 +1412 0 +1413 0 +1414 0 +1415 0 +1416 0 +1417 0 +1418 0 +1419 0 +1420 0 +1421 0 +1422 0 +1423 0 +1424 0 +1425 0 +1426 0 +1427 0 +1428 0 +1429 0 +1430 0 +1431 0 +1432 0 +1433 0 +1434 0 +1435 0 +1436 0 +1437 0 +1438 0 +1439 0 +1440 0 +1441 0 +1442 0 +1443 0 +1444 0 +1445 0 +1446 0 +1447 0 +1448 0 +1449 0 +1450 0 +1451 0 +1452 0 +1453 0 +1454 0 +1455 0 +1456 0 +1457 0 +1458 0 +1459 0 +1460 0 +1461 0 +1462 0 +1463 0 +1464 0 +1465 0 +1466 0 +1467 0 +1468 0 +1469 0 +1470 0 +1471 0 +1472 0 +1473 0 +1474 0 +1475 0 +1476 0 +1477 0 +1478 0 +1479 0 +1480 0 +1481 0 +1482 0 +1483 0 +1484 0 +1485 0 +1486 0 +1487 0 +1488 0 +1489 0 +1490 0 +1491 0 +1492 0 +1493 0 +1494 0 +1495 0 +1496 0 +1497 0 +1498 0 +1499 0 +1500 0 +1501 0 +1502 0 +1503 0 +1504 0 +1505 0 +1506 0 +1507 0 +1508 0 +1509 0 +1510 0 +1511 0 +1512 0 +1513 0 +1514 0 +1515 0 +1516 0 +1517 0 +1518 0 +1519 0 +1520 0 +1521 0 +1522 0 +1523 0 +1524 0 +1525 0 +1526 0 +1527 0 +1528 0 +1529 0 +1530 0 +1531 0 +1532 0 +1533 0 +1534 0 +1535 0 +1536 0 +1537 0 +1538 0 +1539 0 +1540 0 +1541 0 +1542 0 +1543 0 +1544 0 +1545 0 +1546 0 +1547 0 +1548 0 +1549 0 +1550 0 +1551 0 +1552 0 +1553 0 +1554 0 +1555 0 +1556 0 +1557 0 +1558 0 +1559 0 +1560 0 +1561 0 +1562 0 +1563 0 +1564 0 +1565 0 +1566 0 +1567 0 +1568 0 +1569 0 +1570 0 +1571 0 +1572 0 +1573 0 +1574 0 +1575 0 +1576 0 +1577 0 +1578 0 +1579 0 +1580 0 +1581 0 +1582 0 +1583 0 +1584 0 +1585 0 +1586 0 +1587 0 +1588 0 +1589 0 +1590 0 +1591 0 +1592 0 +1593 0 +1594 0 +1595 0 +1596 0 +1597 0 +1598 0 +1599 0 +1600 0 +1601 0 +1602 0 +1603 0 +1604 0 +1605 0 +1606 0 +1607 0 +1608 0 +1609 0 +1610 0 +1611 0 +1612 0 +1613 0 +1614 0 +1615 0 +1616 0 +1617 0 +1618 0 +1619 0 +1620 0 +1621 0 +1622 0 +1623 0 +1624 0 +1625 0 +1626 0 +1627 0 +1628 0 +1629 0 +1630 0 +1631 0 +1632 0 +1633 0 +1634 0 +1635 0 +1636 0 +1637 0 +1638 0 +1639 0 +1640 0 +1641 0 +1642 0 +1643 0 +1644 0 +1645 0 +1646 0 +1647 0 +1648 0 +1649 0 +1650 0 +1651 0 +1652 0 +1653 0 +1654 0 +1655 0 +1656 0 +1657 0 +1658 0 +1659 0 +1660 0 +1661 0 +1662 0 +1663 0 +1664 0 +1665 0 +1666 0 +1667 0 +1668 0 +1669 0 +1670 0 +1671 0 +1672 0 +1673 0 +1674 0 +1675 0 +1676 0 +1677 0 +1678 0 +1679 0 +1680 0 +1681 0 +1682 0 +1683 0 +1684 0 +1685 0 +1686 0 +1687 0 +1688 0 +1689 0 +1690 0 +1691 0 +1692 0 +1693 0 +1694 0 +1695 0 +1696 0 +1697 0 +1698 0 +1699 0 +1700 0 +1701 0 +1702 0 +1703 0 +1704 0 +1705 0 +1706 0 +1707 0 +1708 0 +1709 0 +1710 0 +1711 0 +1712 0 +1713 0 +1714 0 +1715 0 +1716 0 +1717 0 +1718 0 +1719 0 +1720 0 +1721 0 +1722 0 +1723 0 +1724 0 +1725 0 +1726 0 +1727 0 +1728 0 +1729 0 +1730 0 +1731 0 +1732 0 +1733 0 +1734 0 +1735 0 +1736 0 +1737 0 +1738 0 +1739 0 +1740 0 +1741 0 +1742 0 +1743 0 +1744 0 +1745 0 +1746 0 +1747 0 +1748 0 +1749 0 +1750 0 +1751 0 +1752 0 +1753 0 +1754 0 +1755 0 +1756 0 +1757 0 +1758 0 +1759 0 +1760 0 +1761 0 +1762 0 +1763 0 +1764 0 +1765 0 +1766 0 +1767 0 +1768 0 +1769 0 +1770 0 +1771 0 +1772 0 +1773 0 +1774 0 +1775 0 +1776 0 +1777 0 +1778 0 +1779 0 +1780 0 +1781 0 +1782 0 +1783 0 +1784 0 +1785 0 +1786 0 +1787 0 +1788 0 +1789 0 +1790 0 +1791 0 +1792 0 +1793 0 +1794 0 +1795 0 +1796 0 +1797 0 +1798 0 +1799 0 +1800 0 +1801 0 +1802 0 +1803 0 +1804 0 +1805 0 +1806 0 +1807 0 +1808 0 +1809 0 +1810 0 +1811 0 +1812 0 +1813 0 +1814 0 +1815 0 +1816 0 +1817 0 +1818 0 +1819 0 +1820 0 +1821 0 +1822 0 +1823 0 +1824 0 +1825 0 +1826 0 +1827 0 +1828 0 +1829 0 +1830 0 +1831 0 +1832 0 +1833 0 +1834 0 +1835 0 +1836 0 +1837 0 +1838 0 +1839 0 +1840 0 +1841 0 +1842 0 +1843 0 +1844 0 +1845 0 +1846 0 +1847 0 +1848 0 +1849 0 +1850 0 +1851 0 +1852 0 +1853 0 +1854 0 +1855 0 +1856 0 +1857 0 +1858 0 +1859 0 +1860 0 +1861 0 +1862 0 +1863 0 +1864 0 +1865 0 +1866 0 +1867 0 +1868 0 +1869 0 +1870 0 +1871 0 +1872 0 +1873 0 +1874 0 +1875 0 +1876 0 +1877 0 +1878 0 +1879 0 +1880 0 +1881 0 +1882 0 +1883 0 +1884 0 +1885 0 +1886 0 +1887 0 +1888 0 +1889 0 +1890 0 +1891 0 +1892 0 +1893 0 +1894 0 +1895 0 +1896 0 +1897 0 +1898 0 +1899 0 +1900 0 +1901 0 +1902 0 +1903 0 +1904 0 +1905 0 +1906 0 +1907 0 +1908 0 +1909 0 +1910 0 +1911 0 +1912 0 +1913 0 +1914 0 +1915 0 +1916 0 +1917 0 +1918 0 +1919 0 +1920 0 +1921 0 +1922 0 +1923 0 +1924 0 +1925 0 +1926 0 +1927 0 +1928 0 +1929 0 +1930 0 +1931 0 +1932 0 +1933 0 +1934 0 +1935 0 +1936 0 +1937 0 +1938 0 +1939 0 +1940 0 +1941 0 +1942 0 +1943 0 +1944 0 +1945 0 +1946 0 +1947 0 +1948 0 +1949 0 +1950 0 +1951 0 +1952 0 +1953 0 +1954 0 +1955 0 +1956 0 +1957 0 +1958 0 +1959 0 +1960 0 +1961 0 +1962 0 +1963 0 +1964 0 +1965 0 +1966 0 +1967 0 +1968 0 +1969 0 +1970 0 +1971 0 +1972 0 +1973 0 +1974 0 +1975 0 +1976 0 +1977 0 +1978 0 +1979 0 +1980 0 +1981 0 +1982 0 +1983 0 +1984 0 +1985 0 +1986 0 +1987 0 +1988 0 +1989 0 +1990 0 +1991 0 +1992 0 +1993 0 +1994 0 +1995 0 +1996 0 +1997 0 +1998 0 +1999 0 +2000 0 +2001 0 +2002 0 +2003 0 +2004 0 +2005 0 +2006 0 +2007 0 +2008 0 +2009 0 +2010 0 +2011 0 +2012 0 +2013 0 +2014 0 +2015 0 +2016 0 +2017 0 +2018 0 +2019 0 +2020 0 +2021 0 +2022 0 +2023 0 +2024 0 +2025 0 +2026 0 +2027 0 +2028 0 +2029 0 +2030 0 +2031 0 +2032 0 +2033 0 +2034 0 +2035 0 +2036 0 +2037 0 +2038 0 +2039 0 +2040 0 +2041 0 +2042 0 +2043 0 +2044 0 +2045 0 +2046 0 +2047 0 +2048 0 +2049 0 +2050 0 +2051 0 +2052 0 +2053 0 +2054 0 +2055 0 +2056 0 +2057 0 +2058 0 +2059 0 +2060 0 +2061 0 +2062 0 +2063 0 +2064 0 +2065 0 +2066 0 +2067 0 +2068 0 +2069 0 +2070 0 +2071 0 +2072 0 +2073 0 +2074 0 +2075 0 +2076 0 +2077 0 +2078 0 +2079 0 +2080 0 +2081 0 +2082 0 +2083 0 diff --git a/evidence/allen-omega-L694/L740/independent-review/parent-verification.md b/evidence/allen-omega-L694/L740/independent-review/parent-verification.md new file mode 100644 index 00000000..b8c4c404 --- /dev/null +++ b/evidence/allen-omega-L694/L740/independent-review/parent-verification.md @@ -0,0 +1,20 @@ +# L744 parent verification + +No correctness finding at exact a65b70eb99a4d132c8c1f657f5cbb2a2fc1cd81d. +All16 exported source files match pinned Git bytes. Independently reconstructed +final probe concatenation: base, vendor/sha256-core, runtime, code, courier, +scheduler, memory, intent, reply, view, scene, scene-input, tests/check, then +probes/scene-independent-v3.om. Reported bundle and ELF hashes match actual bytes. +Parent rebuilt final probe byte-identically and ran2084/2084 assertions,exit0. +The published63-check scene-input suite also remains green in the current full +gate. Scene product/test files are unchanged from the reviewed pin. + +Original v1 expected two hidden lines but its fixture has three (opening line, +inside line, closing line). The already-published contract hides all three; +corrected v2 and added-boundaries v3 did not alter production. Original failure, +probe revisions and report are preserved. This clears only L740/L744 scene core, +not new L746 context, application/display attachment or target qualification. + +Report SHA:e3ca62be1d5876da089c86852874f380c6c9876bf7d9e1a375ffc049804ef421. +Bundle SHA:2c1c00919db88b0b40e294b23f4d4431d1d3638e2c9eb2e371c194a8e5c9886e. +ELF SHA:9c47cbb650c222bf0ac310664c00b316638dbf85dc6f32621f799142b8dfc94b. diff --git a/evidence/allen-omega-L694/L740/independent-review/probes/scene-independent-v1.om b/evidence/allen-omega-L694/L740/independent-review/probes/scene-independent-v1.om new file mode 100644 index 00000000..31f2c7ce --- /dev/null +++ b/evidence/allen-omega-L694/L740/independent-review/probes/scene-independent-v1.om @@ -0,0 +1,58 @@ +text Thought "secret\nsay: hidden\n\nsay: KeEp My CASE\n" +text Bad "number: nope\n" +text Fallback "Plain words survive.\n" +global Saved uchar 2048 +fn test ok bool to void +check ok get Checks 0 +end +fn main to int +put Inlen 0 len Thought +for i ulong len Thought +put In i get Thought i +put Saved i get Thought i +end +test scdecode +test eq get Nm 3 2 +test eq get Sc 2 1 +same = true +for i ulong len Thought +if ne get In i get Saved i +same = false +end +end +test same +test eq get Inlen 0 len Thought +test eq get Stext get Sw 3 75 +put Inlen 0 len Bad +for i ulong len Bad +put In i get Bad i +end +test not scdecode +test eq get Sc 2 0 +test eq get Sc 3 0 +test eq get Nm 0 0 +test eq get Inlen 0 len Bad +for i ulong len Bad +test eq get In i get Bad i +end +put Inlen 0 len Fallback +for i ulong len Fallback +put In i get Fallback i +end +test scdecode +test eq get Sc 2 1 +test eq get Stext get Sw 3 80 +put Inlen 0 2048 +for i ulong 2048 +put In i 120 +end +test not scdecode +test eq get Nm 6 1 +test eq get Sc 2 0 +test eq get Sc 3 0 +test eq get Inlen 0 2048 +for i ulong 2048 +test eq get In i 120 +end +ret int get Fails 0 +end diff --git a/evidence/allen-omega-L694/L740/independent-review/probes/scene-independent-v2.om b/evidence/allen-omega-L694/L740/independent-review/probes/scene-independent-v2.om new file mode 100644 index 00000000..b557f1b9 --- /dev/null +++ b/evidence/allen-omega-L694/L740/independent-review/probes/scene-independent-v2.om @@ -0,0 +1,58 @@ +text Thought "secret\nsay: hidden\n\nsay: KeEp My CASE\n" +text Bad "number: nope\n" +text Fallback "Plain words survive.\n" +global Saved uchar 2048 +fn test ok bool to void +check ok get Checks 0 +end +fn main to int +put Inlen 0 len Thought +for i ulong len Thought +put In i get Thought i +put Saved i get Thought i +end +test scdecode +test eq get Nm 3 3 +test eq get Sc 2 1 +same = true +for i ulong len Thought +if ne get In i get Saved i +same = false +end +end +test same +test eq get Inlen 0 len Thought +test eq get Stext get Sw 3 75 +put Inlen 0 len Bad +for i ulong len Bad +put In i get Bad i +end +test not scdecode +test eq get Sc 2 0 +test eq get Sc 3 0 +test eq get Nm 0 0 +test eq get Inlen 0 len Bad +for i ulong len Bad +test eq get In i get Bad i +end +put Inlen 0 len Fallback +for i ulong len Fallback +put In i get Fallback i +end +test scdecode +test eq get Sc 2 1 +test eq get Stext get Sw 3 80 +put Inlen 0 2048 +for i ulong 2048 +put In i 120 +end +test not scdecode +test eq get Nm 6 1 +test eq get Sc 2 0 +test eq get Sc 3 0 +test eq get Inlen 0 2048 +for i ulong 2048 +test eq get In i 120 +end +ret int get Fails 0 +end diff --git a/evidence/allen-omega-L694/L740/independent-review/probes/scene-independent-v3.om b/evidence/allen-omega-L694/L740/independent-review/probes/scene-independent-v3.om new file mode 100644 index 00000000..5df72446 --- /dev/null +++ b/evidence/allen-omega-L694/L740/independent-review/probes/scene-independent-v3.om @@ -0,0 +1,66 @@ +text Thought "secret\nsay: hidden\n\nsay: KeEp My CASE\n" +text Bad "number: nope\n" +text Fallback "Plain words survive.\n" +global Saved uchar 2048 +fn test ok bool to void +check ok get Checks 0 +end +fn main to int +put Inlen 0 len Thought +for i ulong len Thought +put In i get Thought i +put Saved i get Thought i +end +test scdecode +test eq get Nm 3 3 +test eq get Sc 2 1 +same = true +for i ulong len Thought +if ne get In i get Saved i +same = false +end +end +test same +test eq get Inlen 0 len Thought +test eq get Stext get Sw 3 75 +put Inlen 0 len Bad +for i ulong len Bad +put In i get Bad i +end +test not scdecode +test eq get Sc 2 0 +test eq get Sc 3 0 +test eq get Nm 0 0 +test eq get Inlen 0 len Bad +for i ulong len Bad +test eq get In i get Bad i +end +put Inlen 0 len Fallback +for i ulong len Fallback +put In i get Fallback i +end +test scdecode +test eq get Sc 2 1 +test eq get Stext get Sw 3 80 +put Inlen 0 2047 +for i ulong 2047 +put In i 120 +end +test not scdecode +test eq get Nm 6 0 +test eq get Nm 1 2048 +test eq get Inlen 0 2047 +put Inlen 0 2048 +for i ulong 2048 +put In i 120 +end +test not scdecode +test eq get Nm 6 1 +test eq get Sc 2 0 +test eq get Sc 3 0 +test eq get Inlen 0 2048 +for i ulong 2048 +test eq get In i 120 +end +ret int get Fails 0 +end diff --git a/evidence/allen-omega-L694/L740/independent-review/probes/scene-independent.om b/evidence/allen-omega-L694/L740/independent-review/probes/scene-independent.om new file mode 100644 index 00000000..31f2c7ce --- /dev/null +++ b/evidence/allen-omega-L694/L740/independent-review/probes/scene-independent.om @@ -0,0 +1,58 @@ +text Thought "secret\nsay: hidden\n\nsay: KeEp My CASE\n" +text Bad "number: nope\n" +text Fallback "Plain words survive.\n" +global Saved uchar 2048 +fn test ok bool to void +check ok get Checks 0 +end +fn main to int +put Inlen 0 len Thought +for i ulong len Thought +put In i get Thought i +put Saved i get Thought i +end +test scdecode +test eq get Nm 3 2 +test eq get Sc 2 1 +same = true +for i ulong len Thought +if ne get In i get Saved i +same = false +end +end +test same +test eq get Inlen 0 len Thought +test eq get Stext get Sw 3 75 +put Inlen 0 len Bad +for i ulong len Bad +put In i get Bad i +end +test not scdecode +test eq get Sc 2 0 +test eq get Sc 3 0 +test eq get Nm 0 0 +test eq get Inlen 0 len Bad +for i ulong len Bad +test eq get In i get Bad i +end +put Inlen 0 len Fallback +for i ulong len Fallback +put In i get Fallback i +end +test scdecode +test eq get Sc 2 1 +test eq get Stext get Sw 3 80 +put Inlen 0 2048 +for i ulong 2048 +put In i 120 +end +test not scdecode +test eq get Nm 6 1 +test eq get Sc 2 0 +test eq get Sc 3 0 +test eq get Inlen 0 2048 +for i ulong 2048 +test eq get In i 120 +end +ret int get Fails 0 +end diff --git a/evidence/allen-omega-L694/L740/independent-review/report.md b/evidence/allen-omega-L694/L740/independent-review/report.md new file mode 100644 index 00000000..2718fbc5 --- /dev/null +++ b/evidence/allen-omega-L694/L740/independent-review/report.md @@ -0,0 +1,41 @@ +# L744 independent review — L740 native Omega scene decoder + +## Verdict + +No correctness finding in the reviewed `scdecode` scope at `a65b70eb99a4d132c8c1f657f5cbb2a2fc1cd81d`. The implementation behaved as documented on the focused upstream test and independent boundary/recovery probes below. This does not approve application attachment, full Allen parity, target UI, hardware, service, or deployment. + +## Immutable source and execution closure + +- Spark checkout: `/home/drakestapleton/workspace/aienos-allen-omega-L694` +- Exact HEAD: `a65b70eb99a4d132c8c1f657f5cbb2a2fc1cd81d`; parent: `8d0d11babf7cc3b57ee000a265aeda9fe531ebf0`; checkout porcelain status count: `0`. +- Exported required source using `git archive ... | tar -x` under `/home/drakestapleton/handoffs/L744-review/source`. `git hash-object` matched pinned Git blobs for `scene-input.om` (`48c58ce8702d5108bfe4114ed53e363195f7e578`), `tests/scene-input.om` (`51ef9bf7259a9d41625f6cca20fe60fbc1240a5f`), strict `scene.om` (`376fd36150c85bd2e9774e8e7a1ef7204911457d`), `README.md` (`dfaa4d1cce2cdcc3c7e4c1d77f2aecc6cca3b111`) and `build-one.sh` (`c2c303dbb96bc3f9e7449983ce30cf39e64cbd55`). +- Pinned compiler `/home/drakestapleton/handoffs/allen-omega-L694/omc`, SHA256 `191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9`. Each binary was built by exported `build-one.sh`, which checked that hash and required nonempty static AArch64 EXEC output. `readelf` confirmed `Type: EXEC` and `Machine: AArch64` for both. + +## Executed probes and receipts + +All new executable probe logic is handwritten Omega; shell only assembled source, invoked the pinned build, ran binaries and collected logs. + +1. **Focused pinned test, independently rebuilt:** concatenated exported dependencies, strict `scene.om`, `scene-input.om`, `tests/check.om` and pinned `tests/scene-input.om`; ran `build-one.sh` then `outputs/upstream-scene-test`. Exit `0`; 63 check lines, zero failure (`1`) lines. ELF SHA256 `4f4490e78b193ae6b1f4df12700db73dde18f7e7ffd5a9e3bfd76f5c5d873774`. Source bundle SHA256 `2f6b3345cf8e0633c0217d141929b2d961b044f78a258c46ead9a0d106885151`. +2. **Independent Omega probe:** `probes/scene-independent-v3.om`; checks mixed-case thought tags and hidden-line behavior, visible mixed-case text, exact caller input/length restoration, malformed known `number:` refusal without fallback, plain-text fallback, 2047-byte input normalizing to exactly 2048 bytes, and 2048-byte unterminated input whose appended newline overflows normalization (full refusal and cleared metadata). Rebuilt from exported source and ran `outputs/scene-independent-v3`; exit `0`, 2084/2084 assertions pass. ELF SHA256 `9c47cbb650c222bf0ac310664c00b316638dbf85dc6f32621f799142b8dfc94b`; complete Omega source bundle SHA256 `2c1c00919db88b0b40e294b23f4d4431d1d3638e2c9eb2e371c194a8e5c9886e`. +3. **Preserved probe iteration:** v1 expected two hidden lines for `secret\nsay: hidden\n`, but actual was three: the opening-tag line, enclosed line and closing-tag line are all hidden. This was a mistaken probe expectation, not a product failure. v1 compiled to a valid executable and failed only check 1 (`outputs/scene-independent.log`, exit 1). Corrected v2 changed only expected hidden-line count to 3 and passed. v3 adds exact 2047/2048 normalization-boundary assertions. All revisions remain in `probes/` and corresponding `outputs/`. + +## Source review notes + +- `scene-input.om` locations: `nmatch` line 20; bounded `nemit` line 31; thought/fence/canonical-line handling in `nprocess` line 126; malformed-known versus prose fallback in `nappend` line 187; metadata reset in `nclear` line 232; snapshot/normalize/parse/restore transaction in `scdecode` line 241. README contract/attachment caveat: lines 76–95. +- `scene-input.om`: `nmatch` performs ASCII case-folded byte-exact matching of `` and ``; `nprocess` hides tag-bearing lines and all lines while the state is open, including the unclosed-to-end case. The probe confirms mixed-case tags do not expose enclosed text. +- `nemit` bounds normalized output before writing; overflow sets `Nm[6]`, and `scdecode` clears scene metadata instead of parsing partial output. Probe observed 2047 raw bytes plus synthesized LF => exactly 2048 normalized bytes, while 2048 raw bytes without LF are refused because normalization would require byte 2049. +- `scdecode` snapshots bytes before normalization, publishes normalized bytes only during `scene` / fallback parsing, then restores all `n` input bytes and `Inlen`; malformed-known-command, fallback and overflow calls were followed by checks of unchanged input and refreshed metadata. +- `nprocess` tracks only the first 12 nonempty eligible canonical lines; hidden thought lines and fence lines return before incrementing that count. Pinned test covers canonical-line fallback/mood cap; this review did not rerun the full Allen suite. +- `nappend` keeps malformed recognized structured keywords out of prose fallback while allowing the first short unknown line if no recognized scene is accepted. Independent malformed-number and plain-text cases passed. +- README explicitly says this API is not yet attached to the application reply/display provider; that integration and full visual/target parity remain unqualified. + +## Commands / raw receipts + +Compiler/build pattern (run on Spark): + +```sh +/native/omega/allen/build-one.sh + > +``` + +Artifacts, Omega probe revisions, binaries and logs are retained under `/home/drakestapleton/handoffs/L744-review/{source,probes,outputs}`. Parent's prior full 1337-check / mutant evidence was not rerun; this review re-executed only the focused scene-input test and new focused probes. diff --git a/evidence/allen-omega-L694/L740/independent-review/source-closure.sha256 b/evidence/allen-omega-L694/L740/independent-review/source-closure.sha256 new file mode 100644 index 00000000..fea33e38 --- /dev/null +++ b/evidence/allen-omega-L694/L740/independent-review/source-closure.sha256 @@ -0,0 +1,16 @@ +026fbf4376c85993a23d66cfab302440ebc26544c7f07405bedae50cf0f1b701 native/omega/allen/README.md +184f4270c72c4eca6a7afdd28b70a608f2e237980b12c8a7bfc2c7d2c3e625b9 native/omega/allen/base.om +795ca28627a19f1088de0f23277e79cdac921ff88451c606c7b655ce0f2e8a5b native/omega/allen/build-one.sh +4d2235ac5d6b237695b1c3112f70ebdfa0cebafa2ec8e691e4be4de37a62199b native/omega/allen/code.om +76ee9cdeaac036905c76dfa29f42bf5a78d1259ad1656adfaa24916c3b93550d native/omega/allen/courier.om +06087bc573ebb876a0ed80f6025c592fb4b1d23335169c3da402824fd1482c35 native/omega/allen/intent.om +068292abd04d3a61b063fc5380b22a56c4235a87915c219ebf3b37d16d7bc9c7 native/omega/allen/memory.om +e50a7f673aaee92aba4a3aec303aa93b071121c09ad05d4ad1dcc2deb9706dcc native/omega/allen/reply.om +5b01eae03204d08f6d207ef29f2ba09a1d9f249f1738f68f151214675a4ff2ed native/omega/allen/runtime.om +c16d61dbcb81f7ef8196c937929a53e47de3de0015e5d663bcd8e49b3cb05002 native/omega/allen/scene-input.om +c8d4a437b41538cc1eeb62a2029c6993d41e5ef90cc7b26c8e1c92bc98ec57d3 native/omega/allen/scene.om +615dff78462a715153b3d891b2cfe146c318d3a0a26ae1aaa642484f965c12df native/omega/allen/scheduler.om +f085198549d1c235a97574ff6f6560ce82217611f4051fc3dbbc8286aab6d536 native/omega/allen/tests/check.om +c5847b4ea0c7df81691fadf9af2f258ad02d3fa588a400448f6d34d7819570b4 native/omega/allen/tests/scene-input.om +992ec4a4957271b442740598136887a5c610effcd8ae9fb9480a006a4f181097 native/omega/allen/vendor/sha256-core.om +abbefd2f7dc48f2ac28b9526f5c2e5b369da4b7c5e84dde6e6a3cd20bd5687ac native/omega/allen/view.om diff --git a/evidence/allen-omega-L694/L740/intent.log b/evidence/allen-omega-L694/L740/intent.log new file mode 100644 index 00000000..5371bd36 --- /dev/null +++ b/evidence/allen-omega-L694/L740/intent.log @@ -0,0 +1,8 @@ +501 0 +502 0 +503 0 +504 0 +505 0 +506 0 +507 0 +508 0 diff --git a/evidence/allen-omega-L694/L740/keepalive-mutant.log b/evidence/allen-omega-L694/L740/keepalive-mutant.log new file mode 100644 index 00000000..2e3415df --- /dev/null +++ b/evidence/allen-omega-L694/L740/keepalive-mutant.log @@ -0,0 +1,213 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 1 +19 1 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 1 +54 1 +55 1 +56 1 +57 0 +58 0 +59 1 +60 0 +61 0 +62 0 +63 0 +64 0 +65 1 +66 0 +67 0 +68 0 +69 1 +70 1 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 1 +170 0 +171 1 +172 1 +173 0 +174 1 +175 0 +176 0 +177 0 +178 1 +179 1 +180 1 +181 1 +182 1 +183 1 +184 1 +185 1 +186 1 +187 1 +188 1 +189 1 +190 1 +191 1 +192 1 +193 1 +194 1 +195 1 +196 1 +197 1 +198 0 +199 1 +200 0 +201 0 +202 1 +203 1 +204 1 +205 0 +206 1 +207 1 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 diff --git a/evidence/allen-omega-L694/L740/long.log b/evidence/allen-omega-L694/L740/long.log new file mode 100644 index 00000000..0a060bc8 --- /dev/null +++ b/evidence/allen-omega-L694/L740/long.log @@ -0,0 +1,292 @@ +401 0 +410 0 +411 0 +412 0 +413 0 +414 0 +415 0 +416 0 +417 0 +418 0 +419 0 +420 0 +421 0 +422 0 +423 0 +424 0 +425 0 +426 0 +427 0 +428 0 +429 0 +430 0 +431 0 +432 0 +433 0 +434 0 +435 0 +436 0 +437 0 +438 0 +439 0 +440 0 +441 0 +442 0 +443 0 +444 0 +445 0 +446 0 +447 0 +448 0 +449 0 +450 0 +451 0 +452 0 +453 0 +454 0 +455 0 +456 0 +457 0 +458 0 +459 0 +460 0 +461 0 +462 0 +463 0 +464 0 +465 0 +466 0 +467 0 +468 0 +469 0 +470 0 +471 0 +472 0 +473 0 +474 0 +475 0 +476 0 +477 0 +478 0 +479 0 +480 0 +481 0 +482 0 +483 0 +484 0 +485 0 +486 0 +487 0 +488 0 +489 0 +490 0 +491 0 +492 0 +493 0 +494 0 +495 0 +496 0 +497 0 +498 0 +499 0 +500 0 +501 0 +502 0 +503 0 +504 0 +505 0 +506 0 +507 0 +508 0 +509 0 +510 0 +511 0 +512 0 +513 0 +514 0 +515 0 +516 0 +517 0 +518 0 +519 0 +520 0 +521 0 +522 0 +523 0 +524 0 +525 0 +526 0 +527 0 +528 0 +529 0 +530 0 +531 0 +532 0 +533 0 +534 0 +535 0 +536 0 +537 0 +538 0 +539 0 +540 0 +541 0 +542 0 +543 0 +544 0 +545 0 +546 0 +547 0 +548 0 +549 0 +550 0 +402 0 +403 0 +404 0 +405 0 +406 0 +700 0 +701 0 +702 0 +703 0 +704 0 +705 0 +706 0 +707 0 +708 0 +709 0 +710 0 +711 0 +712 0 +713 0 +714 0 +715 0 +716 0 +717 0 +718 0 +719 0 +720 0 +721 0 +722 0 +723 0 +724 0 +725 0 +726 0 +727 0 +728 0 +729 0 +730 0 +731 0 +732 0 +733 0 +734 0 +735 0 +736 0 +737 0 +738 0 +739 0 +740 0 +741 0 +742 0 +743 0 +744 0 +745 0 +746 0 +747 0 +748 0 +749 0 +750 0 +751 0 +752 0 +753 0 +754 0 +755 0 +756 0 +757 0 +758 0 +759 0 +760 0 +761 0 +762 0 +763 0 +764 0 +765 0 +766 0 +767 0 +768 0 +769 0 +770 0 +771 0 +772 0 +773 0 +774 0 +775 0 +776 0 +777 0 +778 0 +779 0 +780 0 +781 0 +782 0 +783 0 +784 0 +785 0 +786 0 +787 0 +788 0 +789 0 +790 0 +791 0 +792 0 +793 0 +794 0 +795 0 +796 0 +797 0 +798 0 +799 0 +800 0 +801 0 +802 0 +803 0 +804 0 +805 0 +806 0 +807 0 +808 0 +809 0 +810 0 +811 0 +812 0 +813 0 +814 0 +815 0 +816 0 +817 0 +818 0 +819 0 +820 0 +821 0 +822 0 +823 0 +824 0 +825 0 +826 0 +827 0 +828 0 +829 0 +830 0 +831 0 +832 0 +833 0 +834 0 +835 0 +836 0 +837 0 +838 0 +839 0 +840 0 +841 0 +407 0 +408 0 +409 0 diff --git a/evidence/allen-omega-L694/L740/memory.log b/evidence/allen-omega-L694/L740/memory.log new file mode 100644 index 00000000..5928102e --- /dev/null +++ b/evidence/allen-omega-L694/L740/memory.log @@ -0,0 +1,79 @@ +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 0 +310 0 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +362 0 +363 0 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 0 +361 0 diff --git a/evidence/allen-omega-L694/L740/paint.log b/evidence/allen-omega-L694/L740/paint.log new file mode 100644 index 00000000..281a5bd2 --- /dev/null +++ b/evidence/allen-omega-L694/L740/paint.log @@ -0,0 +1,11 @@ +1101 0 +1102 0 +1103 0 +1104 0 +1105 0 +1106 0 +1107 0 +1108 0 +1109 0 +1110 0 +1111 0 diff --git a/evidence/allen-omega-L694/L740/pendingwire-mutant.log b/evidence/allen-omega-L694/L740/pendingwire-mutant.log new file mode 100644 index 00000000..48fb2008 --- /dev/null +++ b/evidence/allen-omega-L694/L740/pendingwire-mutant.log @@ -0,0 +1,182 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 1 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 diff --git a/evidence/allen-omega-L694/L740/readback-mutant.log b/evidence/allen-omega-L694/L740/readback-mutant.log new file mode 100644 index 00000000..268002ad --- /dev/null +++ b/evidence/allen-omega-L694/L740/readback-mutant.log @@ -0,0 +1,79 @@ +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 0 +310 0 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 1 +339 1 +340 0 +341 0 +342 0 +343 0 +344 1 +345 0 +346 0 +347 0 +348 0 +349 1 +350 1 +351 0 +352 0 +362 0 +363 0 +353 1 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 1 +361 0 diff --git a/evidence/allen-omega-L694/L740/red2.exit b/evidence/allen-omega-L694/L740/red2.exit new file mode 100644 index 00000000..64bb6b74 --- /dev/null +++ b/evidence/allen-omega-L694/L740/red2.exit @@ -0,0 +1 @@ +30 diff --git a/evidence/allen-omega-L694/L740/red2.log b/evidence/allen-omega-L694/L740/red2.log new file mode 100644 index 00000000..783446bc --- /dev/null +++ b/evidence/allen-omega-L694/L740/red2.log @@ -0,0 +1,54 @@ +1 1 +2 1 +3 1 +4 1 +5 1 +6 1 +7 1 +8 0 +9 0 +10 1 +11 0 +12 1 +13 1 +14 0 +15 1 +16 1 +17 0 +18 1 +19 1 +20 1 +21 0 +22 0 +23 0 +24 1 +25 1 +26 1 +27 0 +28 1 +29 1 +30 0 +31 1 +32 0 +33 0 +34 0 +35 1 +36 1 +37 1 +38 0 +39 1 +40 1 +41 0 +42 0 +43 1 +44 1 +45 0 +46 0 +47 1 +48 0 +49 0 +50 0 +51 1 +52 0 +53 0 +54 0 diff --git a/evidence/allen-omega-L694/L740/red2.om b/evidence/allen-omega-L694/L740/red2.om new file mode 100644 index 00000000..738ab470 --- /dev/null +++ b/evidence/allen-omega-L694/L740/red2.om @@ -0,0 +1,3063 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +global Nm ulong 8 +fn scdecode to bool +ret false +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +text Fancy "\t- **SaY**:\tKeep My CASE.~\n> NOTE RIGHT WARM: Title | Body TEXT\n" +text Private "say secret\nnote: secret | hidden\n\n```scene\nsay Visible\n```\n" +text Inline "say public secret\nsay Safe\n" +text Unclosed "never closed\nsay secret\n" +text Plain "Hello there.\nAnother sentence.\n" +text Mixed "Unrecognized text.\nnote: Heading | Body\n" +text Invalid "number: nope\n" +text Moodonly "MOOD Dawn Lively\n" +text Listmark "1. note left: Heading | Body\n" +text Wanted "Keep My CASE." +text Vis "Visible" +text Hello "Hello there." +global Savedin uchar 2048 +fn test ok bool to void +check ok add get Checks 0 1 +end +fn load which ulong to void +if eq which 0 +put Inlen 0 len Fancy +for i ulong len Fancy +c = get Fancy i +if eq c 126 +c = uchar 13 +end +put In i c +end +end +if eq which 1 +put Inlen 0 len Private +for i ulong len Private +put In i get Private i +end +end +if eq which 2 +put Inlen 0 len Inline +for i ulong len Inline +put In i get Inline i +end +end +if eq which 3 +put Inlen 0 len Unclosed +for i ulong len Unclosed +put In i get Unclosed i +end +end +if eq which 4 +put Inlen 0 len Plain +for i ulong len Plain +put In i get Plain i +end +end +if eq which 5 +put Inlen 0 len Mixed +for i ulong len Mixed +put In i get Mixed i +end +end +if eq which 6 +put Inlen 0 len Invalid +for i ulong len Invalid +put In i get Invalid i +end +end +if eq which 7 +put Inlen 0 len Moodonly +for i ulong len Moodonly +put In i get Moodonly i +end +end +if eq which 8 +put Inlen 0 len Listmark +for i ulong len Listmark +put In i get Listmark i +end +end +end +fn main to int +load 0 +n = get Inlen 0 +for i ulong n +put Savedin i get In i +end +test scdecode +test eq get Sc 2 1 +test eq get Sc 3 1 +test eq get Things 0 1 +test eq get Things 1 2 +test eq get Things 4 1 +test gt get Nm 2 0 +test eq get Inlen 0 n +same = true +for i ulong n +if ne get In i get Savedin i +same = false +end +end +test same +same = true +for i ulong len Wanted +if ne get Stext add get Sw 3 i get Wanted i +same = false +end +end +test same +test eq get Stext add get Sw 3 len Wanted 0 +load 1 +test scdecode +test eq get Sc 2 1 +test eq get Sc 3 0 +test eq get Nm 3 3 +same = true +for i ulong len Vis +if ne get Stext add get Sw 3 i get Vis i +same = false +end +end +test same +test eq get Stext add get Sw 3 len Vis 0 +load 2 +test scdecode +test eq get Nm 3 1 +test eq get Stext get Sw 3 83 +load 3 +test not scdecode +test eq get Sc 2 0 +test eq get Sc 3 0 +test eq get Nm 0 1 +load 4 +test scdecode +test eq get Sc 2 1 +test eq get Sc 3 0 +same = true +for i ulong len Hello +if ne get Stext add get Sw 3 i get Hello i +same = false +end +end +test same +load 5 +test scdecode +test eq get Sc 2 0 +test eq get Sc 3 1 +load 6 +test not scdecode +test eq get Sc 2 0 +test eq get Sc 3 0 +load 7 +test scdecode +test eq get Sc 0 1 +test eq get Sc 1 2 +test eq get Sc 2 0 +load 8 +test scdecode +test eq get Things 1 1 +put Inlen 0 160 +for i ulong 160 +put In i 120 +end +test not scdecode +test eq get Sc 2 0 +put Inlen 0 159 +test scdecode +test eq get Sc 2 1 +test eq get Stext add get Sw 3 159 0 +put Inlen 0 2049 +test not scdecode +test eq get Nm 6 1 +test eq get Sc 2 0 +test eq get Sc 3 0 +load 4 +put In 2 0 +test not scdecode +test eq get Nm 6 1 +test eq get In 2 0 +put Inlen 0 0 +test not scdecode +test eq get Sc 2 0 +ret int get Fails 0 +end diff --git a/evidence/allen-omega-L694/L740/reply.log b/evidence/allen-omega-L694/L740/reply.log new file mode 100644 index 00000000..d11a72ad --- /dev/null +++ b/evidence/allen-omega-L694/L740/reply.log @@ -0,0 +1,15 @@ +801 0 +802 0 +803 0 +804 0 +805 0 +806 0 +807 0 +808 0 +809 0 +810 0 +811 0 +812 0 +813 0 +814 0 +815 0 diff --git a/evidence/allen-omega-L694/L740/runtime.log b/evidence/allen-omega-L694/L740/runtime.log new file mode 100644 index 00000000..5168e6f3 --- /dev/null +++ b/evidence/allen-omega-L694/L740/runtime.log @@ -0,0 +1,28 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 diff --git a/evidence/allen-omega-L694/L740/scene-input.log b/evidence/allen-omega-L694/L740/scene-input.log new file mode 100644 index 00000000..edd8e122 --- /dev/null +++ b/evidence/allen-omega-L694/L740/scene-input.log @@ -0,0 +1,63 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 diff --git a/evidence/allen-omega-L694/L740/scene.log b/evidence/allen-omega-L694/L740/scene.log new file mode 100644 index 00000000..44a4b2b1 --- /dev/null +++ b/evidence/allen-omega-L694/L740/scene.log @@ -0,0 +1,14 @@ +1001 0 +1002 0 +1003 0 +1004 0 +1005 0 +1006 0 +1007 0 +1008 0 +1009 0 +1010 0 +1011 0 +1012 0 +1013 0 +1014 0 diff --git a/evidence/allen-omega-L694/L740/scenecap-mutant.log b/evidence/allen-omega-L694/L740/scenecap-mutant.log new file mode 100644 index 00000000..502843ec --- /dev/null +++ b/evidence/allen-omega-L694/L740/scenecap-mutant.log @@ -0,0 +1,63 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 1 +60 0 +61 0 +62 1 +63 1 diff --git a/evidence/allen-omega-L694/L740/scheduler.log b/evidence/allen-omega-L694/L740/scheduler.log new file mode 100644 index 00000000..1d8ffd12 --- /dev/null +++ b/evidence/allen-omega-L694/L740/scheduler.log @@ -0,0 +1,213 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 +183 0 +184 0 +185 0 +186 0 +187 0 +188 0 +189 0 +190 0 +191 0 +192 0 +193 0 +194 0 +195 0 +196 0 +197 0 +198 0 +199 0 +200 0 +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 diff --git a/evidence/allen-omega-L694/L740/session-mutant.log b/evidence/allen-omega-L694/L740/session-mutant.log new file mode 100644 index 00000000..9ce7ef78 --- /dev/null +++ b/evidence/allen-omega-L694/L740/session-mutant.log @@ -0,0 +1,24 @@ +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 1 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 diff --git a/evidence/allen-omega-L694/L740/short.log b/evidence/allen-omega-L694/L740/short.log new file mode 100644 index 00000000..a9da2dc8 --- /dev/null +++ b/evidence/allen-omega-L694/L740/short.log @@ -0,0 +1,20 @@ +401 0 +410 0 +411 0 +412 0 +413 0 +414 0 +402 0 +403 0 +404 0 +405 0 +406 0 +700 0 +701 0 +702 0 +703 0 +704 0 +705 0 +407 0 +408 0 +409 0 diff --git a/evidence/allen-omega-L694/L740/source.sha256 b/evidence/allen-omega-L694/L740/source.sha256 new file mode 100644 index 00000000..b3368fdf --- /dev/null +++ b/evidence/allen-omega-L694/L740/source.sha256 @@ -0,0 +1,41 @@ +68f02db782e9c5a506e64972123129c9cc761c78ce6f39e40d2eb7c73394bcfe native/omega/allen/application.om +184f4270c72c4eca6a7afdd28b70a608f2e237980b12c8a7bfc2c7d2c3e625b9 native/omega/allen/base.om +795ca28627a19f1088de0f23277e79cdac921ff88451c606c7b655ce0f2e8a5b native/omega/allen/build-one.sh +4d2235ac5d6b237695b1c3112f70ebdfa0cebafa2ec8e691e4be4de37a62199b native/omega/allen/code.om +76ee9cdeaac036905c76dfa29f42bf5a78d1259ad1656adfaa24916c3b93550d native/omega/allen/courier.om +4952ec81822586a6018b32ffaf0ad4de50320e195b5c509c6b4bb4b9da96241c native/omega/allen/gate.sh +9d71a653870eeef678f95df04db9c38aedaadd06e7c74bf3e5d9fde6e28f82f8 native/omega/allen/golden.sh +06087bc573ebb876a0ed80f6025c592fb4b1d23335169c3da402824fd1482c35 native/omega/allen/intent.om +4bc37c95d553364c5d2925d8ff9e8a53b1a61974513e6f492f77b7ebb05bbda4 native/omega/allen/main.om +068292abd04d3a61b063fc5380b22a56c4235a87915c219ebf3b37d16d7bc9c7 native/omega/allen/memory.om +b4d7b6e6cd680d2ba1eec2978b0cbb81ffc63035b73f5c3726bdad97a7b6aa04 native/omega/allen/paint.om +026fbf4376c85993a23d66cfab302440ebc26544c7f07405bedae50cf0f1b701 native/omega/allen/README.md +e50a7f673aaee92aba4a3aec303aa93b071121c09ad05d4ad1dcc2deb9706dcc native/omega/allen/reply.om +5b01eae03204d08f6d207ef29f2ba09a1d9f249f1738f68f151214675a4ff2ed native/omega/allen/runtime.om +c16d61dbcb81f7ef8196c937929a53e47de3de0015e5d663bcd8e49b3cb05002 native/omega/allen/scene-input.om +c8d4a437b41538cc1eeb62a2029c6993d41e5ef90cc7b26c8e1c92bc98ec57d3 native/omega/allen/scene.om +615dff78462a715153b3d891b2cfe146c318d3a0a26ae1aaa642484f965c12df native/omega/allen/scheduler.om +f4e6bb5571a0700febdecfc6209ae1c088eab50a82bce4d8a10179408e3abb5f native/omega/allen/tests/application.om +f085198549d1c235a97574ff6f6560ce82217611f4051fc3dbbc8286aab6d536 native/omega/allen/tests/check.om +b76438a85257bd95768115047be286c107e3723628a16a0541870732d0849a42 native/omega/allen/tests/code.om +98105e1c30626f54da07940fe0415637730b7e112ea39ba2aae1f2d648993373 native/omega/allen/tests/courier.om +f524aab74657dc2e9e4330bf42bc05ef01ce3e8f08a05c80371be0c0a33764d3 native/omega/allen/tests/edges.om +a2e8bcde92d522216a4fa99559dd3bcba096aea86127364587dadcc2bfb585af native/omega/allen/tests/fixture.om +c9ef2bee7cbd1c072c6045d62c55f3bdd938901e91792cee72ea57fb8f25a198 native/omega/allen/tests/golden.om +8ba742d85ea510586f3cf86661bc0f28c5d99b59981c2d3fb220705efad24564 native/omega/allen/tests/intent.om +861d9af698b021056cceb6c00ae3458558db415963fe832d3fca7da55731cf7b native/omega/allen/tests/memory.om +13e4db7436165783c6aad48497ffe89fa6e5ba3de928e66a766c29e1e817fcf5 native/omega/allen/tests/paint.om +e6d232d92d74d88423cebbbbfc6e403ea9b865b80c909e1d23087001d905035a native/omega/allen/tests/probe.om +8fbc8a0517900efd771a994686356416a0fea5e20cfd9bc26c787850398113df native/omega/allen/tests/render.om +094a5e833bae7dfd3b013e3f015f143e9d7bd3efe9b9c896a7f58b09e1ec14b8 native/omega/allen/tests/reply.om +bab9b0e853aa4b62918353a5d1625a3171deebfb639e599fe9751b5a61a3df62 native/omega/allen/tests/runtime.om +c5847b4ea0c7df81691fadf9af2f258ad02d3fa588a400448f6d34d7819570b4 native/omega/allen/tests/scene-input.om +b9c84d9a58658589137764fe60209d8320550dd8ed99fa6026df65ba48737e4f native/omega/allen/tests/scene.om +bf984fa9cf63ddb569147afc2a028ccdafdbeae2067125cf35d658e5d00f4c94 native/omega/allen/tests/scheduler.om +521fff50f312b64801017b1349d9a31dac6eac50eb989d93d2dbac4e100f5007 native/omega/allen/tests/stdio-overflow.om +89aee5326b428147ea6da9aa739b6679e214ed114ae5f41d3b70299cf864092c native/omega/allen/tests/view.om +0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0 native/omega/allen/vendor/OMEGA-LICENSE +b234738e8ce81b3d67586deb41fdaab4543169d4b69e86fd3dc28a08432ab5fc native/omega/allen/vendor/PROVENANCE.md +992ec4a4957271b442740598136887a5c610effcd8ae9fb9480a006a4f181097 native/omega/allen/vendor/sha256-core.om +0781cdcec18570a57afbe3be4a6717dd2d1fa4c887b49a3e4cb542b594f8a041 native/omega/allen/vendor/sha256.om +abbefd2f7dc48f2ac28b9526f5c2e5b369da4b7c5e84dde6e6a3cd20bd5687ac native/omega/allen/view.om diff --git a/evidence/allen-omega-L694/L740/stale-mutant.log b/evidence/allen-omega-L694/L740/stale-mutant.log new file mode 100644 index 00000000..ac2e3d09 --- /dev/null +++ b/evidence/allen-omega-L694/L740/stale-mutant.log @@ -0,0 +1,28 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 1 +7 1 +8 1 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 diff --git a/evidence/allen-omega-L694/L740/thinking-mutant.log b/evidence/allen-omega-L694/L740/thinking-mutant.log new file mode 100644 index 00000000..74b41a12 --- /dev/null +++ b/evidence/allen-omega-L694/L740/thinking-mutant.log @@ -0,0 +1,63 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 1 +15 1 +16 0 +17 0 +18 0 +19 1 +20 1 +21 1 +22 1 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 diff --git a/evidence/allen-omega-L694/L740/view.log b/evidence/allen-omega-L694/L740/view.log new file mode 100644 index 00000000..8b194f11 --- /dev/null +++ b/evidence/allen-omega-L694/L740/view.log @@ -0,0 +1,13 @@ +901 0 +902 0 +903 0 +904 0 +905 0 +906 0 +907 0 +908 0 +909 0 +910 0 +911 0 +912 0 +913 0 diff --git a/evidence/allen-omega-L694/L746/README.md b/evidence/allen-omega-L694/L746/README.md new file mode 100644 index 00000000..4398a74c --- /dev/null +++ b/evidence/allen-omega-L694/L746/README.md @@ -0,0 +1,30 @@ +# L746 restored memory to real application jobs + +Based on a65b70e. Handwritten seeded Omega context.om and tests/context.om; +appask now validates/stages context before jobbuild reads variable-layout names, +then appends memory metadata before the actual qsubmit snapshots the wire job. +No disk, networking, live model or target provider was added. + +Initial old-application RED (`red`) trapped103 after62 checks at deliberately +invalid fact count33: self-name offset3769 exceeded Mem capacity3692. Preserved +as the old unchecked application path, not a complete assertion-suite result. +After connecting compilable context stubs, RED (`red2`) completed84 assertions, +46 failures,exit46. Implementation passed84/84. Expanded tests ran against the +same stub:142 checks,76 failures,exit76 (`red3`); real implementation then passed +142/142 (`green3`). Initial implementation compile error3 was unsupported `mod`; +corrected to the seed grammar's `rem`, not counted as behavioral evidence. + +Coverage includes actual memory codec load, note record validation/loading in +arbitrary order, duplicate/damaged/deleted handling, incomplete catalog refusal, +newest-six/zero-note selection, literal metadata bytes, context carried inside +actual appask/qsubmit JOB, exact4096-byte append and overflow refusal, maximum +counts, malformed fields, u32 decimal starts, preserved Unit/Enc, and untouched +conversation/wire IDs and history on refused admission. Metadata-only and +complete-JOB overflow are tested separately. No silent dropping or truncation. + +Fresh complete combined gate: +`quiet-build native/omega/allen/gate.sh ~/handoffs/allen-omega-L694/L746/full`. +Exact totals and13 rejected compiled mutants in counts.json/full.log. Original +memory/stdio goldens and oversized-stdio refusal remain passing. Input inventory +was verified byte-for-byte before commit. Independent review pending for L746; +newest-source whole-repo strict/hardware qualification is not claimed. diff --git a/evidence/allen-omega-L694/L746/ackstop-mutant.log b/evidence/allen-omega-L694/L746/ackstop-mutant.log new file mode 100644 index 00000000..5d0598cb --- /dev/null +++ b/evidence/allen-omega-L694/L746/ackstop-mutant.log @@ -0,0 +1,213 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 1 +65 1 +66 0 +67 0 +68 0 +69 1 +70 1 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 1 +165 0 +166 0 +167 0 +168 0 +169 1 +170 0 +171 1 +172 1 +173 0 +174 1 +175 0 +176 0 +177 0 +178 1 +179 0 +180 1 +181 0 +182 1 +183 0 +184 1 +185 0 +186 1 +187 0 +188 1 +189 0 +190 1 +191 0 +192 1 +193 0 +194 1 +195 1 +196 1 +197 1 +198 0 +199 1 +200 0 +201 0 +202 1 +203 1 +204 1 +205 0 +206 1 +207 1 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 diff --git a/evidence/allen-omega-L694/L746/appcode-mutant.log b/evidence/allen-omega-L694/L746/appcode-mutant.log new file mode 100644 index 00000000..c9c50601 --- /dev/null +++ b/evidence/allen-omega-L694/L746/appcode-mutant.log @@ -0,0 +1,182 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 1 +76 1 +77 1 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 diff --git a/evidence/allen-omega-L694/L746/application.log b/evidence/allen-omega-L694/L746/application.log new file mode 100644 index 00000000..2e8a428d --- /dev/null +++ b/evidence/allen-omega-L694/L746/application.log @@ -0,0 +1,182 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 diff --git a/evidence/allen-omega-L694/L746/binaries.sha256 b/evidence/allen-omega-L694/L746/binaries.sha256 new file mode 100644 index 00000000..5d262913 --- /dev/null +++ b/evidence/allen-omega-L694/L746/binaries.sha256 @@ -0,0 +1,32 @@ +b696eb3591d6f099cdeda23fde9f95190bac8032af8373f37939a2b022bc7868 /home/drakestapleton/handoffs/allen-omega-L694/L746/full/scheduler +a255cf7f1ac2515745c4da4d26b0ea3f548220e842f4ae7c9a90891001d90677 /home/drakestapleton/handoffs/allen-omega-L694/L746/full/readback-mutant +8600e48a2b32b303e464ec56f736592a1e80fb654a308a361ffb0af1f53d70ce /home/drakestapleton/handoffs/allen-omega-L694/L746/full/view +a0905642a10c77023ad8ec014b7a3842cc1449cf388051cdddbeb5829053954b /home/drakestapleton/handoffs/allen-omega-L694/L746/full/contextnote-mutant +f9fadb9d2623638f3266c4b40caf789d5210d975cd40e960594cfbaea103b5e1 /home/drakestapleton/handoffs/allen-omega-L694/L746/full/allen +1a02760c7152dcd00d0b54e1d18e76363027844b50d1fcf7acca7215d9d44bf1 /home/drakestapleton/handoffs/allen-omega-L694/L746/full/reply +6cb7df727ed6456b7276cdcbd061220f4d67ba3adb8e115e5db831e96298c5c0 /home/drakestapleton/handoffs/allen-omega-L694/L746/full/thinking-mutant +ab479627a8fa91ae687e027c0f450fbe04e643d98aaf376003b7e74d02315fd6 /home/drakestapleton/handoffs/allen-omega-L694/L746/full/ackstop-mutant +ded0c8ffcc70b47fdafeb44bd1c3c235e369e1cf2f4631700859106a4a48056d /home/drakestapleton/handoffs/allen-omega-L694/L746/full/hash-mutant +43d42b51b2a262bd399d285115d8e68844660cbee480f74b82f1a4d5739a7e33 /home/drakestapleton/handoffs/allen-omega-L694/L746/full/golden +6f00b6497d66d78de3fc2b4df886edf08f316459d513abdc55f0a538b5252d0c /home/drakestapleton/handoffs/allen-omega-L694/L746/full/session-mutant +9caf41933bd193fb0012809245fab1d7398c4759efdd6a03ba7e907cd70e1394 /home/drakestapleton/handoffs/allen-omega-L694/L746/full/scene-input +81e82e958dcfed364010d7f7eafe127c95381ffa3f6c1c0d92462214268381bd /home/drakestapleton/handoffs/allen-omega-L694/L746/full/intent +10124a093e1d219a06bef656b6012ec5bcfa192c1f18e78ebc5c469cdc685dc0 /home/drakestapleton/handoffs/allen-omega-L694/L746/full/fixture +beace704881d0aed22615498b6b9e4b28e9ace95572c144b2c6d122ef3d600b8 /home/drakestapleton/handoffs/allen-omega-L694/L746/full/context +b44dc70ca4ec047a2bdc46bbd9913de36db00c4a2d76f1d54c27cfc68b1b1550 /home/drakestapleton/handoffs/allen-omega-L694/L746/full/runtime +67f40effbf7280b838eeed031ac9b69437a8868a6f1fa2ee168c2df41c1415ab /home/drakestapleton/handoffs/allen-omega-L694/L746/full/code +db1e42016167744085b7b99ab8ec9a085d8521e96d96a54bdc1fa223de5a95ba /home/drakestapleton/handoffs/allen-omega-L694/L746/full/edges +32d23cfee2c65f9320ff148f1c55db25d48b46cb42ccd8726323a2896cef1314 /home/drakestapleton/handoffs/allen-omega-L694/L746/full/appcode-mutant +01a7ef0a7542e60d1d27da0e07d7694d9ff5033da07435f7f9b1bbc158cd42ed /home/drakestapleton/handoffs/allen-omega-L694/L746/full/render +e4ced11e495f81bc9902e18ef3119f217410cdf6147d3609e8413ae1135d74bd /home/drakestapleton/handoffs/allen-omega-L694/L746/full/stale-mutant +1c743428e14dfb473fb11c383af6837bd0f4951948c0e31494154456f8f008f0 /home/drakestapleton/handoffs/allen-omega-L694/L746/full/courier +b6dbecc0f1757ac461f3fcd5c0e436ae3c4203435c261076bd385d46441e3993 /home/drakestapleton/handoffs/allen-omega-L694/L746/full/scene +c9d202bb68794878f5d93fef837235a7aabc589493bbb0f0711bd896054a1265 /home/drakestapleton/handoffs/allen-omega-L694/L746/full/pendingwire-mutant +244cafef174b7fbdb72926c5881d91aae8de9ef530c5762f637e8386f339bbb9 /home/drakestapleton/handoffs/allen-omega-L694/L746/full/scenecap-mutant +0593efe9ba395152b4a0a5ff50030a6d5f7dd2f485b38734f28de23544e21b0b /home/drakestapleton/handoffs/allen-omega-L694/L746/full/contextjob-mutant +73aaca5355e563fb210827fcbd57c77ebde4e2641ee5505231eae2e387e3ff21 /home/drakestapleton/handoffs/allen-omega-L694/L746/full/paint +7954a1fda3c09acd8c71cab853cd001b1f81e3981a31e9de946968d29d8004be /home/drakestapleton/handoffs/allen-omega-L694/L746/full/crc-mutant +71f99242bcad6ede239b240602470fcf3d5da3267eb47a1ad522241958222367 /home/drakestapleton/handoffs/allen-omega-L694/L746/full/stdio-overflow-input +9690cec2712a297c10ac004bc6c962f8a2c643fbc0209dba7c9477815806a4cf /home/drakestapleton/handoffs/allen-omega-L694/L746/full/keepalive-mutant +1d43602bc8b9d06677f22f19937c84f4300e05684c9c5b45ffea7124b9985b68 /home/drakestapleton/handoffs/allen-omega-L694/L746/full/memory +c985545de37f9de140312316b13e41cd82b4532fb1d71c3ddd89a60c9de1b1d4 /home/drakestapleton/handoffs/allen-omega-L694/L746/full/application diff --git a/evidence/allen-omega-L694/L746/code.log b/evidence/allen-omega-L694/L746/code.log new file mode 100644 index 00000000..e7e197b7 --- /dev/null +++ b/evidence/allen-omega-L694/L746/code.log @@ -0,0 +1,23 @@ +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 diff --git a/evidence/allen-omega-L694/L746/context.log b/evidence/allen-omega-L694/L746/context.log new file mode 100644 index 00000000..df62cddb --- /dev/null +++ b/evidence/allen-omega-L694/L746/context.log @@ -0,0 +1,142 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 diff --git a/evidence/allen-omega-L694/L746/contextjob-mutant.log b/evidence/allen-omega-L694/L746/contextjob-mutant.log new file mode 100644 index 00000000..3432d4b2 --- /dev/null +++ b/evidence/allen-omega-L694/L746/contextjob-mutant.log @@ -0,0 +1,142 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 1 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 1 +72 1 +73 1 +74 1 +75 1 +76 1 +77 0 +78 0 +79 1 +80 1 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 1 +88 1 +89 0 +90 1 +91 0 +92 1 +93 0 +94 1 +95 0 +96 1 +97 0 +98 1 +99 0 +100 1 +101 0 +102 1 +103 0 +104 1 +105 0 +106 1 +107 0 +108 1 +109 1 +110 1 +111 1 +112 1 +113 1 +114 1 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 1 +123 0 +124 1 +125 0 +126 1 +127 0 +128 1 +129 0 +130 1 +131 0 +132 1 +133 0 +134 1 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 1 +142 1 diff --git a/evidence/allen-omega-L694/L746/contextnote-mutant.log b/evidence/allen-omega-L694/L746/contextnote-mutant.log new file mode 100644 index 00000000..b5c08759 --- /dev/null +++ b/evidence/allen-omega-L694/L746/contextnote-mutant.log @@ -0,0 +1,142 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 1 +38 1 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 1 +47 0 +48 1 +49 0 +50 0 +51 0 +52 0 +53 0 +54 1 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 diff --git a/evidence/allen-omega-L694/L746/counts.json b/evidence/allen-omega-L694/L746/counts.json new file mode 100644 index 00000000..12ce083a --- /dev/null +++ b/evidence/allen-omega-L694/L746/counts.json @@ -0,0 +1,36 @@ +{ + "checks": { + "runtime": 28, + "code": 23, + "courier": 24, + "scheduler": 213, + "application": 182, + "memory": 79, + "context": 142, + "intent": 8, + "reply": 15, + "view": 13, + "scene": 14, + "scene-input": 63, + "paint": 11, + "edges": 352, + "short": 20, + "long": 292 + }, + "total": 1479, + "mutant_failures": { + "stale": 3, + "crc": 2, + "hash": 2, + "readback": 7, + "session": 1, + "keepalive": 40, + "ackstop": 27, + "pendingwire": 1, + "appcode": 3, + "thinking": 6, + "scenecap": 3, + "contextnote": 5, + "contextjob": 36 + } +} diff --git a/evidence/allen-omega-L694/L746/courier.log b/evidence/allen-omega-L694/L746/courier.log new file mode 100644 index 00000000..8402df49 --- /dev/null +++ b/evidence/allen-omega-L694/L746/courier.log @@ -0,0 +1,24 @@ +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 diff --git a/evidence/allen-omega-L694/L746/crc-mutant.log b/evidence/allen-omega-L694/L746/crc-mutant.log new file mode 100644 index 00000000..a0d90bd4 --- /dev/null +++ b/evidence/allen-omega-L694/L746/crc-mutant.log @@ -0,0 +1,23 @@ +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 1 +117 1 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 diff --git a/evidence/allen-omega-L694/L746/edges.log b/evidence/allen-omega-L694/L746/edges.log new file mode 100644 index 00000000..e8d0deea --- /dev/null +++ b/evidence/allen-omega-L694/L746/edges.log @@ -0,0 +1,352 @@ +1201 0 +1202 0 +1203 0 +1204 0 +1205 0 +1206 0 +1207 0 +1208 0 +1209 0 +1210 0 +1211 0 +1212 0 +1213 0 +1214 0 +1220 0 +1221 0 +1222 0 +1223 0 +1224 0 +1225 0 +1226 0 +1227 0 +1228 0 +1229 0 +1230 0 +1231 0 +1232 0 +1233 0 +1234 0 +1235 0 +1236 0 +1237 0 +1238 0 +1239 0 +1240 0 +1241 0 +1242 0 +1243 0 +1244 0 +1245 0 +1246 0 +1247 0 +1248 0 +1249 0 +1250 0 +1251 0 +1252 0 +1253 0 +1254 0 +1255 0 +1256 0 +1257 0 +1258 0 +1259 0 +1260 0 +1261 0 +1262 0 +1301 0 +1302 0 +1303 0 +1304 0 +1305 0 +1306 0 +1310 0 +1311 0 +1312 0 +1313 0 +1314 0 +1315 0 +1316 0 +1317 0 +1318 0 +1319 0 +1320 0 +1321 0 +1322 0 +1323 0 +1324 0 +1325 0 +1326 0 +1327 0 +1328 0 +1329 0 +1330 0 +1331 0 +1332 0 +1333 0 +1334 0 +1335 0 +1336 0 +1337 0 +1338 0 +1339 0 +1340 0 +1341 0 +1342 0 +1343 0 +1344 0 +1345 0 +1346 0 +1347 0 +1348 0 +1349 0 +1350 0 +1351 0 +1352 0 +1353 0 +1354 0 +1355 0 +1356 0 +1357 0 +1358 0 +1359 0 +1360 0 +1361 0 +1362 0 +1363 0 +1364 0 +1365 0 +1366 0 +1367 0 +1368 0 +1369 0 +1370 0 +1371 0 +1372 0 +1373 0 +1374 0 +1375 0 +1376 0 +1377 0 +1378 0 +1379 0 +1380 0 +1381 0 +1382 0 +1383 0 +1384 0 +1385 0 +1386 0 +1387 0 +1388 0 +1389 0 +1390 0 +1391 0 +1392 0 +1393 0 +1394 0 +1395 0 +1396 0 +1397 0 +1398 0 +1399 0 +1400 0 +1401 0 +1402 0 +1403 0 +1404 0 +1405 0 +1406 0 +1407 0 +1408 0 +1409 0 +1410 0 +1411 0 +1412 0 +1413 0 +1414 0 +1415 0 +1416 0 +1417 0 +1418 0 +1419 0 +1420 0 +1421 0 +1422 0 +1423 0 +1424 0 +1425 0 +1426 0 +1427 0 +1428 0 +1429 0 +1430 0 +1431 0 +1432 0 +1433 0 +1434 0 +1435 0 +1436 0 +1437 0 +1438 0 +1439 0 +1440 0 +1441 0 +1442 0 +1443 0 +1444 0 +1445 0 +1446 0 +1447 0 +1448 0 +1449 0 +1450 0 +1451 0 +1452 0 +1453 0 +1454 0 +1455 0 +1456 0 +1457 0 +1458 0 +1459 0 +1460 0 +1461 0 +1462 0 +1463 0 +1464 0 +1465 0 +1466 0 +1467 0 +1468 0 +1469 0 +1470 0 +1471 0 +1472 0 +1473 0 +1474 0 +1475 0 +1476 0 +1477 0 +1478 0 +1479 0 +1480 0 +1481 0 +1482 0 +1483 0 +1484 0 +1485 0 +1486 0 +1487 0 +1488 0 +1489 0 +1490 0 +1491 0 +1492 0 +1493 0 +1494 0 +1495 0 +1496 0 +1497 0 +1498 0 +1499 0 +1500 0 +1501 0 +1502 0 +1503 0 +1504 0 +1505 0 +1506 0 +1507 0 +1508 0 +1509 0 +1510 0 +1511 0 +1512 0 +1513 0 +1514 0 +1515 0 +1516 0 +1517 0 +1518 0 +1519 0 +1520 0 +1521 0 +1522 0 +1523 0 +1524 0 +1525 0 +1526 0 +1527 0 +1528 0 +1529 0 +1530 0 +1531 0 +1532 0 +1533 0 +1534 0 +1535 0 +1536 0 +1537 0 +1538 0 +1539 0 +1540 0 +1541 0 +1542 0 +1543 0 +1544 0 +1545 0 +1546 0 +1547 0 +1548 0 +1549 0 +1550 0 +1551 0 +1552 0 +1553 0 +1554 0 +1555 0 +1556 0 +1557 0 +1558 0 +1559 0 +1560 0 +1561 0 +1562 0 +1563 0 +1564 0 +1565 0 +1570 0 +1571 0 +1572 0 +1575 0 +1573 0 +1574 0 +1600 0 +1601 0 +1602 0 +1603 0 +1604 0 +1605 0 +1606 0 +1607 0 +1610 0 +1611 0 +1612 0 +1613 0 +1614 0 +1615 0 +1616 0 +1617 0 +1701 0 +1702 0 +1703 0 +1704 0 +1705 0 +1706 0 +1707 0 +1708 0 +1709 0 +1710 0 +1711 0 diff --git a/evidence/allen-omega-L694/L746/full.exit b/evidence/allen-omega-L694/L746/full.exit new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/L746/full.exit @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/L746/full.log b/evidence/allen-omega-L694/L746/full.log new file mode 100644 index 00000000..e20a4123 --- /dev/null +++ b/evidence/allen-omega-L694/L746/full.log @@ -0,0 +1,33 @@ +runtime compile=0 native-exit=0 +code compile=0 native-exit=0 +courier compile=0 native-exit=0 +scheduler compile=0 native-exit=0 +application compile=0 native-exit=0 +memory compile=0 native-exit=0 +context compile=0 native-exit=0 +intent compile=0 native-exit=0 +reply compile=0 native-exit=0 +view compile=0 native-exit=0 +scene compile=0 native-exit=0 +scene-input compile=0 native-exit=0 +paint compile=0 native-exit=0 +edges compile=0 native-exit=0 +fixture compile=0 native-exit=0 +golden compile=0 native-exit=0 +render compile=0 native-exit=0 +stdio native-exit=0 golden-cmp=0 +stdio overflow native-exit=65 no-later-command=PASS +stale mutant compile=0 rejected-exit=3 +crc mutant compile=0 rejected-exit=2 +hash mutant compile=0 rejected-exit=2 +readback mutant compile=0 rejected-exit=7 +session mutant compile=0 rejected-exit=1 +keepalive mutant compile=0 rejected-exit=40 +ackstop mutant compile=0 rejected-exit=27 +pendingwire mutant compile=0 rejected-exit=1 +appcode mutant compile=0 rejected-exit=3 +thinking mutant compile=0 rejected-exit=6 +scenecap mutant compile=0 rejected-exit=3 +contextnote mutant compile=0 rejected-exit=5 +contextjob mutant compile=0 rejected-exit=36 +ALLEN_OMEGA_HOST: PASS; target=NOT_RUN; live=NOT_RUN diff --git a/evidence/allen-omega-L694/L746/green2.exit b/evidence/allen-omega-L694/L746/green2.exit new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/L746/green2.exit @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/L746/green2.log b/evidence/allen-omega-L694/L746/green2.log new file mode 100644 index 00000000..e1a7003c --- /dev/null +++ b/evidence/allen-omega-L694/L746/green2.log @@ -0,0 +1,84 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 diff --git a/evidence/allen-omega-L694/L746/green3.exit b/evidence/allen-omega-L694/L746/green3.exit new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/L746/green3.exit @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/L746/green3.log b/evidence/allen-omega-L694/L746/green3.log new file mode 100644 index 00000000..df62cddb --- /dev/null +++ b/evidence/allen-omega-L694/L746/green3.log @@ -0,0 +1,142 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 diff --git a/evidence/allen-omega-L694/L746/hash-mutant.log b/evidence/allen-omega-L694/L746/hash-mutant.log new file mode 100644 index 00000000..c75cfefb --- /dev/null +++ b/evidence/allen-omega-L694/L746/hash-mutant.log @@ -0,0 +1,79 @@ +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 1 +310 1 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +362 0 +363 0 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 0 +361 0 diff --git a/evidence/allen-omega-L694/L746/independent-review/inventory.json b/evidence/allen-omega-L694/L746/independent-review/inventory.json new file mode 100644 index 00000000..d7cfe0b0 --- /dev/null +++ b/evidence/allen-omega-L694/L746/independent-review/inventory.json @@ -0,0 +1,22 @@ +{ + "logs/build-v2.log": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "logs/build.log": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "logs/compiler.sha256": "41cfc578c1aa995e9b8ff0547c18acd2d9d2816680b57b0da1ba613b133d4cf4", + "logs/context-independent-v2.log": "c53d3a95b75b9432e13209a484cf22ddbe554343b6b677d4fb13df78b4842492", + "logs/context-independent.failed-v1.log": "895d006cddd239d16658d8ad7b1a33eaeb1b196dd0538c00b9ca5f46ec33bbd6", + "logs/context-independent.log": "895d006cddd239d16658d8ad7b1a33eaeb1b196dd0538c00b9ca5f46ec33bbd6", + "logs/diff-check.log": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "logs/elf.txt": "168e6e039cda1e132c5f7906891896d9660ee6048a60337576a5ea1713a2ef3f", + "logs/export-members.txt": "3a001eb2a2fa7a3a9df2b18a5746d5490343e85810976699caa8545ab5fd8bed", + "logs/pin-source.sha256": "72f21cdc5a6e8f0e58311bcdf9c9e1c62fe851d89f120256876660191fd3497b", + "logs/probe.sha256": "f00354cad4a75dd5d2f8f01e4033cc0a13c5d7ecb39b2cd5642301a5ff356c9d", + "logs/scoped-source.sha256": "7832dee2649464574cb7b2be8a4ede6db1406415719298211c4e1b0c145501ac", + "logs/scoped.diff": "d2d8705c57aec09b9ab8e752f5da1e9f1f6ed7ba111a1e84a7f5d925d69bc4cc", + "parent-replay.log": "c53d3a95b75b9432e13209a484cf22ddbe554343b6b677d4fb13df78b4842492", + "parent-verification.json": "8d91ab9a5d045544772c184b0122f4b78e62dee6e0dd5b7c3d973bc4d6876603", + "probes/context-independent.failed-v1.full.om": "947295569c30fbb1a28db7b475fded345612ba3389fa40d5a52657958a92890d", + "probes/context-independent.full.om": "947295569c30fbb1a28db7b475fded345612ba3389fa40d5a52657958a92890d", + "probes/context-independent.om": "018ff259680b1a85579e101adb88b5a6d681108a8054df33f5ced59965b5480d", + "probes/core.om": "1bacb79258ca9c765f97ed45f62686f7edbfaca302d87b09f5a05ede70ef99b0", + "report.md": "ce5862d96c8f8f2b6dd11596f1f16f8996b336aad88ef98051a5b7bf626385d3" +} diff --git a/evidence/allen-omega-L694/L746/independent-review/logs/build-v2.log b/evidence/allen-omega-L694/L746/independent-review/logs/build-v2.log new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L746/independent-review/logs/build.log b/evidence/allen-omega-L694/L746/independent-review/logs/build.log new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L746/independent-review/logs/compiler.sha256 b/evidence/allen-omega-L694/L746/independent-review/logs/compiler.sha256 new file mode 100644 index 00000000..50e79ea9 --- /dev/null +++ b/evidence/allen-omega-L694/L746/independent-review/logs/compiler.sha256 @@ -0,0 +1 @@ +191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9 /home/drakestapleton/handoffs/allen-omega-L694/omc diff --git a/evidence/allen-omega-L694/L746/independent-review/logs/context-independent-v2.log b/evidence/allen-omega-L694/L746/independent-review/logs/context-independent-v2.log new file mode 100644 index 00000000..600acb67 --- /dev/null +++ b/evidence/allen-omega-L694/L746/independent-review/logs/context-independent-v2.log @@ -0,0 +1,150 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 diff --git a/evidence/allen-omega-L694/L746/independent-review/logs/context-independent.failed-v1.log b/evidence/allen-omega-L694/L746/independent-review/logs/context-independent.failed-v1.log new file mode 100644 index 00000000..daa4aaf1 --- /dev/null +++ b/evidence/allen-omega-L694/L746/independent-review/logs/context-independent.failed-v1.log @@ -0,0 +1,150 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 1 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 diff --git a/evidence/allen-omega-L694/L746/independent-review/logs/context-independent.log b/evidence/allen-omega-L694/L746/independent-review/logs/context-independent.log new file mode 100644 index 00000000..daa4aaf1 --- /dev/null +++ b/evidence/allen-omega-L694/L746/independent-review/logs/context-independent.log @@ -0,0 +1,150 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 1 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 diff --git a/evidence/allen-omega-L694/L746/independent-review/logs/diff-check.log b/evidence/allen-omega-L694/L746/independent-review/logs/diff-check.log new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L746/independent-review/logs/elf.txt b/evidence/allen-omega-L694/L746/independent-review/logs/elf.txt new file mode 100644 index 00000000..b2862c75 --- /dev/null +++ b/evidence/allen-omega-L694/L746/independent-review/logs/elf.txt @@ -0,0 +1,30 @@ +ELF Header: + Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 + Class: ELF64 + Data: 2's complement, little endian + Version: 1 (current) + OS/ABI: UNIX - System V + ABI Version: 0 + Type: EXEC (Executable file) + Machine: AArch64 + Version: 0x1 + Entry point address: 0x4000b0 + Start of program headers: 64 (bytes into file) + Start of section headers: 0 (bytes into file) + Flags: 0x0 + Size of this header: 64 (bytes) + Size of program headers: 56 (bytes) + Number of program headers: 2 + Size of section headers: 0 (bytes) + Number of section headers: 0 + Section header string table index: 0 + +Program Headers: + Type Offset VirtAddr PhysAddr + FileSiz MemSiz Flags Align + LOAD 0x0000000000000000 0x0000000000400000 0x0000000000400000 + 0x0000000000015d88 0x0000000000015d88 R E 0x1000 + LOAD 0x0000000000000000 0x0000000010000000 0x0000000010000000 + 0x0000000000000000 0x00000000008749e0 RW 0x1000 + +There is no dynamic section in this file. diff --git a/evidence/allen-omega-L694/L746/independent-review/logs/export-members.txt b/evidence/allen-omega-L694/L746/independent-review/logs/export-members.txt new file mode 100644 index 00000000..a8ff89bd --- /dev/null +++ b/evidence/allen-omega-L694/L746/independent-review/logs/export-members.txt @@ -0,0 +1,43 @@ +native/omega/allen/application.om +native/omega/allen/base.om +native/omega/allen/build-one.sh +native/omega/allen/code.om +native/omega/allen/context.om +native/omega/allen/courier.om +native/omega/allen/gate.sh +native/omega/allen/golden.sh +native/omega/allen/intent.om +native/omega/allen/main.om +native/omega/allen/memory.om +native/omega/allen/paint.om +native/omega/allen/README.md +native/omega/allen/reply.om +native/omega/allen/runtime.om +native/omega/allen/scene-input.om +native/omega/allen/scene.om +native/omega/allen/scheduler.om +native/omega/allen/tests/application.om +native/omega/allen/tests/check.om +native/omega/allen/tests/code.om +native/omega/allen/tests/context.om +native/omega/allen/tests/courier.om +native/omega/allen/tests/edges.om +native/omega/allen/tests/fixture.om +native/omega/allen/tests/golden.om +native/omega/allen/tests/intent.om +native/omega/allen/tests/memory.om +native/omega/allen/tests/paint.om +native/omega/allen/tests/probe.om +native/omega/allen/tests/render.om +native/omega/allen/tests/reply.om +native/omega/allen/tests/runtime.om +native/omega/allen/tests/scene-input.om +native/omega/allen/tests/scene.om +native/omega/allen/tests/scheduler.om +native/omega/allen/tests/stdio-overflow.om +native/omega/allen/tests/view.om +native/omega/allen/vendor/OMEGA-LICENSE +native/omega/allen/vendor/PROVENANCE.md +native/omega/allen/vendor/sha256-core.om +native/omega/allen/vendor/sha256.om +native/omega/allen/view.om diff --git a/evidence/allen-omega-L694/L746/independent-review/logs/pin-source.sha256 b/evidence/allen-omega-L694/L746/independent-review/logs/pin-source.sha256 new file mode 100644 index 00000000..993dab67 --- /dev/null +++ b/evidence/allen-omega-L694/L746/independent-review/logs/pin-source.sha256 @@ -0,0 +1,43 @@ +d1e99e2c1f4bcff06f6fda75fe2c3b48b75129526f15681cbd135b717bf1d11b native/omega/allen/README.md +56936108de0087499bb62a117a275f27b01d7bfb05eb8f6250f13ab8783e1095 native/omega/allen/application.om +184f4270c72c4eca6a7afdd28b70a608f2e237980b12c8a7bfc2c7d2c3e625b9 native/omega/allen/base.om +795ca28627a19f1088de0f23277e79cdac921ff88451c606c7b655ce0f2e8a5b native/omega/allen/build-one.sh +4d2235ac5d6b237695b1c3112f70ebdfa0cebafa2ec8e691e4be4de37a62199b native/omega/allen/code.om +75e86e193346a5548e596c84fa7d65aaeefd69f9979a648e0bf53f0f97cd9eb4 native/omega/allen/context.om +76ee9cdeaac036905c76dfa29f42bf5a78d1259ad1656adfaa24916c3b93550d native/omega/allen/courier.om +69224f53c3c8a3f952fff210320cdfabc58da8a7f9e933ca863a33df528dc646 native/omega/allen/gate.sh +9d71a653870eeef678f95df04db9c38aedaadd06e7c74bf3e5d9fde6e28f82f8 native/omega/allen/golden.sh +06087bc573ebb876a0ed80f6025c592fb4b1d23335169c3da402824fd1482c35 native/omega/allen/intent.om +4bc37c95d553364c5d2925d8ff9e8a53b1a61974513e6f492f77b7ebb05bbda4 native/omega/allen/main.om +068292abd04d3a61b063fc5380b22a56c4235a87915c219ebf3b37d16d7bc9c7 native/omega/allen/memory.om +b4d7b6e6cd680d2ba1eec2978b0cbb81ffc63035b73f5c3726bdad97a7b6aa04 native/omega/allen/paint.om +e50a7f673aaee92aba4a3aec303aa93b071121c09ad05d4ad1dcc2deb9706dcc native/omega/allen/reply.om +5b01eae03204d08f6d207ef29f2ba09a1d9f249f1738f68f151214675a4ff2ed native/omega/allen/runtime.om +c16d61dbcb81f7ef8196c937929a53e47de3de0015e5d663bcd8e49b3cb05002 native/omega/allen/scene-input.om +c8d4a437b41538cc1eeb62a2029c6993d41e5ef90cc7b26c8e1c92bc98ec57d3 native/omega/allen/scene.om +615dff78462a715153b3d891b2cfe146c318d3a0a26ae1aaa642484f965c12df native/omega/allen/scheduler.om +f4e6bb5571a0700febdecfc6209ae1c088eab50a82bce4d8a10179408e3abb5f native/omega/allen/tests/application.om +f085198549d1c235a97574ff6f6560ce82217611f4051fc3dbbc8286aab6d536 native/omega/allen/tests/check.om +b76438a85257bd95768115047be286c107e3723628a16a0541870732d0849a42 native/omega/allen/tests/code.om +c61bb0ca8f70114e6fd180e9f9a48ec4d2f927152269c11bfc9df55dc13bc1bc native/omega/allen/tests/context.om +98105e1c30626f54da07940fe0415637730b7e112ea39ba2aae1f2d648993373 native/omega/allen/tests/courier.om +f524aab74657dc2e9e4330bf42bc05ef01ce3e8f08a05c80371be0c0a33764d3 native/omega/allen/tests/edges.om +a2e8bcde92d522216a4fa99559dd3bcba096aea86127364587dadcc2bfb585af native/omega/allen/tests/fixture.om +c9ef2bee7cbd1c072c6045d62c55f3bdd938901e91792cee72ea57fb8f25a198 native/omega/allen/tests/golden.om +8ba742d85ea510586f3cf86661bc0f28c5d99b59981c2d3fb220705efad24564 native/omega/allen/tests/intent.om +861d9af698b021056cceb6c00ae3458558db415963fe832d3fca7da55731cf7b native/omega/allen/tests/memory.om +13e4db7436165783c6aad48497ffe89fa6e5ba3de928e66a766c29e1e817fcf5 native/omega/allen/tests/paint.om +e6d232d92d74d88423cebbbbfc6e403ea9b865b80c909e1d23087001d905035a native/omega/allen/tests/probe.om +8fbc8a0517900efd771a994686356416a0fea5e20cfd9bc26c787850398113df native/omega/allen/tests/render.om +094a5e833bae7dfd3b013e3f015f143e9d7bd3efe9b9c896a7f58b09e1ec14b8 native/omega/allen/tests/reply.om +bab9b0e853aa4b62918353a5d1625a3171deebfb639e599fe9751b5a61a3df62 native/omega/allen/tests/runtime.om +c5847b4ea0c7df81691fadf9af2f258ad02d3fa588a400448f6d34d7819570b4 native/omega/allen/tests/scene-input.om +b9c84d9a58658589137764fe60209d8320550dd8ed99fa6026df65ba48737e4f native/omega/allen/tests/scene.om +bf984fa9cf63ddb569147afc2a028ccdafdbeae2067125cf35d658e5d00f4c94 native/omega/allen/tests/scheduler.om +521fff50f312b64801017b1349d9a31dac6eac50eb989d93d2dbac4e100f5007 native/omega/allen/tests/stdio-overflow.om +89aee5326b428147ea6da9aa739b6679e214ed114ae5f41d3b70299cf864092c native/omega/allen/tests/view.om +0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0 native/omega/allen/vendor/OMEGA-LICENSE +b234738e8ce81b3d67586deb41fdaab4543169d4b69e86fd3dc28a08432ab5fc native/omega/allen/vendor/PROVENANCE.md +992ec4a4957271b442740598136887a5c610effcd8ae9fb9480a006a4f181097 native/omega/allen/vendor/sha256-core.om +0781cdcec18570a57afbe3be4a6717dd2d1fa4c887b49a3e4cb542b594f8a041 native/omega/allen/vendor/sha256.om +abbefd2f7dc48f2ac28b9526f5c2e5b369da4b7c5e84dde6e6a3cd20bd5687ac native/omega/allen/view.om diff --git a/evidence/allen-omega-L694/L746/independent-review/logs/probe.sha256 b/evidence/allen-omega-L694/L746/independent-review/logs/probe.sha256 new file mode 100644 index 00000000..b8fbf7ef --- /dev/null +++ b/evidence/allen-omega-L694/L746/independent-review/logs/probe.sha256 @@ -0,0 +1,3 @@ +018ff259680b1a85579e101adb88b5a6d681108a8054df33f5ced59965b5480d /home/drakestapleton/handoffs/L747-review/probes/context-independent.om +947295569c30fbb1a28db7b475fded345612ba3389fa40d5a52657958a92890d /home/drakestapleton/handoffs/L747-review/probes/context-independent.full.om +4a53ec429504131fd48a6f2931a7244053ab9013291d46841dc69545addcabd6 /home/drakestapleton/handoffs/L747-review/build/context-independent diff --git a/evidence/allen-omega-L694/L746/independent-review/logs/scoped-source.sha256 b/evidence/allen-omega-L694/L746/independent-review/logs/scoped-source.sha256 new file mode 100644 index 00000000..49df24eb --- /dev/null +++ b/evidence/allen-omega-L694/L746/independent-review/logs/scoped-source.sha256 @@ -0,0 +1,43 @@ +56936108de0087499bb62a117a275f27b01d7bfb05eb8f6250f13ab8783e1095 ./application.om +184f4270c72c4eca6a7afdd28b70a608f2e237980b12c8a7bfc2c7d2c3e625b9 ./base.om +795ca28627a19f1088de0f23277e79cdac921ff88451c606c7b655ce0f2e8a5b ./build-one.sh +4d2235ac5d6b237695b1c3112f70ebdfa0cebafa2ec8e691e4be4de37a62199b ./code.om +75e86e193346a5548e596c84fa7d65aaeefd69f9979a648e0bf53f0f97cd9eb4 ./context.om +76ee9cdeaac036905c76dfa29f42bf5a78d1259ad1656adfaa24916c3b93550d ./courier.om +69224f53c3c8a3f952fff210320cdfabc58da8a7f9e933ca863a33df528dc646 ./gate.sh +9d71a653870eeef678f95df04db9c38aedaadd06e7c74bf3e5d9fde6e28f82f8 ./golden.sh +06087bc573ebb876a0ed80f6025c592fb4b1d23335169c3da402824fd1482c35 ./intent.om +4bc37c95d553364c5d2925d8ff9e8a53b1a61974513e6f492f77b7ebb05bbda4 ./main.om +068292abd04d3a61b063fc5380b22a56c4235a87915c219ebf3b37d16d7bc9c7 ./memory.om +b4d7b6e6cd680d2ba1eec2978b0cbb81ffc63035b73f5c3726bdad97a7b6aa04 ./paint.om +d1e99e2c1f4bcff06f6fda75fe2c3b48b75129526f15681cbd135b717bf1d11b ./README.md +e50a7f673aaee92aba4a3aec303aa93b071121c09ad05d4ad1dcc2deb9706dcc ./reply.om +5b01eae03204d08f6d207ef29f2ba09a1d9f249f1738f68f151214675a4ff2ed ./runtime.om +c16d61dbcb81f7ef8196c937929a53e47de3de0015e5d663bcd8e49b3cb05002 ./scene-input.om +c8d4a437b41538cc1eeb62a2029c6993d41e5ef90cc7b26c8e1c92bc98ec57d3 ./scene.om +615dff78462a715153b3d891b2cfe146c318d3a0a26ae1aaa642484f965c12df ./scheduler.om +f4e6bb5571a0700febdecfc6209ae1c088eab50a82bce4d8a10179408e3abb5f ./tests/application.om +f085198549d1c235a97574ff6f6560ce82217611f4051fc3dbbc8286aab6d536 ./tests/check.om +b76438a85257bd95768115047be286c107e3723628a16a0541870732d0849a42 ./tests/code.om +c61bb0ca8f70114e6fd180e9f9a48ec4d2f927152269c11bfc9df55dc13bc1bc ./tests/context.om +98105e1c30626f54da07940fe0415637730b7e112ea39ba2aae1f2d648993373 ./tests/courier.om +f524aab74657dc2e9e4330bf42bc05ef01ce3e8f08a05c80371be0c0a33764d3 ./tests/edges.om +a2e8bcde92d522216a4fa99559dd3bcba096aea86127364587dadcc2bfb585af ./tests/fixture.om +c9ef2bee7cbd1c072c6045d62c55f3bdd938901e91792cee72ea57fb8f25a198 ./tests/golden.om +8ba742d85ea510586f3cf86661bc0f28c5d99b59981c2d3fb220705efad24564 ./tests/intent.om +861d9af698b021056cceb6c00ae3458558db415963fe832d3fca7da55731cf7b ./tests/memory.om +13e4db7436165783c6aad48497ffe89fa6e5ba3de928e66a766c29e1e817fcf5 ./tests/paint.om +e6d232d92d74d88423cebbbbfc6e403ea9b865b80c909e1d23087001d905035a ./tests/probe.om +8fbc8a0517900efd771a994686356416a0fea5e20cfd9bc26c787850398113df ./tests/render.om +094a5e833bae7dfd3b013e3f015f143e9d7bd3efe9b9c896a7f58b09e1ec14b8 ./tests/reply.om +bab9b0e853aa4b62918353a5d1625a3171deebfb639e599fe9751b5a61a3df62 ./tests/runtime.om +c5847b4ea0c7df81691fadf9af2f258ad02d3fa588a400448f6d34d7819570b4 ./tests/scene-input.om +b9c84d9a58658589137764fe60209d8320550dd8ed99fa6026df65ba48737e4f ./tests/scene.om +bf984fa9cf63ddb569147afc2a028ccdafdbeae2067125cf35d658e5d00f4c94 ./tests/scheduler.om +521fff50f312b64801017b1349d9a31dac6eac50eb989d93d2dbac4e100f5007 ./tests/stdio-overflow.om +89aee5326b428147ea6da9aa739b6679e214ed114ae5f41d3b70299cf864092c ./tests/view.om +0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0 ./vendor/OMEGA-LICENSE +b234738e8ce81b3d67586deb41fdaab4543169d4b69e86fd3dc28a08432ab5fc ./vendor/PROVENANCE.md +992ec4a4957271b442740598136887a5c610effcd8ae9fb9480a006a4f181097 ./vendor/sha256-core.om +0781cdcec18570a57afbe3be4a6717dd2d1fa4c887b49a3e4cb542b594f8a041 ./vendor/sha256.om +abbefd2f7dc48f2ac28b9526f5c2e5b369da4b7c5e84dde6e6a3cd20bd5687ac ./view.om diff --git a/evidence/allen-omega-L694/L746/independent-review/logs/scoped.diff b/evidence/allen-omega-L694/L746/independent-review/logs/scoped.diff new file mode 100644 index 00000000..2af0ef88 --- /dev/null +++ b/evidence/allen-omega-L694/L746/independent-review/logs/scoped.diff @@ -0,0 +1,420 @@ +diff --git a/native/omega/allen/README.md b/native/omega/allen/README.md +index dfaa4d1..3328043 100644 +--- a/native/omega/allen/README.md ++++ b/native/omega/allen/README.md +@@ -13,17 +13,17 @@ Run from this checkout on Linux AArch64, with the brief's immutable compiler: + ```sh + quiet-build native/omega/allen/gate.sh target/allen-omega-L694/fresh-output + ``` + + The output directory must be fresh. `build-one.sh` hashes the compiler before + **every invocation**, rejects empty/wrong-machine/nonstatic ELF and marks only + qualified output executable. The gate builds all modules together for every test, + executes handwritten Omega test programs, compares a byte-exact independent memory +-fixture and rejects eleven compiled behavioral mutants. The build uses POSIX shell, ++fixture and rejects thirteen compiled behavioral mutants. The build uses POSIX shell, + Git (source reconstruction), GNU file/text utilities, readelf, dd, xxd and + sha256sum as external development tools. Existing Rust courier `--split` was used + once as a fixture oracle, never as an Omega runtime dependency. + + ## Modules and API boundary + + * `runtime.om`: one outstanding job, chat/code/follow-up, immediate code ack, + ID exhaustion refusal, stale answer rejection, cancel/reset,20s slow-once and +@@ -64,16 +64,35 @@ once as a fixture oracle, never as an Omega runtime dependency. + SHA256(header0:32 || payload) is **unkeyed integrity**, never authorization or + rollback freshness. Those independent proofs remain absent in this legacy format. + `loadbeg` resets load state, `loadcopy(slot)` considers each valid copy once. + `txbegin -> txwrite -> txflush -> txread` publishes store generation only after + exact readback. Provider reads back into Unit and writes Enc to Tx's target. + `nbegin -> nwrite -> nflush -> nread` verifies note writes before parent saves; + provider must update the parent's note count only after nread succeeds. No disk + syscall/driver is bound. Crash tests use explicit fixed simulated disk buffers. ++* `context.om`: restores a512-slot catalog from already committed note records ++ and appends bounded memory context to actual application JOBs. After loading ++ canonical Mem through the memory codec, call `ctxbegin`; for each declared slot, ++ place its4096-byte record in Unit and call `ctxtake(index)` exactly once, in any ++ order. Return0 means refused/no visit,1 valid retained,2 damaged visit retained ++ as gone. Deleted/damaged notes never enter model context. The catalog becomes ++ ready only after every declared slot was visited. Cx contains declared count, ++ visited count, readiness, damaged count and loading flag. Loading is refused ++ during a live conversation or note/parent write transaction. The provider must ++ keep the chosen Mem generation stable and restart catalog loading after any ++ memory reload; this is not an incremental concurrent store interface. ++ `ctxmeta(limit)` stages byte-exact legacy self/name/starts/fact and newest-live- ++ note metadata into Meta/Mx without touching Unit, Enc or outgoing bytes. ++ `ctxappend` appends all or none within the4096-byte JOB cap, preserving outgoing ++ bytes/length/error on refusal. `appask` validates context before reading its ++ variable-layout identity fields, includes the newest six live notes, and refuses ++ incomplete catalogs/oversized context before conversation or wire IDs advance. ++ SHA validation is still unkeyed integrity, not authentication. No physical disk ++ loader/writer, note search index or concurrent mutation/commit provider is bound. + * `view.om`: legacy code row wrapping, continuation numbering and saturated scroll, + bounded4096 rows. The full code remains held when the row index reaches capacity. + * `scene.om`: mood/say/eight thing kinds, placement/emphasis/arrival/direction, + typed field bounds, four things/six fields/2048-byte input/12 lines. + * `scene-input.om`: `scdecode` consumes In/Inlen through bounded scene cleanup, + restores the exact caller input and length, and fills the same Sc/Things/Stext + output as the strict `scene` parser. Input and normalized output each have a + 2048-byte cap. NUL or normalization overflow refuses the whole scene and clears +@@ -109,17 +128,18 @@ CODE assembly and SAY/WAIT handling. This is an executed native core entry path, + not a bound socket/device loop. The older development `main.om` stdio entry + remains separate; it does not exercise this datagram binding. + + 1. `appinit(run,now)` initializes one boot session using a nonzero unique run ID + and actual monotonic milliseconds supplied by the future qualified provider. + Reinitialization is refused rather than reusing job IDs. + 2. Put a prompt into In/Inlen, then `appask(now)`. It validates admission before + adding a transcript entry, builds the real JOB text and queues it. Code requests +- expose the existing acknowledgement immediately. Busy, outstanding-send, ++ expose the existing acknowledgement immediately. Restored facts and up to six ++ newest live notes are included in the queued job. Busy, outstanding-send, + pending-receipt, invalid-prompt and ID-exhaustion cases refuse admission. + 3. `apppoll(now,link)` advances silence/slow deadlines and returns whether one + datagram is offered in Outb/Outlen. Send those exact bytes and call + `appsent(now,success)` with the real whole-datagram outcome. Do not call core + serializers yourself while a send is pending. + 4. Copy a received datagram into In/Inlen and call `appreceive(now)`. Its boolean + reports **transport acceptance**, not acceptance of the inner reply. A[2] + distinguishes visible text1, queued code recovery2, code give-up3, refused +@@ -145,17 +165,17 @@ Overflow refuses whole prompts/answers/scene fields instead of silent truncation + Reply capacity159, prompt capacity159, code32768, job4096, note127. Conflicting + CODE duplicates and differing language headers are refused rather than overwriting. + Numeric overflow, backward timestamps, request ID wrap and v4 sky pad are refused. + Job instructions and record bytes retain legacy structure; envelope metadata is + never added to Store v1 superblocks. No identity migration fields are rewritten. + + Remaining portable work: remaining scene aliases/missing-colon repairs, field + ellipsis, timer interpretation, transcript-to-notes restore, +-full notes indexing/retrieval, full memory metadata job append, transport binding, ++full notes indexing/retrieval, catalog update/store integration, transport binding, + full sky/catalogue/font/animated-network/canvas visual parity, integration and + broader malformed-input coverage. Partial modules are not whole compatibility. + + Required target gates: qualified seeded x86 EFI target (FR9), privileged/MMIO and + interrupt/native device access(FR8), durable I/O(FR1), bounded networking(FR16), + keyboard/framebuffer/disk/NIC providers, iMac QEMU boot/chat/keyboard/bootdisk, + then signed physical trial. No C bridge can satisfy these. L408 owns compiler + work; L690 owns Hermes JSON/WebSocket/admission. Neither tree was modified. +diff --git a/native/omega/allen/application.om b/native/omega/allen/application.om +index 3b79e6a..734efee 100644 +--- a/native/omega/allen/application.om ++++ b/native/omega/allen/application.om +@@ -51,19 +51,26 @@ ret false + end + kind = classify + if or lt kind 1 gt kind 3 + ret false + end + if and eq kind 3 eq get R 6 0 + ret false + end ++note Validate restored context before jobbuild reads its variable-layout names. ++if not ctxmeta 6 ++ret false ++end + if not jobbuild kind add get R 0 1 + ret false + end ++if not ctxappend ++ret false ++end + n = get Inlen 0 + size = get Outlen 0 + for i ulong n + put Askin i get In i + end + for i ulong size + put Appjob i get Outb i + end +diff --git a/native/omega/allen/context.om b/native/omega/allen/context.om +new file mode 100644 +index 0000000..401d418 +--- /dev/null ++++ b/native/omega/allen/context.om +@@ -0,0 +1,237 @@ ++note Restored note catalog and bounded model-job context. No storage provider. ++note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. ++global Cx ulong 5 ++global Ctxtext uchar 65536 ++global Ctxlen ulong 512 ++global Ctxgone uchar 512 ++global Ctxseen uchar 512 ++global Ctxstart ulong 512 ++global Meta uchar 4096 ++global Mx ulong 2 ++global Mdigits uchar 20 ++text Mtself "\tself=" ++text Mtname "\tname=" ++text Mtstart "\tstarts=" ++text Mtfact "\tfact " ++text Mtis " is " ++text Mtare " are " ++text Mtnote "\tnote " ++fn ctxidle to bool ++if ne get R 1 0 ++ret false ++end ++ret and eq get Tx 0 0 eq get Nt 0 0 ++end ++fn ctxbegin to bool ++if not ctxidle ++ret false ++end ++n = mem32 36 ++if gt n 512 ++ret false ++end ++for i ulong 512 ++put Ctxlen i 0 ++put Ctxgone i 1 ++put Ctxseen i 0 ++put Ctxstart i 0 ++end ++put Cx 0 n ++put Cx 1 0 ++put Cx 2 0 ++put Cx 3 0 ++put Cx 4 1 ++if eq n 0 ++put Cx 2 1 ++put Cx 4 0 ++end ++ret true ++end ++note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. ++fn ctxtake index ulong to ulong ++if not ctxidle ++ret 0 ++end ++if or eq get Cx 4 0 ge index get Cx 0 ++ret 0 ++end ++if ne get Ctxseen index 0 ++ret 0 ++end ++status = ulong 2 ++if notedec index ++n = get Ns 0 ++for i ulong n ++put Ctxtext add mul index 128 i get Note i ++end ++put Ctxlen index n ++put Ctxgone index uchar get Ns 3 ++put Ctxstart index get Ns 2 ++status = 1 ++else ++put Cx 3 add get Cx 3 1 ++end ++put Ctxseen index 1 ++put Cx 1 add get Cx 1 1 ++if eq get Cx 1 get Cx 0 ++put Cx 2 1 ++put Cx 4 0 ++end ++ret status ++end ++fn mtemit c uchar to void ++if ne get Mx 1 0 ++ret ++end ++n = get Mx 0 ++if ge n 4096 ++put Mx 1 1 ++ret ++end ++put Meta n c ++put Mx 0 add n 1 ++end ++fn mtnum v ulong to void ++n = ulong 0 ++while gt v 9 ++put Mdigits n uchar rem v 10 ++v = div v 10 ++n = add n 1 ++end ++put Mdigits n uchar v ++n = add n 1 ++for i ulong n ++mtemit add uchar 48 get Mdigits sub sub n 1 i ++end ++end ++note Memory fields are length-bounded; require a terminator and printable bytes. ++fn mtfield off ulong cap ulong to bool ++for i ulong cap ++c = get Mem add off i ++if eq c 0 ++if eq i 0 ++put Mx 1 1 ++ret false ++end ++ret true ++end ++if or lt c 32 gt c 126 ++put Mx 1 1 ++ret false ++end ++mtemit c ++end ++put Mx 1 1 ++ret false ++end ++fn mtfacts count ulong to bool ++for k ulong count ++off = add 40 mul k 113 ++for i ulong len Mtfact ++mtemit get Mtfact i ++end ++if not mtfield off 48 ++ret false ++end ++are = get Mem add off 112 ++if gt are 1 ++put Mx 1 1 ++ret false ++end ++if eq are 1 ++for i ulong len Mtare ++mtemit get Mtare i ++end ++else ++for i ulong len Mtis ++mtemit get Mtis i ++end ++end ++if not mtfield add off 48 64 ++ret false ++end ++end ++ret eq get Mx 1 0 ++end ++fn mtnotes count ulong limit ulong to void ++given = ulong 0 ++for k ulong count ++index = sub sub count 1 k ++if and eq get Ctxgone index 0 lt given limit ++for i ulong len Mtnote ++mtemit get Mtnote i ++end ++for i ulong get Ctxlen index ++mtemit get Ctxtext add mul index 128 i ++end ++given = add given 1 ++end ++end ++end ++fn ctxmeta limit ulong to bool ++put Mx 0 0 ++put Mx 1 1 ++facts = mem32 32 ++notes = mem32 36 ++if or gt facts 32 gt notes 512 ++ret false ++end ++if gt limit 512 ++ret false ++end ++if gt notes 0 ++if or eq get Cx 2 0 ne get Cx 0 notes ++ret false ++end ++end ++put Mx 1 0 ++for i ulong len Mtself ++mtemit get Mtself i ++end ++off = add 40 mul facts 113 ++if eq get Mem off 0 ++for i ulong len Allen ++mtemit get Allen i ++end ++else ++if not mtfield off 24 ++ret false ++end ++end ++if ne get Mem 8 0 ++for i ulong len Mtname ++mtemit get Mtname i ++end ++if not mtfield 8 24 ++ret false ++end ++end ++for i ulong len Mtstart ++mtemit get Mtstart i ++end ++mtnum mem32 0 ++if not mtfacts facts ++ret false ++end ++mtnotes notes limit ++ret eq get Mx 1 0 ++end ++note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. ++fn ctxappend to bool ++if or ne get Mx 1 0 ne get Err 0 0 ++ret false ++end ++n = get Outlen 0 ++size = get Mx 0 ++if or gt n 4096 gt size 4096 ++ret false ++end ++if gt add n size 4096 ++ret false ++end ++for i ulong size ++put Outb add n i get Meta i ++end ++put Outlen 0 add n size ++ret true ++end +diff --git a/native/omega/allen/gate.sh b/native/omega/allen/gate.sh +index d4171d2..326cb1c 100755 +--- a/native/omega/allen/gate.sh ++++ b/native/omega/allen/gate.sh +@@ -6,18 +6,18 @@ cd "$root" + out=$1 + mkdir -p "$out" + [ -z "$(ls -A "$out")" ] || { echo 'gate requires fresh output directory' >&2; exit 73; } + core="$out/core.om" + cat native/omega/allen/base.om native/omega/allen/vendor/sha256-core.om \ + native/omega/allen/runtime.om native/omega/allen/code.om \ + native/omega/allen/courier.om native/omega/allen/scheduler.om native/omega/allen/memory.om \ + native/omega/allen/intent.om native/omega/allen/reply.om \ +- native/omega/allen/view.om native/omega/allen/scene.om native/omega/allen/paint.om native/omega/allen/application.om native/omega/allen/scene-input.om > "$core" +-for name in runtime code courier scheduler application memory intent reply view scene scene-input paint edges fixture golden render; do ++ native/omega/allen/view.om native/omega/allen/scene.om native/omega/allen/paint.om native/omega/allen/application.om native/omega/allen/scene-input.om native/omega/allen/context.om > "$core" ++for name in runtime code courier scheduler application memory context intent reply view scene scene-input paint edges fixture golden render; do + cat "$core" > "$out/$name.om" + case "$name" in golden|render) ;; *) cat native/omega/allen/tests/check.om >> "$out/$name.om" ;; esac + cat "native/omega/allen/tests/$name.om" >> "$out/$name.om" + native/omega/allen/build-one.sh "$out/$name.om" "$out/$name" + case "$name" in + fixture) + "$out/$name" < evidence/allen-omega-L694/short.wire > "$out/short.log" + "$out/$name" < evidence/allen-omega-L694/long.wire > "$out/long.log" +@@ -66,17 +66,21 @@ cat native/omega/allen/tests/check.om native/omega/allen/tests/scheduler.om >> " + sed 's/put Outb i get Appwire i/put Outb i get Outb i/' "$core" > "$out/pendingwire-mutant.om" + cat native/omega/allen/tests/check.om native/omega/allen/tests/application.om >> "$out/pendingwire-mutant.om" + sed 's/if or le get R 2 1 ne get C 0 get R 0/if false/' "$core" > "$out/appcode-mutant.om" + cat native/omega/allen/tests/check.om native/omega/allen/tests/application.om >> "$out/appcode-mutant.om" + sed 's/if hide/if false/' "$core" > "$out/thinking-mutant.om" + cat native/omega/allen/tests/check.om native/omega/allen/tests/scene-input.om >> "$out/thinking-mutant.om" + sed 's/if lt get Nm 8 12/if true/' "$core" > "$out/scenecap-mutant.om" + cat native/omega/allen/tests/check.om native/omega/allen/tests/scene-input.om >> "$out/scenecap-mutant.om" +-for name in stale crc hash readback session keepalive ackstop pendingwire appcode thinking scenecap; do ++sed 's/if and eq get Ctxgone index 0 lt given limit/if lt given limit/' "$core" > "$out/contextnote-mutant.om" ++cat native/omega/allen/tests/check.om native/omega/allen/tests/context.om >> "$out/contextnote-mutant.om" ++sed 's/if not ctxappend/if false/' "$core" > "$out/contextjob-mutant.om" ++cat native/omega/allen/tests/check.om native/omega/allen/tests/context.om >> "$out/contextjob-mutant.om" ++for name in stale crc hash readback session keepalive ackstop pendingwire appcode thinking scenecap contextnote contextjob; do + native/omega/allen/build-one.sh "$out/$name-mutant.om" "$out/$name-mutant" + set +e + "$out/$name-mutant" > "$out/$name-mutant.log" + rc=$? + set -e + if [ "$rc" -le 0 ] || [ "$rc" -ge 100 ]; then echo "mutant did not fail behaviorally: $name exit=$rc" >&2; exit 1; fi + printf '%s mutant compile=0 rejected-exit=%s\n' "$name" "$rc" + done diff --git a/evidence/allen-omega-L694/L746/independent-review/parent-replay.log b/evidence/allen-omega-L694/L746/independent-review/parent-replay.log new file mode 100644 index 00000000..600acb67 --- /dev/null +++ b/evidence/allen-omega-L694/L746/independent-review/parent-replay.log @@ -0,0 +1,150 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 diff --git a/evidence/allen-omega-L694/L746/independent-review/parent-verification.json b/evidence/allen-omega-L694/L746/independent-review/parent-verification.json new file mode 100644 index 00000000..46820832 --- /dev/null +++ b/evidence/allen-omega-L694/L746/independent-review/parent-verification.json @@ -0,0 +1,8 @@ +{ + "pin": "be28deb21721f54fc46b5402076c7e8ac8fde151", + "source_files": 43, + "parent_probe_sha256": "4a53ec429504131fd48a6f2931a7244053ab9013291d46841dc69545addcabd6", + "parent_checks": 150, + "report_sha256": "ce5862d96c8f8f2b6dd11596f1f16f8996b336aad88ef98051a5b7bf626385d3", + "verdict": "No findings; original failed probe retained as expectation error; host-only." +} diff --git a/evidence/allen-omega-L694/L746/independent-review/probes/context-independent.failed-v1.full.om b/evidence/allen-omega-L694/L746/independent-review/probes/context-independent.failed-v1.full.om new file mode 100644 index 00000000..313faadf --- /dev/null +++ b/evidence/allen-omega-L694/L746/independent-review/probes/context-independent.failed-v1.full.om @@ -0,0 +1,3840 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +text Who "Drake" +text Selfname "Allen" +text Fkey "gate code" +text Fval "4471" +text Note0 "Meet at noon." +text Note1 "Old private note." +text Note3 "Bring tools." +text MetaWant "\tself=Allen\tname=Drake\tstarts=7\tfact gate code is 4471\tnote Bring tools.\tnote Meet at noon." +text NewOnly "\tself=Allen\tname=Drake\tstarts=7\tfact gate code is 4471\tnote Bring tools." +text Emptyctx "\tself=Allen\tstarts=0" +text Lastsix "\tself=Allen\tstarts=0\tnote N9\tnote N8\tnote N7\tnote N6\tnote N5\tnote N4" +text Plural "\tself=Allen\tname=Drake\tstarts=4294967295\tfact gate code are 4471" +global Unitsave uchar 8192 +global Saveout uchar 8192 +global Saveos ulong 2 +global Appsave ulong 16 +global Joblen ulong 1 +global Qsave ulong 2 +fn test ok bool to void +put Saveos 0 get Outlen 0 +put Saveos 1 get Err 0 +for i ulong get Outlen 0 +put Saveout i get Outb i +end +check ok add get Checks 0 1 +for i ulong get Saveos 0 +put Outb i get Saveout i +end +put Outlen 0 get Saveos 0 +put Err 0 get Saveos 1 +end +fn fixture index ulong gone ulong to void +put Ns 0 len Note0 +put Ns 1 index +put Ns 2 7 +put Ns 3 gone +for i ulong len Note0 +put Note i get Note0 i +end +if eq index 1 +put Ns 0 len Note1 +for i ulong len Note1 +put Note i get Note1 i +end +end +if eq index 3 +put Ns 0 len Note3 +for i ulong len Note3 +put Note i get Note3 i +end +end +test noteenc +for i ulong 4096 +put Unit i get Enc i +end +end +fn memsetup to void +for i ulong 3692 +put Mem i 0 +end +mset32 0 7 +mset32 32 1 +mset32 36 4 +for i ulong len Who +put Mem add i 8 get Who i +end +for i ulong len Fkey +put Mem add i 40 get Fkey i +end +for i ulong len Fval +put Mem add i 88 get Fval i +end +for i ulong len Selfname +put Mem add i 153 get Selfname i +end +end +fn prompt to void +put Inlen 0 2 +put In 0 104 +put In 1 105 +end +fn main to int +test appinit 123 0 +test ctxmeta 6 +test eq get Mx 0 len Emptyctx +same = true +for i ulong len Emptyctx +if ne get Meta i get Emptyctx i +same = false +end +end +test same +memsetup +test memenc 100 +for i ulong 4096 +put Unit i get Enc i +end +loadbeg +test loadcopy 0 +test eq get St 0 100 +test ctxbegin +test eq get Cx 0 4 +test eq get Cx 1 0 +test eq get Cx 2 0 +test not ctxmeta 6 +note Independent admission snapshot: incomplete catalog must not consume ids/history/job. +for i ulong 16 +put Appsave i get R i +end +put Joblen 0 get T 8 +put Qsave 0 get Q 0 +put Qsave 1 get Q 1 +put Saveos 0 get Outlen 0 +put Saveos 1 get Err 0 +for i ulong get Saveos 0 +put Saveout i get Outb i +end +for i ulong get T 8 +put Unitsave i get JobOut i +end +prompt +test not appask 0 +test eq get R 0 get Appsave 0 +test eq get R 1 get Appsave 1 +test eq get R 9 get Appsave 9 +test eq get Q 1 get Qsave 1 +test eq get Q 0 get Qsave 0 +test eq get T 8 get Joblen 0 +test eq get Outlen 0 get Saveos 0 +test eq get Err 0 get Saveos 1 +same = true +for i ulong get Saveos 0 +if ne get Outb i get Saveout i +same = false +end +end +test same +same = true +for i ulong get Joblen 0 +if ne get JobOut i get Unitsave i +same = false +end +end +test same +appcancel +fixture 3 0 +test eq ctxtake 3 1 +test eq get Ctxlen 3 len Note3 +test eq get Ctxstart 3 7 +test eq ctxtake 3 0 +test eq get Cx 1 1 +fixture 1 1 +test eq ctxtake 1 1 +test eq get Ctxgone 1 1 +fixture 2 0 +put Unit 64 33 +test eq ctxtake 2 2 +test eq get Cx 3 1 +test eq get Ctxgone 2 1 +test not ctxmeta 6 +fixture 0 0 +test eq ctxtake 0 1 +test eq get Cx 1 4 +test eq get Cx 2 1 +test eq get Cx 4 0 +test eq ctxtake 4 0 +test ctxmeta 6 +test eq get Mx 0 len MetaWant +same = true +for i ulong len MetaWant +if ne get Meta i get MetaWant i +same = false +end +end +test same +test ctxmeta 1 +test eq get Mx 0 len NewOnly +same = true +for i ulong len NewOnly +if ne get Meta i get NewOnly i +same = false +end +end +test same +test not ctxmeta 513 +test not ctxappend +test ctxmeta 6 +outreset +emitb 120 +test ctxappend +test eq get Outlen 0 add 1 len MetaWant +test eq get Outb 0 120 +same = true +for i ulong len MetaWant +if ne get Outb add i 1 get MetaWant i +same = false +end +end +test same +note Exercise the actual appask -> qsubmit job snapshot, not only metadata helpers. +prompt +test appask 1 +test eq get R 0 1 +test eq get Q 1 1 +test eq get R 9 1 +n = get T 8 +test ge n len MetaWant +same = ge n len MetaWant +if same +for i ulong len MetaWant +if ne get JobOut add sub n len MetaWant i get MetaWant i +same = false +end +end +end +test same +test not ctxbegin +test eq ctxtake 0 0 +appcancel +note Exact append capacity and one byte above, preserving Outb/length/error on refusal. +test ctxmeta 6 +n = sub ulong 4096 get Mx 0 +put Outlen 0 n +for i ulong n +put Outb i 90 +end +test ctxappend +test eq get Outlen 0 4096 +put Outlen 0 add n 1 +put Outb n 88 +test not ctxappend +test eq get Outlen 0 add n 1 +test eq get Outb n 88 +put Err 0 5 +test not ctxappend +test eq get Err 0 5 +outreset +mset32 36 5 +test not ctxmeta 6 +mset32 36 4 +mset32 32 33 +prompt +test not appask 2 +test eq get R 0 1 +test eq get Q 1 1 +mset32 32 1 +note Deliberately full valid facts make metadata fit but the whole JOB exceed4096. +for i ulong 3692 +put Mem i 0 +end +mset32 32 32 +for k ulong 32 +off = add 40 mul k 113 +for i ulong 47 +put Mem add off i 107 +end +for i ulong 63 +put Mem add add off 48 i 118 +end +end +test ctxmeta 6 +test le get Mx 0 4096 +prompt +test not appask 2 +test eq get R 0 1 +test eq get Q 1 1 +test eq get R 9 1 +note Catalog capacity and transaction exclusion. +mset32 36 512 +test ctxbegin +test eq get Cx 0 512 +test eq ctxtake 512 0 +fixture 511 0 +test eq ctxtake 511 1 +test eq get Ctxlen 511 len Note0 +test not ctxmeta 6 +put Tx 0 1 +test not ctxbegin +test eq ctxtake 0 0 +put Tx 0 0 +put Nt 0 1 +test not ctxbegin +test eq ctxtake 0 0 +put Nt 0 0 +mset32 36 513 +test not ctxbegin +test eq get Cx 0 512 +note Load ten real records, select exactly the newest six, and allow zero selected. +for i ulong 3692 +put Mem i 0 +end +mset32 36 10 +test ctxbegin +for k ulong 10 +put Ns 0 2 +put Ns 1 k +put Ns 2 7 +put Ns 3 0 +put Note 0 78 +put Note 1 uchar add 48 k +test noteenc +for i ulong 4096 +put Unit i get Enc i +end +test eq ctxtake k 1 +end +test ctxmeta 6 +test eq get Mx 0 len Lastsix +same = true +for i ulong len Lastsix +if ne get Meta i get Lastsix i +same = false +end +end +test same +test ctxmeta 0 +test eq get Mx 0 len Emptyctx +note Context construction cannot overwrite a staged memory/note transaction image. +for i ulong 4096 +put Unitsave i get Unit i +put Unitsave add i 4096 get Enc i +end +test ctxmeta 6 +same = true +for i ulong 4096 +if ne get Unit i get Unitsave i +same = false +end +if ne get Enc i get Unitsave add i 4096 +same = false +end +end +test same +memsetup +mset32 36 0 +mset32 0 4294967295 +put Mem 152 1 +test ctxmeta 6 +test eq get Mx 0 len Plural +same = true +for i ulong len Plural +if ne get Meta i get Plural i +same = false +end +end +test same +put Mem 40 9 +test not ctxmeta 6 +test not ctxappend +put Mem 40 103 +for i ulong 48 +put Mem add i 40 107 +end +test not ctxmeta 6 +note Thirty-two full facts and six full notes overflow metadata itself, not only JOB. +for i ulong 3692 +put Mem i 0 +end +mset32 32 32 +mset32 36 6 +for k ulong 32 +off = add 40 mul k 113 +for i ulong 47 +put Mem add off i 107 +end +for i ulong 63 +put Mem add add off 48 i 118 +end +end +test ctxbegin +for k ulong 6 +put Ns 0 127 +put Ns 1 k +put Ns 2 7 +put Ns 3 0 +for i ulong 127 +put Note i 110 +end +test noteenc +for i ulong 4096 +put Unit i get Enc i +end +test eq ctxtake k 1 +end +test not ctxmeta 6 +test eq get Mx 1 1 +outreset +emitb 90 +test not ctxappend +test eq get Outlen 0 1 +test eq get Outb 0 90 +prompt +test not appask 2 +test eq get R 0 1 +test eq get Q 1 1 +ret int get Fails 0 +end diff --git a/evidence/allen-omega-L694/L746/independent-review/probes/context-independent.full.om b/evidence/allen-omega-L694/L746/independent-review/probes/context-independent.full.om new file mode 100644 index 00000000..313faadf --- /dev/null +++ b/evidence/allen-omega-L694/L746/independent-review/probes/context-independent.full.om @@ -0,0 +1,3840 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +text Who "Drake" +text Selfname "Allen" +text Fkey "gate code" +text Fval "4471" +text Note0 "Meet at noon." +text Note1 "Old private note." +text Note3 "Bring tools." +text MetaWant "\tself=Allen\tname=Drake\tstarts=7\tfact gate code is 4471\tnote Bring tools.\tnote Meet at noon." +text NewOnly "\tself=Allen\tname=Drake\tstarts=7\tfact gate code is 4471\tnote Bring tools." +text Emptyctx "\tself=Allen\tstarts=0" +text Lastsix "\tself=Allen\tstarts=0\tnote N9\tnote N8\tnote N7\tnote N6\tnote N5\tnote N4" +text Plural "\tself=Allen\tname=Drake\tstarts=4294967295\tfact gate code are 4471" +global Unitsave uchar 8192 +global Saveout uchar 8192 +global Saveos ulong 2 +global Appsave ulong 16 +global Joblen ulong 1 +global Qsave ulong 2 +fn test ok bool to void +put Saveos 0 get Outlen 0 +put Saveos 1 get Err 0 +for i ulong get Outlen 0 +put Saveout i get Outb i +end +check ok add get Checks 0 1 +for i ulong get Saveos 0 +put Outb i get Saveout i +end +put Outlen 0 get Saveos 0 +put Err 0 get Saveos 1 +end +fn fixture index ulong gone ulong to void +put Ns 0 len Note0 +put Ns 1 index +put Ns 2 7 +put Ns 3 gone +for i ulong len Note0 +put Note i get Note0 i +end +if eq index 1 +put Ns 0 len Note1 +for i ulong len Note1 +put Note i get Note1 i +end +end +if eq index 3 +put Ns 0 len Note3 +for i ulong len Note3 +put Note i get Note3 i +end +end +test noteenc +for i ulong 4096 +put Unit i get Enc i +end +end +fn memsetup to void +for i ulong 3692 +put Mem i 0 +end +mset32 0 7 +mset32 32 1 +mset32 36 4 +for i ulong len Who +put Mem add i 8 get Who i +end +for i ulong len Fkey +put Mem add i 40 get Fkey i +end +for i ulong len Fval +put Mem add i 88 get Fval i +end +for i ulong len Selfname +put Mem add i 153 get Selfname i +end +end +fn prompt to void +put Inlen 0 2 +put In 0 104 +put In 1 105 +end +fn main to int +test appinit 123 0 +test ctxmeta 6 +test eq get Mx 0 len Emptyctx +same = true +for i ulong len Emptyctx +if ne get Meta i get Emptyctx i +same = false +end +end +test same +memsetup +test memenc 100 +for i ulong 4096 +put Unit i get Enc i +end +loadbeg +test loadcopy 0 +test eq get St 0 100 +test ctxbegin +test eq get Cx 0 4 +test eq get Cx 1 0 +test eq get Cx 2 0 +test not ctxmeta 6 +note Independent admission snapshot: incomplete catalog must not consume ids/history/job. +for i ulong 16 +put Appsave i get R i +end +put Joblen 0 get T 8 +put Qsave 0 get Q 0 +put Qsave 1 get Q 1 +put Saveos 0 get Outlen 0 +put Saveos 1 get Err 0 +for i ulong get Saveos 0 +put Saveout i get Outb i +end +for i ulong get T 8 +put Unitsave i get JobOut i +end +prompt +test not appask 0 +test eq get R 0 get Appsave 0 +test eq get R 1 get Appsave 1 +test eq get R 9 get Appsave 9 +test eq get Q 1 get Qsave 1 +test eq get Q 0 get Qsave 0 +test eq get T 8 get Joblen 0 +test eq get Outlen 0 get Saveos 0 +test eq get Err 0 get Saveos 1 +same = true +for i ulong get Saveos 0 +if ne get Outb i get Saveout i +same = false +end +end +test same +same = true +for i ulong get Joblen 0 +if ne get JobOut i get Unitsave i +same = false +end +end +test same +appcancel +fixture 3 0 +test eq ctxtake 3 1 +test eq get Ctxlen 3 len Note3 +test eq get Ctxstart 3 7 +test eq ctxtake 3 0 +test eq get Cx 1 1 +fixture 1 1 +test eq ctxtake 1 1 +test eq get Ctxgone 1 1 +fixture 2 0 +put Unit 64 33 +test eq ctxtake 2 2 +test eq get Cx 3 1 +test eq get Ctxgone 2 1 +test not ctxmeta 6 +fixture 0 0 +test eq ctxtake 0 1 +test eq get Cx 1 4 +test eq get Cx 2 1 +test eq get Cx 4 0 +test eq ctxtake 4 0 +test ctxmeta 6 +test eq get Mx 0 len MetaWant +same = true +for i ulong len MetaWant +if ne get Meta i get MetaWant i +same = false +end +end +test same +test ctxmeta 1 +test eq get Mx 0 len NewOnly +same = true +for i ulong len NewOnly +if ne get Meta i get NewOnly i +same = false +end +end +test same +test not ctxmeta 513 +test not ctxappend +test ctxmeta 6 +outreset +emitb 120 +test ctxappend +test eq get Outlen 0 add 1 len MetaWant +test eq get Outb 0 120 +same = true +for i ulong len MetaWant +if ne get Outb add i 1 get MetaWant i +same = false +end +end +test same +note Exercise the actual appask -> qsubmit job snapshot, not only metadata helpers. +prompt +test appask 1 +test eq get R 0 1 +test eq get Q 1 1 +test eq get R 9 1 +n = get T 8 +test ge n len MetaWant +same = ge n len MetaWant +if same +for i ulong len MetaWant +if ne get JobOut add sub n len MetaWant i get MetaWant i +same = false +end +end +end +test same +test not ctxbegin +test eq ctxtake 0 0 +appcancel +note Exact append capacity and one byte above, preserving Outb/length/error on refusal. +test ctxmeta 6 +n = sub ulong 4096 get Mx 0 +put Outlen 0 n +for i ulong n +put Outb i 90 +end +test ctxappend +test eq get Outlen 0 4096 +put Outlen 0 add n 1 +put Outb n 88 +test not ctxappend +test eq get Outlen 0 add n 1 +test eq get Outb n 88 +put Err 0 5 +test not ctxappend +test eq get Err 0 5 +outreset +mset32 36 5 +test not ctxmeta 6 +mset32 36 4 +mset32 32 33 +prompt +test not appask 2 +test eq get R 0 1 +test eq get Q 1 1 +mset32 32 1 +note Deliberately full valid facts make metadata fit but the whole JOB exceed4096. +for i ulong 3692 +put Mem i 0 +end +mset32 32 32 +for k ulong 32 +off = add 40 mul k 113 +for i ulong 47 +put Mem add off i 107 +end +for i ulong 63 +put Mem add add off 48 i 118 +end +end +test ctxmeta 6 +test le get Mx 0 4096 +prompt +test not appask 2 +test eq get R 0 1 +test eq get Q 1 1 +test eq get R 9 1 +note Catalog capacity and transaction exclusion. +mset32 36 512 +test ctxbegin +test eq get Cx 0 512 +test eq ctxtake 512 0 +fixture 511 0 +test eq ctxtake 511 1 +test eq get Ctxlen 511 len Note0 +test not ctxmeta 6 +put Tx 0 1 +test not ctxbegin +test eq ctxtake 0 0 +put Tx 0 0 +put Nt 0 1 +test not ctxbegin +test eq ctxtake 0 0 +put Nt 0 0 +mset32 36 513 +test not ctxbegin +test eq get Cx 0 512 +note Load ten real records, select exactly the newest six, and allow zero selected. +for i ulong 3692 +put Mem i 0 +end +mset32 36 10 +test ctxbegin +for k ulong 10 +put Ns 0 2 +put Ns 1 k +put Ns 2 7 +put Ns 3 0 +put Note 0 78 +put Note 1 uchar add 48 k +test noteenc +for i ulong 4096 +put Unit i get Enc i +end +test eq ctxtake k 1 +end +test ctxmeta 6 +test eq get Mx 0 len Lastsix +same = true +for i ulong len Lastsix +if ne get Meta i get Lastsix i +same = false +end +end +test same +test ctxmeta 0 +test eq get Mx 0 len Emptyctx +note Context construction cannot overwrite a staged memory/note transaction image. +for i ulong 4096 +put Unitsave i get Unit i +put Unitsave add i 4096 get Enc i +end +test ctxmeta 6 +same = true +for i ulong 4096 +if ne get Unit i get Unitsave i +same = false +end +if ne get Enc i get Unitsave add i 4096 +same = false +end +end +test same +memsetup +mset32 36 0 +mset32 0 4294967295 +put Mem 152 1 +test ctxmeta 6 +test eq get Mx 0 len Plural +same = true +for i ulong len Plural +if ne get Meta i get Plural i +same = false +end +end +test same +put Mem 40 9 +test not ctxmeta 6 +test not ctxappend +put Mem 40 103 +for i ulong 48 +put Mem add i 40 107 +end +test not ctxmeta 6 +note Thirty-two full facts and six full notes overflow metadata itself, not only JOB. +for i ulong 3692 +put Mem i 0 +end +mset32 32 32 +mset32 36 6 +for k ulong 32 +off = add 40 mul k 113 +for i ulong 47 +put Mem add off i 107 +end +for i ulong 63 +put Mem add add off 48 i 118 +end +end +test ctxbegin +for k ulong 6 +put Ns 0 127 +put Ns 1 k +put Ns 2 7 +put Ns 3 0 +for i ulong 127 +put Note i 110 +end +test noteenc +for i ulong 4096 +put Unit i get Enc i +end +test eq ctxtake k 1 +end +test not ctxmeta 6 +test eq get Mx 1 1 +outreset +emitb 90 +test not ctxappend +test eq get Outlen 0 1 +test eq get Outb 0 90 +prompt +test not appask 2 +test eq get R 0 1 +test eq get Q 1 1 +ret int get Fails 0 +end diff --git a/evidence/allen-omega-L694/L746/independent-review/probes/context-independent.om b/evidence/allen-omega-L694/L746/independent-review/probes/context-independent.om new file mode 100644 index 00000000..561a6bc5 --- /dev/null +++ b/evidence/allen-omega-L694/L746/independent-review/probes/context-independent.om @@ -0,0 +1,397 @@ +text Who "Drake" +text Selfname "Allen" +text Fkey "gate code" +text Fval "4471" +text Note0 "Meet at noon." +text Note1 "Old private note." +text Note3 "Bring tools." +text MetaWant "\tself=Allen\tname=Drake\tstarts=7\tfact gate code is 4471\tnote Bring tools.\tnote Meet at noon." +text NewOnly "\tself=Allen\tname=Drake\tstarts=7\tfact gate code is 4471\tnote Bring tools." +text Emptyctx "\tself=Allen\tstarts=0" +text Lastsix "\tself=Allen\tstarts=0\tnote N9\tnote N8\tnote N7\tnote N6\tnote N5\tnote N4" +text Plural "\tself=Allen\tname=Drake\tstarts=4294967295\tfact gate code are 4471" +global Unitsave uchar 8192 +global Saveout uchar 8192 +global Saveos ulong 2 +global Appsave ulong 16 +global Joblen ulong 1 +global Qsave ulong 2 +fn test ok bool to void +put Saveos 0 get Outlen 0 +put Saveos 1 get Err 0 +for i ulong get Outlen 0 +put Saveout i get Outb i +end +check ok add get Checks 0 1 +for i ulong get Saveos 0 +put Outb i get Saveout i +end +put Outlen 0 get Saveos 0 +put Err 0 get Saveos 1 +end +fn fixture index ulong gone ulong to void +put Ns 0 len Note0 +put Ns 1 index +put Ns 2 7 +put Ns 3 gone +for i ulong len Note0 +put Note i get Note0 i +end +if eq index 1 +put Ns 0 len Note1 +for i ulong len Note1 +put Note i get Note1 i +end +end +if eq index 3 +put Ns 0 len Note3 +for i ulong len Note3 +put Note i get Note3 i +end +end +test noteenc +for i ulong 4096 +put Unit i get Enc i +end +end +fn memsetup to void +for i ulong 3692 +put Mem i 0 +end +mset32 0 7 +mset32 32 1 +mset32 36 4 +for i ulong len Who +put Mem add i 8 get Who i +end +for i ulong len Fkey +put Mem add i 40 get Fkey i +end +for i ulong len Fval +put Mem add i 88 get Fval i +end +for i ulong len Selfname +put Mem add i 153 get Selfname i +end +end +fn prompt to void +put Inlen 0 2 +put In 0 104 +put In 1 105 +end +fn main to int +test appinit 123 0 +test ctxmeta 6 +test eq get Mx 0 len Emptyctx +same = true +for i ulong len Emptyctx +if ne get Meta i get Emptyctx i +same = false +end +end +test same +memsetup +test memenc 100 +for i ulong 4096 +put Unit i get Enc i +end +loadbeg +test loadcopy 0 +test eq get St 0 100 +test ctxbegin +test eq get Cx 0 4 +test eq get Cx 1 0 +test eq get Cx 2 0 +test not ctxmeta 6 +note Independent admission snapshot: incomplete catalog must not consume ids/history/job. +for i ulong 16 +put Appsave i get R i +end +put Joblen 0 get T 8 +put Qsave 0 get Q 0 +put Qsave 1 get Q 1 +put Saveos 0 get Outlen 0 +put Saveos 1 get Err 0 +for i ulong get Saveos 0 +put Saveout i get Outb i +end +for i ulong get T 8 +put Unitsave i get JobOut i +end +prompt +test not appask 0 +test eq get R 0 get Appsave 0 +test eq get R 1 get Appsave 1 +test eq get R 9 get Appsave 9 +test eq get Q 1 get Qsave 1 +test eq get Q 0 get Qsave 0 +test eq get T 8 get Joblen 0 +test eq get Outlen 0 get Saveos 0 +test eq get Err 0 get Saveos 1 +same = true +for i ulong get Saveos 0 +if ne get Outb i get Saveout i +same = false +end +end +test same +same = true +for i ulong get Joblen 0 +if ne get JobOut i get Unitsave i +same = false +end +end +test same +appcancel +fixture 3 0 +test eq ctxtake 3 1 +test eq get Ctxlen 3 len Note3 +test eq get Ctxstart 3 7 +test eq ctxtake 3 0 +test eq get Cx 1 1 +fixture 1 1 +test eq ctxtake 1 1 +test eq get Ctxgone 1 1 +fixture 2 0 +put Unit 64 33 +test eq ctxtake 2 2 +test eq get Cx 3 1 +test eq get Ctxgone 2 1 +test not ctxmeta 6 +fixture 0 0 +test eq ctxtake 0 1 +test eq get Cx 1 4 +test eq get Cx 2 1 +test eq get Cx 4 0 +test eq ctxtake 4 0 +test ctxmeta 6 +test eq get Mx 0 len MetaWant +same = true +for i ulong len MetaWant +if ne get Meta i get MetaWant i +same = false +end +end +test same +test ctxmeta 1 +test eq get Mx 0 len NewOnly +same = true +for i ulong len NewOnly +if ne get Meta i get NewOnly i +same = false +end +end +test same +test not ctxmeta 513 +test not ctxappend +test ctxmeta 6 +outreset +emitb 120 +test ctxappend +test eq get Outlen 0 add 1 len MetaWant +test eq get Outb 0 120 +same = true +for i ulong len MetaWant +if ne get Outb add i 1 get MetaWant i +same = false +end +end +test same +note Exercise the actual appask -> qsubmit job snapshot, not only metadata helpers. +prompt +test appask 1 +test eq get R 0 1 +test eq get Q 1 1 +test eq get R 9 1 +n = get T 8 +test ge n len MetaWant +same = ge n len MetaWant +if same +for i ulong len MetaWant +if ne get JobOut add sub n len MetaWant i get MetaWant i +same = false +end +end +end +test same +test not ctxbegin +test eq ctxtake 0 0 +appcancel +note Exact append capacity and one byte above, preserving Outb/length/error on refusal. +test ctxmeta 6 +n = sub ulong 4096 get Mx 0 +put Outlen 0 n +for i ulong n +put Outb i 90 +end +test ctxappend +test eq get Outlen 0 4096 +put Outlen 0 add n 1 +put Outb n 88 +test not ctxappend +test eq get Outlen 0 add n 1 +test eq get Outb n 88 +put Err 0 5 +test not ctxappend +test eq get Err 0 5 +outreset +mset32 36 5 +test not ctxmeta 6 +mset32 36 4 +mset32 32 33 +prompt +test not appask 2 +test eq get R 0 1 +test eq get Q 1 1 +mset32 32 1 +note Deliberately full valid facts make metadata fit but the whole JOB exceed4096. +for i ulong 3692 +put Mem i 0 +end +mset32 32 32 +for k ulong 32 +off = add 40 mul k 113 +for i ulong 47 +put Mem add off i 107 +end +for i ulong 63 +put Mem add add off 48 i 118 +end +end +test ctxmeta 6 +test le get Mx 0 4096 +prompt +test not appask 2 +test eq get R 0 1 +test eq get Q 1 1 +test eq get R 9 1 +note Catalog capacity and transaction exclusion. +mset32 36 512 +test ctxbegin +test eq get Cx 0 512 +test eq ctxtake 512 0 +fixture 511 0 +test eq ctxtake 511 1 +test eq get Ctxlen 511 len Note0 +test not ctxmeta 6 +put Tx 0 1 +test not ctxbegin +test eq ctxtake 0 0 +put Tx 0 0 +put Nt 0 1 +test not ctxbegin +test eq ctxtake 0 0 +put Nt 0 0 +mset32 36 513 +test not ctxbegin +test eq get Cx 0 512 +note Load ten real records, select exactly the newest six, and allow zero selected. +for i ulong 3692 +put Mem i 0 +end +mset32 36 10 +test ctxbegin +for k ulong 10 +put Ns 0 2 +put Ns 1 k +put Ns 2 7 +put Ns 3 0 +put Note 0 78 +put Note 1 uchar add 48 k +test noteenc +for i ulong 4096 +put Unit i get Enc i +end +test eq ctxtake k 1 +end +test ctxmeta 6 +test eq get Mx 0 len Lastsix +same = true +for i ulong len Lastsix +if ne get Meta i get Lastsix i +same = false +end +end +test same +test ctxmeta 0 +test eq get Mx 0 len Emptyctx +note Context construction cannot overwrite a staged memory/note transaction image. +for i ulong 4096 +put Unitsave i get Unit i +put Unitsave add i 4096 get Enc i +end +test ctxmeta 6 +same = true +for i ulong 4096 +if ne get Unit i get Unitsave i +same = false +end +if ne get Enc i get Unitsave add i 4096 +same = false +end +end +test same +memsetup +mset32 36 0 +mset32 0 4294967295 +put Mem 152 1 +test ctxmeta 6 +test eq get Mx 0 len Plural +same = true +for i ulong len Plural +if ne get Meta i get Plural i +same = false +end +end +test same +put Mem 40 9 +test not ctxmeta 6 +test not ctxappend +put Mem 40 103 +for i ulong 48 +put Mem add i 40 107 +end +test not ctxmeta 6 +note Thirty-two full facts and six full notes overflow metadata itself, not only JOB. +for i ulong 3692 +put Mem i 0 +end +mset32 32 32 +mset32 36 6 +for k ulong 32 +off = add 40 mul k 113 +for i ulong 47 +put Mem add off i 107 +end +for i ulong 63 +put Mem add add off 48 i 118 +end +end +test ctxbegin +for k ulong 6 +put Ns 0 127 +put Ns 1 k +put Ns 2 7 +put Ns 3 0 +for i ulong 127 +put Note i 110 +end +test noteenc +for i ulong 4096 +put Unit i get Enc i +end +test eq ctxtake k 1 +end +test not ctxmeta 6 +test eq get Mx 1 1 +outreset +emitb 90 +test not ctxappend +test eq get Outlen 0 1 +test eq get Outb 0 90 +prompt +test not appask 2 +test eq get R 0 1 +test eq get Q 1 1 +ret int get Fails 0 +end diff --git a/evidence/allen-omega-L694/L746/independent-review/probes/core.om b/evidence/allen-omega-L694/L746/independent-review/probes/core.om new file mode 100644 index 00000000..f33b766e --- /dev/null +++ b/evidence/allen-omega-L694/L746/independent-review/probes/core.om @@ -0,0 +1,3426 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end diff --git a/evidence/allen-omega-L694/L746/independent-review/report.md b/evidence/allen-omega-L694/L746/independent-review/report.md new file mode 100644 index 00000000..0504af64 --- /dev/null +++ b/evidence/allen-omega-L694/L746/independent-review/report.md @@ -0,0 +1,36 @@ +# L747 independent review — L746 restored-context / JOB binding + +## Verdict + +**No findings** in the scoped native Omega implementation at `be28deb21721f54fc46b5402076c7e8ac8fde151`, compared with parent `a65b70eb99a4d132c8c1f657f5cbb2a2fc1cd81d`. + +Scope reviewed: `native/omega/allen/context.om`, its `tests/context.om` integration coverage, `application.om`'s `appask -> jobbuild -> ctxappend -> qsubmit` path, and the related gate/README changes. This review does not repeat L737/L744 or the full 1479-check suite and makes no disk, live-model, service, target, or hardware qualification claim. + +## Independent source/build/probe receipts + +- Source repository: Spark `~/workspace/aienos-allen-omega-L694`; exact commit resolved to `be28deb21721f54fc46b5402076c7e8ac8fde151` (repository HEAD matched); working tree was clean at inspection. +- Private exact-source export: `~/handoffs/L747-review/native/omega/allen/` (Git archive of the pinned directory; 43 files). Export/member and SHA receipts: `logs/export-members.txt`, `logs/scoped-source.sha256`, `logs/pin-source.sha256`. +- Compiler: `~/handoffs/allen-omega-L694/omc`, SHA-256 `191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9` (`logs/compiler.sha256`). The exported `build-one.sh` checked this identity before build. +- Independent Omega probe: `probes/context-independent.om`; assembled exact-source input: `probes/context-independent.full.om`; build command used the exported `native/omega/allen/build-one.sh` into fresh `build/context-independent`. The compile returned success and produced a nonempty static AArch64 ELF64 EXEC, SHA-256 `4a53ec429504131fd48a6f2931a7244053ab9013291d46841dc69545addcabd6` (`logs/elf.txt`, `logs/probe.sha256`). No `INTERP`/`NEEDED` entries. +- Execution: `build/context-independent > logs/context-independent-v2.log`; exit status 0; 150 emitted checks, all `0` (all passed). This runs the Omega context and application test body against the freshly built native executable. +- The probe adds direct refusal-state snapshots around `appask` with an incomplete restored catalog. It asserts R/history, Q/session and sequence, pending `T8` job length and `JobOut` bytes, and outgoing `Outb`/length/error remain unchanged. The inherited context integration also runs real `appask`/`qsubmit`, checks the appended context at the tail of the queued `JobOut`, verifies deleted/damaged notes are omitted, and exercises whole-job overflow refusal. +- Source diff hygiene: `git diff --check -- ` returned 0 (`logs/diff-check.log`). + +## Probe iteration note + +The first probe revision (`logs/context-independent.failed-v1.log`, `probes/context-independent.failed-v1.full.om`) reported one failed assertion: it incorrectly expected `Q[0] == 0` after `appinit`; `qstart` correctly initializes `Q[0]` to run/session `123`. This was a probe expectation error, not a product failure. The corrected probe snapshots both Q fields before `appask` and compares against that state. Its rebuilt run passed all 150 checks. No production source was edited. + +## Boundary disposition + +Inspected the context catalog lifecycle (declared-count cap, loading/ready/visited/damaged state, duplicate/out-of-range refusal, deleted/damaged-note omission, and transaction exclusion), metadata staging/field validation/4096-byte append boundary, and the provider-facing `appask` ordering. The implementation validates restored context before variable-layout identity reads; stages metadata privately; appends before `qsubmit`; and rejects an incomplete catalog or oversized complete job before queue/history admission. No scoped correctness defect was reproduced. + +SHA integrity remains unkeyed and does not establish authentication or freshness. This is source review plus host-executed native Omega boundary evidence only. + +## Raw receipts + +All retained under `~/handoffs/L747-review/` on Spark: + +- `logs/scoped.diff`, `logs/diff-check.log` +- `logs/build-v2.log`, `logs/context-independent-v2.log`, `logs/probe.sha256`, `logs/elf.txt` +- failed probe revision/log: `probes/context-independent.failed-v1.full.om`, `logs/context-independent.failed-v1.log` +- corrected probe: `probes/context-independent.om`, `probes/context-independent.full.om` diff --git a/evidence/allen-omega-L694/L746/intent.log b/evidence/allen-omega-L694/L746/intent.log new file mode 100644 index 00000000..5371bd36 --- /dev/null +++ b/evidence/allen-omega-L694/L746/intent.log @@ -0,0 +1,8 @@ +501 0 +502 0 +503 0 +504 0 +505 0 +506 0 +507 0 +508 0 diff --git a/evidence/allen-omega-L694/L746/keepalive-mutant.log b/evidence/allen-omega-L694/L746/keepalive-mutant.log new file mode 100644 index 00000000..2e3415df --- /dev/null +++ b/evidence/allen-omega-L694/L746/keepalive-mutant.log @@ -0,0 +1,213 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 1 +19 1 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 1 +54 1 +55 1 +56 1 +57 0 +58 0 +59 1 +60 0 +61 0 +62 0 +63 0 +64 0 +65 1 +66 0 +67 0 +68 0 +69 1 +70 1 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 1 +170 0 +171 1 +172 1 +173 0 +174 1 +175 0 +176 0 +177 0 +178 1 +179 1 +180 1 +181 1 +182 1 +183 1 +184 1 +185 1 +186 1 +187 1 +188 1 +189 1 +190 1 +191 1 +192 1 +193 1 +194 1 +195 1 +196 1 +197 1 +198 0 +199 1 +200 0 +201 0 +202 1 +203 1 +204 1 +205 0 +206 1 +207 1 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 diff --git a/evidence/allen-omega-L694/L746/long.log b/evidence/allen-omega-L694/L746/long.log new file mode 100644 index 00000000..0a060bc8 --- /dev/null +++ b/evidence/allen-omega-L694/L746/long.log @@ -0,0 +1,292 @@ +401 0 +410 0 +411 0 +412 0 +413 0 +414 0 +415 0 +416 0 +417 0 +418 0 +419 0 +420 0 +421 0 +422 0 +423 0 +424 0 +425 0 +426 0 +427 0 +428 0 +429 0 +430 0 +431 0 +432 0 +433 0 +434 0 +435 0 +436 0 +437 0 +438 0 +439 0 +440 0 +441 0 +442 0 +443 0 +444 0 +445 0 +446 0 +447 0 +448 0 +449 0 +450 0 +451 0 +452 0 +453 0 +454 0 +455 0 +456 0 +457 0 +458 0 +459 0 +460 0 +461 0 +462 0 +463 0 +464 0 +465 0 +466 0 +467 0 +468 0 +469 0 +470 0 +471 0 +472 0 +473 0 +474 0 +475 0 +476 0 +477 0 +478 0 +479 0 +480 0 +481 0 +482 0 +483 0 +484 0 +485 0 +486 0 +487 0 +488 0 +489 0 +490 0 +491 0 +492 0 +493 0 +494 0 +495 0 +496 0 +497 0 +498 0 +499 0 +500 0 +501 0 +502 0 +503 0 +504 0 +505 0 +506 0 +507 0 +508 0 +509 0 +510 0 +511 0 +512 0 +513 0 +514 0 +515 0 +516 0 +517 0 +518 0 +519 0 +520 0 +521 0 +522 0 +523 0 +524 0 +525 0 +526 0 +527 0 +528 0 +529 0 +530 0 +531 0 +532 0 +533 0 +534 0 +535 0 +536 0 +537 0 +538 0 +539 0 +540 0 +541 0 +542 0 +543 0 +544 0 +545 0 +546 0 +547 0 +548 0 +549 0 +550 0 +402 0 +403 0 +404 0 +405 0 +406 0 +700 0 +701 0 +702 0 +703 0 +704 0 +705 0 +706 0 +707 0 +708 0 +709 0 +710 0 +711 0 +712 0 +713 0 +714 0 +715 0 +716 0 +717 0 +718 0 +719 0 +720 0 +721 0 +722 0 +723 0 +724 0 +725 0 +726 0 +727 0 +728 0 +729 0 +730 0 +731 0 +732 0 +733 0 +734 0 +735 0 +736 0 +737 0 +738 0 +739 0 +740 0 +741 0 +742 0 +743 0 +744 0 +745 0 +746 0 +747 0 +748 0 +749 0 +750 0 +751 0 +752 0 +753 0 +754 0 +755 0 +756 0 +757 0 +758 0 +759 0 +760 0 +761 0 +762 0 +763 0 +764 0 +765 0 +766 0 +767 0 +768 0 +769 0 +770 0 +771 0 +772 0 +773 0 +774 0 +775 0 +776 0 +777 0 +778 0 +779 0 +780 0 +781 0 +782 0 +783 0 +784 0 +785 0 +786 0 +787 0 +788 0 +789 0 +790 0 +791 0 +792 0 +793 0 +794 0 +795 0 +796 0 +797 0 +798 0 +799 0 +800 0 +801 0 +802 0 +803 0 +804 0 +805 0 +806 0 +807 0 +808 0 +809 0 +810 0 +811 0 +812 0 +813 0 +814 0 +815 0 +816 0 +817 0 +818 0 +819 0 +820 0 +821 0 +822 0 +823 0 +824 0 +825 0 +826 0 +827 0 +828 0 +829 0 +830 0 +831 0 +832 0 +833 0 +834 0 +835 0 +836 0 +837 0 +838 0 +839 0 +840 0 +841 0 +407 0 +408 0 +409 0 diff --git a/evidence/allen-omega-L694/L746/memory.log b/evidence/allen-omega-L694/L746/memory.log new file mode 100644 index 00000000..5928102e --- /dev/null +++ b/evidence/allen-omega-L694/L746/memory.log @@ -0,0 +1,79 @@ +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 0 +310 0 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +362 0 +363 0 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 0 +361 0 diff --git a/evidence/allen-omega-L694/L746/paint.log b/evidence/allen-omega-L694/L746/paint.log new file mode 100644 index 00000000..281a5bd2 --- /dev/null +++ b/evidence/allen-omega-L694/L746/paint.log @@ -0,0 +1,11 @@ +1101 0 +1102 0 +1103 0 +1104 0 +1105 0 +1106 0 +1107 0 +1108 0 +1109 0 +1110 0 +1111 0 diff --git a/evidence/allen-omega-L694/L746/pendingwire-mutant.log b/evidence/allen-omega-L694/L746/pendingwire-mutant.log new file mode 100644 index 00000000..48fb2008 --- /dev/null +++ b/evidence/allen-omega-L694/L746/pendingwire-mutant.log @@ -0,0 +1,182 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 1 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 diff --git a/evidence/allen-omega-L694/L746/readback-mutant.log b/evidence/allen-omega-L694/L746/readback-mutant.log new file mode 100644 index 00000000..268002ad --- /dev/null +++ b/evidence/allen-omega-L694/L746/readback-mutant.log @@ -0,0 +1,79 @@ +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 0 +310 0 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 1 +339 1 +340 0 +341 0 +342 0 +343 0 +344 1 +345 0 +346 0 +347 0 +348 0 +349 1 +350 1 +351 0 +352 0 +362 0 +363 0 +353 1 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 1 +361 0 diff --git a/evidence/allen-omega-L694/L746/red.exit b/evidence/allen-omega-L694/L746/red.exit new file mode 100644 index 00000000..a9c8fe82 --- /dev/null +++ b/evidence/allen-omega-L694/L746/red.exit @@ -0,0 +1 @@ +103 diff --git a/evidence/allen-omega-L694/L746/red.log b/evidence/allen-omega-L694/L746/red.log new file mode 100644 index 00000000..d828c614 --- /dev/null +++ b/evidence/allen-omega-L694/L746/red.log @@ -0,0 +1,62 @@ +1 0 +2 1 +3 1 +4 1 +5 1 +6 1 +7 0 +8 0 +9 0 +10 1 +11 1 +12 1 +13 0 +14 1 +15 1 +16 1 +17 0 +18 1 +19 0 +20 1 +21 1 +22 0 +23 1 +24 1 +25 1 +26 0 +27 0 +28 1 +29 1 +30 1 +31 0 +32 0 +33 1 +34 1 +35 1 +36 1 +37 1 +38 1 +39 0 +40 0 +41 1 +42 1 +43 1 +44 0 +45 1 +46 0 +47 1 +48 1 +49 1 +50 0 +51 1 +52 0 +53 0 +54 1 +55 1 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 diff --git a/evidence/allen-omega-L694/L746/red.om b/evidence/allen-omega-L694/L746/red.om new file mode 100644 index 00000000..b9a2bb25 --- /dev/null +++ b/evidence/allen-omega-L694/L746/red.om @@ -0,0 +1,3460 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +fn ctxbegin to bool +ret false +end +fn ctxtake index ulong to ulong +ret 0 +end +fn ctxmeta limit ulong to bool +ret false +end +fn ctxappend to bool +ret false +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +text Who "Drake" +text Selfname "Allen" +text Fkey "gate code" +text Fval "4471" +text Note0 "Meet at noon." +text Note1 "Old private note." +text Note3 "Bring tools." +text MetaWant "\tself=Allen\tname=Drake\tstarts=7\tfact gate code is 4471\tnote Bring tools.\tnote Meet at noon." +text NewOnly "\tself=Allen\tname=Drake\tstarts=7\tfact gate code is 4471\tnote Bring tools." +text Emptyctx "\tself=Allen\tstarts=0" +global Saveout uchar 8192 +global Saveos ulong 2 +fn test ok bool to void +put Saveos 0 get Outlen 0 +put Saveos 1 get Err 0 +for i ulong get Outlen 0 +put Saveout i get Outb i +end +check ok add get Checks 0 1 +for i ulong get Saveos 0 +put Outb i get Saveout i +end +put Outlen 0 get Saveos 0 +put Err 0 get Saveos 1 +end +fn fixture index ulong gone ulong to void +put Ns 0 len Note0 +put Ns 1 index +put Ns 2 7 +put Ns 3 gone +for i ulong len Note0 +put Note i get Note0 i +end +if eq index 1 +put Ns 0 len Note1 +for i ulong len Note1 +put Note i get Note1 i +end +end +if eq index 3 +put Ns 0 len Note3 +for i ulong len Note3 +put Note i get Note3 i +end +end +test noteenc +for i ulong 4096 +put Unit i get Enc i +end +end +fn memsetup to void +for i ulong 3692 +put Mem i 0 +end +mset32 0 7 +mset32 32 1 +mset32 36 4 +for i ulong len Who +put Mem add i 8 get Who i +end +for i ulong len Fkey +put Mem add i 40 get Fkey i +end +for i ulong len Fval +put Mem add i 88 get Fval i +end +for i ulong len Selfname +put Mem add i 153 get Selfname i +end +end +fn prompt to void +put Inlen 0 2 +put In 0 104 +put In 1 105 +end +fn main to int +test appinit 123 0 +test ctxmeta 6 +test eq get Mx 0 len Emptyctx +same = true +for i ulong len Emptyctx +if ne get Meta i get Emptyctx i +same = false +end +end +test same +memsetup +test ctxbegin +test eq get Cx 0 4 +test eq get Cx 1 0 +test eq get Cx 2 0 +test not ctxmeta 6 +prompt +test not appask 0 +test eq get R 0 0 +test eq get Q 1 0 +appcancel +fixture 3 0 +test eq ctxtake 3 1 +test eq get Ctxlen 3 len Note3 +test eq get Ctxstart 3 7 +test eq ctxtake 3 0 +test eq get Cx 1 1 +fixture 1 1 +test eq ctxtake 1 1 +test eq get Ctxgone 1 1 +fixture 2 0 +put Unit 64 33 +test eq ctxtake 2 2 +test eq get Cx 3 1 +test eq get Ctxgone 2 1 +test not ctxmeta 6 +fixture 0 0 +test eq ctxtake 0 1 +test eq get Cx 1 4 +test eq get Cx 2 1 +test eq get Cx 4 0 +test eq ctxtake 4 0 +test ctxmeta 6 +test eq get Mx 0 len MetaWant +same = true +for i ulong len MetaWant +if ne get Meta i get MetaWant i +same = false +end +end +test same +test ctxmeta 1 +test eq get Mx 0 len NewOnly +same = true +for i ulong len NewOnly +if ne get Meta i get NewOnly i +same = false +end +end +test same +test not ctxmeta 513 +test not ctxappend +test ctxmeta 6 +outreset +emitb 120 +test ctxappend +test eq get Outlen 0 add 1 len MetaWant +test eq get Outb 0 120 +same = true +for i ulong len MetaWant +if ne get Outb add i 1 get MetaWant i +same = false +end +end +test same +note Exercise the actual appask -> qsubmit job snapshot, not only metadata helpers. +prompt +test appask 1 +test eq get R 0 1 +test eq get Q 1 1 +test eq get R 9 1 +n = get T 8 +test ge n len MetaWant +same = ge n len MetaWant +if same +for i ulong len MetaWant +if ne get JobOut add sub n len MetaWant i get MetaWant i +same = false +end +end +end +test same +test not ctxbegin +test eq ctxtake 0 0 +appcancel +note Exact append capacity and one byte above, preserving Outb/length/error on refusal. +test ctxmeta 6 +n = sub ulong 4096 get Mx 0 +put Outlen 0 n +for i ulong n +put Outb i 90 +end +test ctxappend +test eq get Outlen 0 4096 +put Outlen 0 add n 1 +put Outb n 88 +test not ctxappend +test eq get Outlen 0 add n 1 +test eq get Outb n 88 +put Err 0 5 +test not ctxappend +test eq get Err 0 5 +outreset +mset32 36 5 +test not ctxmeta 6 +mset32 36 4 +mset32 32 33 +prompt +test not appask 2 +test eq get R 0 1 +test eq get Q 1 1 +mset32 32 1 +note Deliberately full valid facts make metadata fit but the whole JOB exceed4096. +for i ulong 3692 +put Mem i 0 +end +mset32 32 32 +for k ulong 32 +off = add 40 mul k 113 +for i ulong 47 +put Mem add off i 107 +end +for i ulong 63 +put Mem add add off 48 i 118 +end +end +test ctxmeta 6 +test le get Mx 0 4096 +prompt +test not appask 2 +test eq get R 0 1 +test eq get Q 1 1 +test eq get R 9 1 +note Catalog capacity and transaction exclusion. +mset32 36 512 +test ctxbegin +test eq get Cx 0 512 +test eq ctxtake 512 0 +fixture 511 0 +test eq ctxtake 511 1 +test eq get Ctxlen 511 len Note0 +test not ctxmeta 6 +put Tx 0 1 +test not ctxbegin +test eq ctxtake 0 0 +put Tx 0 0 +put Nt 0 1 +test not ctxbegin +test eq ctxtake 0 0 +put Nt 0 0 +mset32 36 513 +test not ctxbegin +test eq get Cx 0 512 +ret int get Fails 0 +end diff --git a/evidence/allen-omega-L694/L746/red2.exit b/evidence/allen-omega-L694/L746/red2.exit new file mode 100644 index 00000000..9e5feb52 --- /dev/null +++ b/evidence/allen-omega-L694/L746/red2.exit @@ -0,0 +1 @@ +46 diff --git a/evidence/allen-omega-L694/L746/red2.log b/evidence/allen-omega-L694/L746/red2.log new file mode 100644 index 00000000..a34a5259 --- /dev/null +++ b/evidence/allen-omega-L694/L746/red2.log @@ -0,0 +1,84 @@ +1 0 +2 1 +3 1 +4 1 +5 1 +6 1 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 1 +15 1 +16 1 +17 0 +18 1 +19 0 +20 1 +21 1 +22 0 +23 1 +24 1 +25 1 +26 0 +27 0 +28 1 +29 1 +30 1 +31 0 +32 0 +33 1 +34 1 +35 1 +36 1 +37 1 +38 1 +39 0 +40 0 +41 1 +42 1 +43 1 +44 0 +45 1 +46 1 +47 1 +48 1 +49 1 +50 1 +51 1 +52 0 +53 0 +54 1 +55 1 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 1 +65 1 +66 1 +67 0 +68 0 +69 1 +70 1 +71 1 +72 1 +73 1 +74 0 +75 0 +76 1 +77 1 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 1 diff --git a/evidence/allen-omega-L694/L746/red2.om b/evidence/allen-omega-L694/L746/red2.om new file mode 100644 index 00000000..cbc59b48 --- /dev/null +++ b/evidence/allen-omega-L694/L746/red2.om @@ -0,0 +1,3467 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +fn ctxbegin to bool +ret false +end +fn ctxtake index ulong to ulong +ret 0 +end +fn ctxmeta limit ulong to bool +ret false +end +fn ctxappend to bool +ret false +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +text Who "Drake" +text Selfname "Allen" +text Fkey "gate code" +text Fval "4471" +text Note0 "Meet at noon." +text Note1 "Old private note." +text Note3 "Bring tools." +text MetaWant "\tself=Allen\tname=Drake\tstarts=7\tfact gate code is 4471\tnote Bring tools.\tnote Meet at noon." +text NewOnly "\tself=Allen\tname=Drake\tstarts=7\tfact gate code is 4471\tnote Bring tools." +text Emptyctx "\tself=Allen\tstarts=0" +global Saveout uchar 8192 +global Saveos ulong 2 +fn test ok bool to void +put Saveos 0 get Outlen 0 +put Saveos 1 get Err 0 +for i ulong get Outlen 0 +put Saveout i get Outb i +end +check ok add get Checks 0 1 +for i ulong get Saveos 0 +put Outb i get Saveout i +end +put Outlen 0 get Saveos 0 +put Err 0 get Saveos 1 +end +fn fixture index ulong gone ulong to void +put Ns 0 len Note0 +put Ns 1 index +put Ns 2 7 +put Ns 3 gone +for i ulong len Note0 +put Note i get Note0 i +end +if eq index 1 +put Ns 0 len Note1 +for i ulong len Note1 +put Note i get Note1 i +end +end +if eq index 3 +put Ns 0 len Note3 +for i ulong len Note3 +put Note i get Note3 i +end +end +test noteenc +for i ulong 4096 +put Unit i get Enc i +end +end +fn memsetup to void +for i ulong 3692 +put Mem i 0 +end +mset32 0 7 +mset32 32 1 +mset32 36 4 +for i ulong len Who +put Mem add i 8 get Who i +end +for i ulong len Fkey +put Mem add i 40 get Fkey i +end +for i ulong len Fval +put Mem add i 88 get Fval i +end +for i ulong len Selfname +put Mem add i 153 get Selfname i +end +end +fn prompt to void +put Inlen 0 2 +put In 0 104 +put In 1 105 +end +fn main to int +test appinit 123 0 +test ctxmeta 6 +test eq get Mx 0 len Emptyctx +same = true +for i ulong len Emptyctx +if ne get Meta i get Emptyctx i +same = false +end +end +test same +memsetup +test ctxbegin +test eq get Cx 0 4 +test eq get Cx 1 0 +test eq get Cx 2 0 +test not ctxmeta 6 +prompt +test not appask 0 +test eq get R 0 0 +test eq get Q 1 0 +appcancel +fixture 3 0 +test eq ctxtake 3 1 +test eq get Ctxlen 3 len Note3 +test eq get Ctxstart 3 7 +test eq ctxtake 3 0 +test eq get Cx 1 1 +fixture 1 1 +test eq ctxtake 1 1 +test eq get Ctxgone 1 1 +fixture 2 0 +put Unit 64 33 +test eq ctxtake 2 2 +test eq get Cx 3 1 +test eq get Ctxgone 2 1 +test not ctxmeta 6 +fixture 0 0 +test eq ctxtake 0 1 +test eq get Cx 1 4 +test eq get Cx 2 1 +test eq get Cx 4 0 +test eq ctxtake 4 0 +test ctxmeta 6 +test eq get Mx 0 len MetaWant +same = true +for i ulong len MetaWant +if ne get Meta i get MetaWant i +same = false +end +end +test same +test ctxmeta 1 +test eq get Mx 0 len NewOnly +same = true +for i ulong len NewOnly +if ne get Meta i get NewOnly i +same = false +end +end +test same +test not ctxmeta 513 +test not ctxappend +test ctxmeta 6 +outreset +emitb 120 +test ctxappend +test eq get Outlen 0 add 1 len MetaWant +test eq get Outb 0 120 +same = true +for i ulong len MetaWant +if ne get Outb add i 1 get MetaWant i +same = false +end +end +test same +note Exercise the actual appask -> qsubmit job snapshot, not only metadata helpers. +prompt +test appask 1 +test eq get R 0 1 +test eq get Q 1 1 +test eq get R 9 1 +n = get T 8 +test ge n len MetaWant +same = ge n len MetaWant +if same +for i ulong len MetaWant +if ne get JobOut add sub n len MetaWant i get MetaWant i +same = false +end +end +end +test same +test not ctxbegin +test eq ctxtake 0 0 +appcancel +note Exact append capacity and one byte above, preserving Outb/length/error on refusal. +test ctxmeta 6 +n = sub ulong 4096 get Mx 0 +put Outlen 0 n +for i ulong n +put Outb i 90 +end +test ctxappend +test eq get Outlen 0 4096 +put Outlen 0 add n 1 +put Outb n 88 +test not ctxappend +test eq get Outlen 0 add n 1 +test eq get Outb n 88 +put Err 0 5 +test not ctxappend +test eq get Err 0 5 +outreset +mset32 36 5 +test not ctxmeta 6 +mset32 36 4 +mset32 32 33 +prompt +test not appask 2 +test eq get R 0 1 +test eq get Q 1 1 +mset32 32 1 +note Deliberately full valid facts make metadata fit but the whole JOB exceed4096. +for i ulong 3692 +put Mem i 0 +end +mset32 32 32 +for k ulong 32 +off = add 40 mul k 113 +for i ulong 47 +put Mem add off i 107 +end +for i ulong 63 +put Mem add add off 48 i 118 +end +end +test ctxmeta 6 +test le get Mx 0 4096 +prompt +test not appask 2 +test eq get R 0 1 +test eq get Q 1 1 +test eq get R 9 1 +note Catalog capacity and transaction exclusion. +mset32 36 512 +test ctxbegin +test eq get Cx 0 512 +test eq ctxtake 512 0 +fixture 511 0 +test eq ctxtake 511 1 +test eq get Ctxlen 511 len Note0 +test not ctxmeta 6 +put Tx 0 1 +test not ctxbegin +test eq ctxtake 0 0 +put Tx 0 0 +put Nt 0 1 +test not ctxbegin +test eq ctxtake 0 0 +put Nt 0 0 +mset32 36 513 +test not ctxbegin +test eq get Cx 0 512 +ret int get Fails 0 +end diff --git a/evidence/allen-omega-L694/L746/red3.exit b/evidence/allen-omega-L694/L746/red3.exit new file mode 100644 index 00000000..dd475631 --- /dev/null +++ b/evidence/allen-omega-L694/L746/red3.exit @@ -0,0 +1 @@ +76 diff --git a/evidence/allen-omega-L694/L746/red3.log b/evidence/allen-omega-L694/L746/red3.log new file mode 100644 index 00000000..584ad86c --- /dev/null +++ b/evidence/allen-omega-L694/L746/red3.log @@ -0,0 +1,142 @@ +1 0 +2 1 +3 1 +4 1 +5 0 +6 0 +7 0 +8 1 +9 1 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 1 +18 1 +19 1 +20 0 +21 1 +22 0 +23 1 +24 1 +25 0 +26 1 +27 1 +28 1 +29 0 +30 0 +31 1 +32 1 +33 1 +34 0 +35 0 +36 1 +37 1 +38 1 +39 1 +40 1 +41 1 +42 0 +43 0 +44 1 +45 1 +46 1 +47 0 +48 1 +49 1 +50 1 +51 1 +52 1 +53 1 +54 1 +55 0 +56 0 +57 1 +58 1 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 1 +68 1 +69 1 +70 0 +71 0 +72 1 +73 1 +74 1 +75 1 +76 1 +77 0 +78 0 +79 1 +80 1 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 1 +88 1 +89 0 +90 1 +91 0 +92 1 +93 0 +94 1 +95 0 +96 1 +97 0 +98 1 +99 0 +100 1 +101 0 +102 1 +103 0 +104 1 +105 0 +106 1 +107 0 +108 1 +109 1 +110 1 +111 1 +112 1 +113 1 +114 1 +115 0 +116 1 +117 1 +118 1 +119 0 +120 0 +121 0 +122 1 +123 0 +124 1 +125 0 +126 1 +127 0 +128 1 +129 0 +130 1 +131 0 +132 1 +133 0 +134 1 +135 0 +136 1 +137 0 +138 0 +139 0 +140 0 +141 1 +142 1 diff --git a/evidence/allen-omega-L694/L746/red3.om b/evidence/allen-omega-L694/L746/red3.om new file mode 100644 index 00000000..4252fb20 --- /dev/null +++ b/evidence/allen-omega-L694/L746/red3.om @@ -0,0 +1,3585 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +fn ctxbegin to bool +ret false +end +fn ctxtake index ulong to ulong +ret 0 +end +fn ctxmeta limit ulong to bool +ret false +end +fn ctxappend to bool +ret false +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +text Who "Drake" +text Selfname "Allen" +text Fkey "gate code" +text Fval "4471" +text Note0 "Meet at noon." +text Note1 "Old private note." +text Note3 "Bring tools." +text MetaWant "\tself=Allen\tname=Drake\tstarts=7\tfact gate code is 4471\tnote Bring tools.\tnote Meet at noon." +text NewOnly "\tself=Allen\tname=Drake\tstarts=7\tfact gate code is 4471\tnote Bring tools." +text Emptyctx "\tself=Allen\tstarts=0" +text Lastsix "\tself=Allen\tstarts=0\tnote N9\tnote N8\tnote N7\tnote N6\tnote N5\tnote N4" +text Plural "\tself=Allen\tname=Drake\tstarts=4294967295\tfact gate code are 4471" +global Unitsave uchar 8192 +global Saveout uchar 8192 +global Saveos ulong 2 +fn test ok bool to void +put Saveos 0 get Outlen 0 +put Saveos 1 get Err 0 +for i ulong get Outlen 0 +put Saveout i get Outb i +end +check ok add get Checks 0 1 +for i ulong get Saveos 0 +put Outb i get Saveout i +end +put Outlen 0 get Saveos 0 +put Err 0 get Saveos 1 +end +fn fixture index ulong gone ulong to void +put Ns 0 len Note0 +put Ns 1 index +put Ns 2 7 +put Ns 3 gone +for i ulong len Note0 +put Note i get Note0 i +end +if eq index 1 +put Ns 0 len Note1 +for i ulong len Note1 +put Note i get Note1 i +end +end +if eq index 3 +put Ns 0 len Note3 +for i ulong len Note3 +put Note i get Note3 i +end +end +test noteenc +for i ulong 4096 +put Unit i get Enc i +end +end +fn memsetup to void +for i ulong 3692 +put Mem i 0 +end +mset32 0 7 +mset32 32 1 +mset32 36 4 +for i ulong len Who +put Mem add i 8 get Who i +end +for i ulong len Fkey +put Mem add i 40 get Fkey i +end +for i ulong len Fval +put Mem add i 88 get Fval i +end +for i ulong len Selfname +put Mem add i 153 get Selfname i +end +end +fn prompt to void +put Inlen 0 2 +put In 0 104 +put In 1 105 +end +fn main to int +test appinit 123 0 +test ctxmeta 6 +test eq get Mx 0 len Emptyctx +same = true +for i ulong len Emptyctx +if ne get Meta i get Emptyctx i +same = false +end +end +test same +memsetup +test memenc 100 +for i ulong 4096 +put Unit i get Enc i +end +loadbeg +test loadcopy 0 +test eq get St 0 100 +test ctxbegin +test eq get Cx 0 4 +test eq get Cx 1 0 +test eq get Cx 2 0 +test not ctxmeta 6 +prompt +test not appask 0 +test eq get R 0 0 +test eq get Q 1 0 +appcancel +fixture 3 0 +test eq ctxtake 3 1 +test eq get Ctxlen 3 len Note3 +test eq get Ctxstart 3 7 +test eq ctxtake 3 0 +test eq get Cx 1 1 +fixture 1 1 +test eq ctxtake 1 1 +test eq get Ctxgone 1 1 +fixture 2 0 +put Unit 64 33 +test eq ctxtake 2 2 +test eq get Cx 3 1 +test eq get Ctxgone 2 1 +test not ctxmeta 6 +fixture 0 0 +test eq ctxtake 0 1 +test eq get Cx 1 4 +test eq get Cx 2 1 +test eq get Cx 4 0 +test eq ctxtake 4 0 +test ctxmeta 6 +test eq get Mx 0 len MetaWant +same = true +for i ulong len MetaWant +if ne get Meta i get MetaWant i +same = false +end +end +test same +test ctxmeta 1 +test eq get Mx 0 len NewOnly +same = true +for i ulong len NewOnly +if ne get Meta i get NewOnly i +same = false +end +end +test same +test not ctxmeta 513 +test not ctxappend +test ctxmeta 6 +outreset +emitb 120 +test ctxappend +test eq get Outlen 0 add 1 len MetaWant +test eq get Outb 0 120 +same = true +for i ulong len MetaWant +if ne get Outb add i 1 get MetaWant i +same = false +end +end +test same +note Exercise the actual appask -> qsubmit job snapshot, not only metadata helpers. +prompt +test appask 1 +test eq get R 0 1 +test eq get Q 1 1 +test eq get R 9 1 +n = get T 8 +test ge n len MetaWant +same = ge n len MetaWant +if same +for i ulong len MetaWant +if ne get JobOut add sub n len MetaWant i get MetaWant i +same = false +end +end +end +test same +test not ctxbegin +test eq ctxtake 0 0 +appcancel +note Exact append capacity and one byte above, preserving Outb/length/error on refusal. +test ctxmeta 6 +n = sub ulong 4096 get Mx 0 +put Outlen 0 n +for i ulong n +put Outb i 90 +end +test ctxappend +test eq get Outlen 0 4096 +put Outlen 0 add n 1 +put Outb n 88 +test not ctxappend +test eq get Outlen 0 add n 1 +test eq get Outb n 88 +put Err 0 5 +test not ctxappend +test eq get Err 0 5 +outreset +mset32 36 5 +test not ctxmeta 6 +mset32 36 4 +mset32 32 33 +prompt +test not appask 2 +test eq get R 0 1 +test eq get Q 1 1 +mset32 32 1 +note Deliberately full valid facts make metadata fit but the whole JOB exceed4096. +for i ulong 3692 +put Mem i 0 +end +mset32 32 32 +for k ulong 32 +off = add 40 mul k 113 +for i ulong 47 +put Mem add off i 107 +end +for i ulong 63 +put Mem add add off 48 i 118 +end +end +test ctxmeta 6 +test le get Mx 0 4096 +prompt +test not appask 2 +test eq get R 0 1 +test eq get Q 1 1 +test eq get R 9 1 +note Catalog capacity and transaction exclusion. +mset32 36 512 +test ctxbegin +test eq get Cx 0 512 +test eq ctxtake 512 0 +fixture 511 0 +test eq ctxtake 511 1 +test eq get Ctxlen 511 len Note0 +test not ctxmeta 6 +put Tx 0 1 +test not ctxbegin +test eq ctxtake 0 0 +put Tx 0 0 +put Nt 0 1 +test not ctxbegin +test eq ctxtake 0 0 +put Nt 0 0 +mset32 36 513 +test not ctxbegin +test eq get Cx 0 512 +note Load ten real records, select exactly the newest six, and allow zero selected. +for i ulong 3692 +put Mem i 0 +end +mset32 36 10 +test ctxbegin +for k ulong 10 +put Ns 0 2 +put Ns 1 k +put Ns 2 7 +put Ns 3 0 +put Note 0 78 +put Note 1 uchar add 48 k +test noteenc +for i ulong 4096 +put Unit i get Enc i +end +test eq ctxtake k 1 +end +test ctxmeta 6 +test eq get Mx 0 len Lastsix +same = true +for i ulong len Lastsix +if ne get Meta i get Lastsix i +same = false +end +end +test same +test ctxmeta 0 +test eq get Mx 0 len Emptyctx +note Context construction cannot overwrite a staged memory/note transaction image. +for i ulong 4096 +put Unitsave i get Unit i +put Unitsave add i 4096 get Enc i +end +test ctxmeta 6 +same = true +for i ulong 4096 +if ne get Unit i get Unitsave i +same = false +end +if ne get Enc i get Unitsave add i 4096 +same = false +end +end +test same +memsetup +mset32 36 0 +mset32 0 4294967295 +put Mem 152 1 +test ctxmeta 6 +test eq get Mx 0 len Plural +same = true +for i ulong len Plural +if ne get Meta i get Plural i +same = false +end +end +test same +put Mem 40 9 +test not ctxmeta 6 +test not ctxappend +put Mem 40 103 +for i ulong 48 +put Mem add i 40 107 +end +test not ctxmeta 6 +note Thirty-two full facts and six full notes overflow metadata itself, not only JOB. +for i ulong 3692 +put Mem i 0 +end +mset32 32 32 +mset32 36 6 +for k ulong 32 +off = add 40 mul k 113 +for i ulong 47 +put Mem add off i 107 +end +for i ulong 63 +put Mem add add off 48 i 118 +end +end +test ctxbegin +for k ulong 6 +put Ns 0 127 +put Ns 1 k +put Ns 2 7 +put Ns 3 0 +for i ulong 127 +put Note i 110 +end +test noteenc +for i ulong 4096 +put Unit i get Enc i +end +test eq ctxtake k 1 +end +test not ctxmeta 6 +test eq get Mx 1 1 +outreset +emitb 90 +test not ctxappend +test eq get Outlen 0 1 +test eq get Outb 0 90 +prompt +test not appask 2 +test eq get R 0 1 +test eq get Q 1 1 +ret int get Fails 0 +end diff --git a/evidence/allen-omega-L694/L746/reply.log b/evidence/allen-omega-L694/L746/reply.log new file mode 100644 index 00000000..d11a72ad --- /dev/null +++ b/evidence/allen-omega-L694/L746/reply.log @@ -0,0 +1,15 @@ +801 0 +802 0 +803 0 +804 0 +805 0 +806 0 +807 0 +808 0 +809 0 +810 0 +811 0 +812 0 +813 0 +814 0 +815 0 diff --git a/evidence/allen-omega-L694/L746/runtime.log b/evidence/allen-omega-L694/L746/runtime.log new file mode 100644 index 00000000..5168e6f3 --- /dev/null +++ b/evidence/allen-omega-L694/L746/runtime.log @@ -0,0 +1,28 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 diff --git a/evidence/allen-omega-L694/L746/scene-input.log b/evidence/allen-omega-L694/L746/scene-input.log new file mode 100644 index 00000000..edd8e122 --- /dev/null +++ b/evidence/allen-omega-L694/L746/scene-input.log @@ -0,0 +1,63 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 diff --git a/evidence/allen-omega-L694/L746/scene.log b/evidence/allen-omega-L694/L746/scene.log new file mode 100644 index 00000000..44a4b2b1 --- /dev/null +++ b/evidence/allen-omega-L694/L746/scene.log @@ -0,0 +1,14 @@ +1001 0 +1002 0 +1003 0 +1004 0 +1005 0 +1006 0 +1007 0 +1008 0 +1009 0 +1010 0 +1011 0 +1012 0 +1013 0 +1014 0 diff --git a/evidence/allen-omega-L694/L746/scenecap-mutant.log b/evidence/allen-omega-L694/L746/scenecap-mutant.log new file mode 100644 index 00000000..502843ec --- /dev/null +++ b/evidence/allen-omega-L694/L746/scenecap-mutant.log @@ -0,0 +1,63 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 1 +60 0 +61 0 +62 1 +63 1 diff --git a/evidence/allen-omega-L694/L746/scheduler.log b/evidence/allen-omega-L694/L746/scheduler.log new file mode 100644 index 00000000..1d8ffd12 --- /dev/null +++ b/evidence/allen-omega-L694/L746/scheduler.log @@ -0,0 +1,213 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 +183 0 +184 0 +185 0 +186 0 +187 0 +188 0 +189 0 +190 0 +191 0 +192 0 +193 0 +194 0 +195 0 +196 0 +197 0 +198 0 +199 0 +200 0 +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 diff --git a/evidence/allen-omega-L694/L746/session-mutant.log b/evidence/allen-omega-L694/L746/session-mutant.log new file mode 100644 index 00000000..9ce7ef78 --- /dev/null +++ b/evidence/allen-omega-L694/L746/session-mutant.log @@ -0,0 +1,24 @@ +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 1 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 diff --git a/evidence/allen-omega-L694/L746/short.log b/evidence/allen-omega-L694/L746/short.log new file mode 100644 index 00000000..a9da2dc8 --- /dev/null +++ b/evidence/allen-omega-L694/L746/short.log @@ -0,0 +1,20 @@ +401 0 +410 0 +411 0 +412 0 +413 0 +414 0 +402 0 +403 0 +404 0 +405 0 +406 0 +700 0 +701 0 +702 0 +703 0 +704 0 +705 0 +407 0 +408 0 +409 0 diff --git a/evidence/allen-omega-L694/L746/source.sha256 b/evidence/allen-omega-L694/L746/source.sha256 new file mode 100644 index 00000000..32b58465 --- /dev/null +++ b/evidence/allen-omega-L694/L746/source.sha256 @@ -0,0 +1,43 @@ +56936108de0087499bb62a117a275f27b01d7bfb05eb8f6250f13ab8783e1095 native/omega/allen/application.om +184f4270c72c4eca6a7afdd28b70a608f2e237980b12c8a7bfc2c7d2c3e625b9 native/omega/allen/base.om +795ca28627a19f1088de0f23277e79cdac921ff88451c606c7b655ce0f2e8a5b native/omega/allen/build-one.sh +4d2235ac5d6b237695b1c3112f70ebdfa0cebafa2ec8e691e4be4de37a62199b native/omega/allen/code.om +75e86e193346a5548e596c84fa7d65aaeefd69f9979a648e0bf53f0f97cd9eb4 native/omega/allen/context.om +76ee9cdeaac036905c76dfa29f42bf5a78d1259ad1656adfaa24916c3b93550d native/omega/allen/courier.om +69224f53c3c8a3f952fff210320cdfabc58da8a7f9e933ca863a33df528dc646 native/omega/allen/gate.sh +9d71a653870eeef678f95df04db9c38aedaadd06e7c74bf3e5d9fde6e28f82f8 native/omega/allen/golden.sh +06087bc573ebb876a0ed80f6025c592fb4b1d23335169c3da402824fd1482c35 native/omega/allen/intent.om +4bc37c95d553364c5d2925d8ff9e8a53b1a61974513e6f492f77b7ebb05bbda4 native/omega/allen/main.om +068292abd04d3a61b063fc5380b22a56c4235a87915c219ebf3b37d16d7bc9c7 native/omega/allen/memory.om +b4d7b6e6cd680d2ba1eec2978b0cbb81ffc63035b73f5c3726bdad97a7b6aa04 native/omega/allen/paint.om +d1e99e2c1f4bcff06f6fda75fe2c3b48b75129526f15681cbd135b717bf1d11b native/omega/allen/README.md +e50a7f673aaee92aba4a3aec303aa93b071121c09ad05d4ad1dcc2deb9706dcc native/omega/allen/reply.om +5b01eae03204d08f6d207ef29f2ba09a1d9f249f1738f68f151214675a4ff2ed native/omega/allen/runtime.om +c16d61dbcb81f7ef8196c937929a53e47de3de0015e5d663bcd8e49b3cb05002 native/omega/allen/scene-input.om +c8d4a437b41538cc1eeb62a2029c6993d41e5ef90cc7b26c8e1c92bc98ec57d3 native/omega/allen/scene.om +615dff78462a715153b3d891b2cfe146c318d3a0a26ae1aaa642484f965c12df native/omega/allen/scheduler.om +f4e6bb5571a0700febdecfc6209ae1c088eab50a82bce4d8a10179408e3abb5f native/omega/allen/tests/application.om +f085198549d1c235a97574ff6f6560ce82217611f4051fc3dbbc8286aab6d536 native/omega/allen/tests/check.om +b76438a85257bd95768115047be286c107e3723628a16a0541870732d0849a42 native/omega/allen/tests/code.om +c61bb0ca8f70114e6fd180e9f9a48ec4d2f927152269c11bfc9df55dc13bc1bc native/omega/allen/tests/context.om +98105e1c30626f54da07940fe0415637730b7e112ea39ba2aae1f2d648993373 native/omega/allen/tests/courier.om +f524aab74657dc2e9e4330bf42bc05ef01ce3e8f08a05c80371be0c0a33764d3 native/omega/allen/tests/edges.om +a2e8bcde92d522216a4fa99559dd3bcba096aea86127364587dadcc2bfb585af native/omega/allen/tests/fixture.om +c9ef2bee7cbd1c072c6045d62c55f3bdd938901e91792cee72ea57fb8f25a198 native/omega/allen/tests/golden.om +8ba742d85ea510586f3cf86661bc0f28c5d99b59981c2d3fb220705efad24564 native/omega/allen/tests/intent.om +861d9af698b021056cceb6c00ae3458558db415963fe832d3fca7da55731cf7b native/omega/allen/tests/memory.om +13e4db7436165783c6aad48497ffe89fa6e5ba3de928e66a766c29e1e817fcf5 native/omega/allen/tests/paint.om +e6d232d92d74d88423cebbbbfc6e403ea9b865b80c909e1d23087001d905035a native/omega/allen/tests/probe.om +8fbc8a0517900efd771a994686356416a0fea5e20cfd9bc26c787850398113df native/omega/allen/tests/render.om +094a5e833bae7dfd3b013e3f015f143e9d7bd3efe9b9c896a7f58b09e1ec14b8 native/omega/allen/tests/reply.om +bab9b0e853aa4b62918353a5d1625a3171deebfb639e599fe9751b5a61a3df62 native/omega/allen/tests/runtime.om +c5847b4ea0c7df81691fadf9af2f258ad02d3fa588a400448f6d34d7819570b4 native/omega/allen/tests/scene-input.om +b9c84d9a58658589137764fe60209d8320550dd8ed99fa6026df65ba48737e4f native/omega/allen/tests/scene.om +bf984fa9cf63ddb569147afc2a028ccdafdbeae2067125cf35d658e5d00f4c94 native/omega/allen/tests/scheduler.om +521fff50f312b64801017b1349d9a31dac6eac50eb989d93d2dbac4e100f5007 native/omega/allen/tests/stdio-overflow.om +89aee5326b428147ea6da9aa739b6679e214ed114ae5f41d3b70299cf864092c native/omega/allen/tests/view.om +0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0 native/omega/allen/vendor/OMEGA-LICENSE +b234738e8ce81b3d67586deb41fdaab4543169d4b69e86fd3dc28a08432ab5fc native/omega/allen/vendor/PROVENANCE.md +992ec4a4957271b442740598136887a5c610effcd8ae9fb9480a006a4f181097 native/omega/allen/vendor/sha256-core.om +0781cdcec18570a57afbe3be4a6717dd2d1fa4c887b49a3e4cb542b594f8a041 native/omega/allen/vendor/sha256.om +abbefd2f7dc48f2ac28b9526f5c2e5b369da4b7c5e84dde6e6a3cd20bd5687ac native/omega/allen/view.om diff --git a/evidence/allen-omega-L694/L746/stale-mutant.log b/evidence/allen-omega-L694/L746/stale-mutant.log new file mode 100644 index 00000000..ac2e3d09 --- /dev/null +++ b/evidence/allen-omega-L694/L746/stale-mutant.log @@ -0,0 +1,28 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 1 +7 1 +8 1 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 diff --git a/evidence/allen-omega-L694/L746/thinking-mutant.log b/evidence/allen-omega-L694/L746/thinking-mutant.log new file mode 100644 index 00000000..74b41a12 --- /dev/null +++ b/evidence/allen-omega-L694/L746/thinking-mutant.log @@ -0,0 +1,63 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 1 +15 1 +16 0 +17 0 +18 0 +19 1 +20 1 +21 1 +22 1 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 diff --git a/evidence/allen-omega-L694/L746/view.log b/evidence/allen-omega-L694/L746/view.log new file mode 100644 index 00000000..8b194f11 --- /dev/null +++ b/evidence/allen-omega-L694/L746/view.log @@ -0,0 +1,13 @@ +901 0 +902 0 +903 0 +904 0 +905 0 +906 0 +907 0 +908 0 +909 0 +910 0 +911 0 +912 0 +913 0 diff --git a/evidence/allen-omega-L694/L748/README.md b/evidence/allen-omega-L694/L748/README.md new file mode 100644 index 00000000..6be85e20 --- /dev/null +++ b/evidence/allen-omega-L694/L748/README.md @@ -0,0 +1,32 @@ +# L748 executable provider entry + +The parent personally authored provider-core.om and provider.om. The final native +suite passed; summary.json counts actual assertion rows and names artifact hashes. +The 100-check provider core covers restoration, application calls, pending wire +preservation, explicit send results, answer/code delivery and refusal sequencing. +Two independent 292-check output-verifier executions exercised file and real pipe +streams. Native process-receipt checks validate six malformed/truncated/oversized +cases, including no later command after the malformed frame. These inputs are +synthetic qualification fixtures, not live model outputs. + +Reproduce: `quiet-build native/omega/allen/gate.sh /absolute/fresh/private/output`. +The built `provider` is the actual static executable, not the older stdio adapter. +All new behavioral fixtures, refusal assertions and mutant construction execute +seeded Omega. The existing shell runner orchestrates builds/processes, collects +exit/byte metadata and uses external byte comparison. Historical gate shell and +legacy golden-oracle dependencies remain disclosed, not retired by this work. + +Meaningful REDs: initial compilable core stub failed 74 of 97 checks; empty native +entry failed the output verifier; native refusal receipt validator rejected that +entry's incorrect exit0. Original logs/source are retained. Initial verifier +compilation exceeded the seed register budget and was split through vbyte without +changing expected values. Initial broad shell mutation also changed a function +signature and failed compilation (error16); it was not counted as a caught mutant. +The final exact-line mutation generator is Omega and requires exactly one match. +The first passing development runner still contained new shell test decisions; +those were moved to provider-process.om before this publication. New test exits +are fixed 1 on any assertion failure, not failure counts modulo256. + +The final gate is release.log with exit0, not the earlier intermediate logs. +L748 independent final-source review is still required. No service, physical disk, +x86 EFI, QEMU Omega boot, netboot staging or physical iMac execution is claimed. diff --git a/evidence/allen-omega-L694/L748/ackstop-mutant.log b/evidence/allen-omega-L694/L748/ackstop-mutant.log new file mode 100644 index 00000000..5d0598cb --- /dev/null +++ b/evidence/allen-omega-L694/L748/ackstop-mutant.log @@ -0,0 +1,213 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 1 +65 1 +66 0 +67 0 +68 0 +69 1 +70 1 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 1 +165 0 +166 0 +167 0 +168 0 +169 1 +170 0 +171 1 +172 1 +173 0 +174 1 +175 0 +176 0 +177 0 +178 1 +179 0 +180 1 +181 0 +182 1 +183 0 +184 1 +185 0 +186 1 +187 0 +188 1 +189 0 +190 1 +191 0 +192 1 +193 0 +194 1 +195 1 +196 1 +197 1 +198 0 +199 1 +200 0 +201 0 +202 1 +203 1 +204 1 +205 0 +206 1 +207 1 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 diff --git a/evidence/allen-omega-L694/L748/appcode-mutant.log b/evidence/allen-omega-L694/L748/appcode-mutant.log new file mode 100644 index 00000000..c9c50601 --- /dev/null +++ b/evidence/allen-omega-L694/L748/appcode-mutant.log @@ -0,0 +1,182 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 1 +76 1 +77 1 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 diff --git a/evidence/allen-omega-L694/L748/application.log b/evidence/allen-omega-L694/L748/application.log new file mode 100644 index 00000000..2e8a428d --- /dev/null +++ b/evidence/allen-omega-L694/L748/application.log @@ -0,0 +1,182 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 diff --git a/evidence/allen-omega-L694/L748/autosent-mutant.log b/evidence/allen-omega-L694/L748/autosent-mutant.log new file mode 100644 index 00000000..2aed7f8a --- /dev/null +++ b/evidence/allen-omega-L694/L748/autosent-mutant.log @@ -0,0 +1,100 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 1 +48 0 +49 0 +50 1 +51 1 +52 0 +53 1 +54 0 +55 1 +56 0 +57 0 +58 0 +59 1 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 1 +70 0 +71 0 +72 0 +73 0 +74 1 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 diff --git a/evidence/allen-omega-L694/L748/binaries.sha256 b/evidence/allen-omega-L694/L748/binaries.sha256 new file mode 100644 index 00000000..b45cc267 --- /dev/null +++ b/evidence/allen-omega-L694/L748/binaries.sha256 @@ -0,0 +1,40 @@ +49085d1c4e23dcd67fd89df63a711ccd57adfac88e2fd83f84c6ab9982abcaee /home/drakestapleton/handoffs/allen-omega-L694/L748/release/provider-core +3189b02674156ce257d5c97ad192c70bf71df6c2354304748f12626674cc2aba /home/drakestapleton/handoffs/allen-omega-L694/L748/release/scheduler +f24a2971111c84bf97ee23dc4f2541a4a8f57011f058ffe00d2e80ce993a98bc /home/drakestapleton/handoffs/allen-omega-L694/L748/release/readback-mutant +afe04934ba58367705dd7624951d502c23a7bdf0fce871ff97e03580ed372a6a /home/drakestapleton/handoffs/allen-omega-L694/L748/release/view +87597377b16e4c1a08b3f674b10d3413a27943d979e48464d8b9988f1a34b767 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/contextnote-mutant +5dac9b9e165c6303cf504c0fe9a70d5f5060be3cc2383eb44470b4fab7540581 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/allen +d8f67f714b4e7bebdba1052fee978514f79a7efe501ade61009e3266d6ca250b /home/drakestapleton/handoffs/allen-omega-L694/L748/release/reply +502ac1eb5c244e0ee20d5cdc1cc2a638a1ee87e203954ce9f8419c2959a2a207 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/thinking-mutant +02497220d5acba2dd8529460c296e7adb4104d5a0ff5fe997343ae230b795fcb /home/drakestapleton/handoffs/allen-omega-L694/L748/release/ackstop-mutant +9916d8f00f5aaa4c9c4ff89b1bc8292d7a5a32e4eb356c303bffb635bd34009f /home/drakestapleton/handoffs/allen-omega-L694/L748/release/hash-mutant +91cc6ad1782a819213feb65ca5e7d1a2a4589c6cd751434a2c6702a70c847654 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/golden +8fca38ff5b02e4d7dce2948dc198f8d1a0bae24dde13f4de262c6ac3d5439afc /home/drakestapleton/handoffs/allen-omega-L694/L748/release/session-mutant +909bbc60755edd44b455c18ebd50a49ce0e6c48b45c294bfd348455eec248764 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/scene-input +dfb5ceb46b04718b94f447550b1318ffd7fd2592a749bd39fe63613dc5812fb4 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/intent +e35924cdb3da915ae919b4addefade4b702202655e1ea3c320b4835631ba22b0 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/provider-input +0ec8e1a4a590ce25d2cc9e5023b9cdc93910ffa1dc092a23188663452f73fe02 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/fixture +c9367d4cbc9261ebc0faaf3a99c2988ee36abda197670d868bd202a3bb19cccd /home/drakestapleton/handoffs/allen-omega-L694/L748/release/provider +da2db26d9ec09c6b09d71f408cc8fc4aede4f4caba8d869195402c7d23d5c3a1 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/context +dc65f1ffb7fd01f98c92ec80cd9e11bdd9c3c2fd0ee7522bc346074822ab7cf3 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/runtime +5f611bc8b08963a572782f60f3c561947a92185d070da598f286156b65999f36 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/code +52ffd81fe79089c4e03accba53621f9f90c52d6ae2be6e33fdd0f09e42c07642 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/provider-mutants +124cc427a2196686fa820d3abd9a9d37a699be4ff1585eef521fcbf956c61323 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/edges +8236a24960d473003e128ee736fb322a341e9f30aae1a7c091c93466bbb26c50 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/appcode-mutant +b8241b0765f869f49ef570f7bd09ffcaa1ccdbb42968aca848b459c0671a89c1 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/render +86810438f6ca30599f4bf6881b550d8ce56da2cf5e7d1ad4e4a8af77ccad338d /home/drakestapleton/handoffs/allen-omega-L694/L748/release/stale-mutant +2407b19d8bcd6a13c26b5f79ffbf4fbd2f05ad2e48b8dfa355ab56aad3499dbc /home/drakestapleton/handoffs/allen-omega-L694/L748/release/courier +cb12cc9f683c4771ebbf5d2a6045235ea7a19f8718c58b32546806c7feb93c6b /home/drakestapleton/handoffs/allen-omega-L694/L748/release/scene +582b5ef0de574661ea2378f9a055d382904094646b0880fa2659a91630e8f150 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/pendingwire-mutant +f117936d5e3aa088d164118340155fa3617c51066d5aff53916071a467aa4269 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/framecheck-mutant +4b834d81b3a020fc6ff6f8b6481322fc43b2e3509fb7d9e17105a7410d4b5293 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/scenecap-mutant +65040ef18b342252efcf2fd5fc2897f90b8d6219e3ac7f5ca089c7f5de6a9d63 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/contextjob-mutant +fb69832f54e73986c5a52a3dcf6d26b02e5dca2d64339c83d5779426244c9575 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/paint +6459e7f0af5d66d64e566e418a33c60873625c1d9e58cd5ad88358132f41955d /home/drakestapleton/handoffs/allen-omega-L694/L748/release/crc-mutant +cff536041b98c6a40fe2c7f96bd9fe0cc029352459d1ad63fb904b6a808d757d /home/drakestapleton/handoffs/allen-omega-L694/L748/release/autosent-mutant +8eeda9f344c1c28f6e05308acbeb243ea8ee74e29e290e45b746e20cd5873e24 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/provider-output +71f99242bcad6ede239b240602470fcf3d5da3267eb47a1ad522241958222367 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/stdio-overflow-input +e04adf1e16f4b935870a0c1f2f4ed347236305a27fb571e8dbccee8c75e01f7e /home/drakestapleton/handoffs/allen-omega-L694/L748/release/keepalive-mutant +f27b24582f22767dbf7eb3f9e8b5d06b0f37f54371e91dec125ee7544f65d259 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/provider-process +115dfc604c12b15660289905b00caa566c6cfeaeb709241da9e8b4b7c34714fc /home/drakestapleton/handoffs/allen-omega-L694/L748/release/memory +a150ad34968970185a836a52ca2c48f882254f1faa0a8c576dbc241624505ed9 /home/drakestapleton/handoffs/allen-omega-L694/L748/release/application diff --git a/evidence/allen-omega-L694/L748/code.log b/evidence/allen-omega-L694/L748/code.log new file mode 100644 index 00000000..e7e197b7 --- /dev/null +++ b/evidence/allen-omega-L694/L748/code.log @@ -0,0 +1,23 @@ +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 diff --git a/evidence/allen-omega-L694/L748/context.log b/evidence/allen-omega-L694/L748/context.log new file mode 100644 index 00000000..df62cddb --- /dev/null +++ b/evidence/allen-omega-L694/L748/context.log @@ -0,0 +1,142 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 diff --git a/evidence/allen-omega-L694/L748/contextjob-mutant.log b/evidence/allen-omega-L694/L748/contextjob-mutant.log new file mode 100644 index 00000000..3432d4b2 --- /dev/null +++ b/evidence/allen-omega-L694/L748/contextjob-mutant.log @@ -0,0 +1,142 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 1 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 1 +72 1 +73 1 +74 1 +75 1 +76 1 +77 0 +78 0 +79 1 +80 1 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 1 +88 1 +89 0 +90 1 +91 0 +92 1 +93 0 +94 1 +95 0 +96 1 +97 0 +98 1 +99 0 +100 1 +101 0 +102 1 +103 0 +104 1 +105 0 +106 1 +107 0 +108 1 +109 1 +110 1 +111 1 +112 1 +113 1 +114 1 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 1 +123 0 +124 1 +125 0 +126 1 +127 0 +128 1 +129 0 +130 1 +131 0 +132 1 +133 0 +134 1 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 1 +142 1 diff --git a/evidence/allen-omega-L694/L748/contextnote-mutant.log b/evidence/allen-omega-L694/L748/contextnote-mutant.log new file mode 100644 index 00000000..b5c08759 --- /dev/null +++ b/evidence/allen-omega-L694/L748/contextnote-mutant.log @@ -0,0 +1,142 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 1 +38 1 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 1 +47 0 +48 1 +49 0 +50 0 +51 0 +52 0 +53 0 +54 1 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 diff --git a/evidence/allen-omega-L694/L748/courier.log b/evidence/allen-omega-L694/L748/courier.log new file mode 100644 index 00000000..8402df49 --- /dev/null +++ b/evidence/allen-omega-L694/L748/courier.log @@ -0,0 +1,24 @@ +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 diff --git a/evidence/allen-omega-L694/L748/crc-mutant.log b/evidence/allen-omega-L694/L748/crc-mutant.log new file mode 100644 index 00000000..a0d90bd4 --- /dev/null +++ b/evidence/allen-omega-L694/L748/crc-mutant.log @@ -0,0 +1,23 @@ +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 1 +117 1 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 diff --git a/evidence/allen-omega-L694/L748/edges.log b/evidence/allen-omega-L694/L748/edges.log new file mode 100644 index 00000000..e8d0deea --- /dev/null +++ b/evidence/allen-omega-L694/L748/edges.log @@ -0,0 +1,352 @@ +1201 0 +1202 0 +1203 0 +1204 0 +1205 0 +1206 0 +1207 0 +1208 0 +1209 0 +1210 0 +1211 0 +1212 0 +1213 0 +1214 0 +1220 0 +1221 0 +1222 0 +1223 0 +1224 0 +1225 0 +1226 0 +1227 0 +1228 0 +1229 0 +1230 0 +1231 0 +1232 0 +1233 0 +1234 0 +1235 0 +1236 0 +1237 0 +1238 0 +1239 0 +1240 0 +1241 0 +1242 0 +1243 0 +1244 0 +1245 0 +1246 0 +1247 0 +1248 0 +1249 0 +1250 0 +1251 0 +1252 0 +1253 0 +1254 0 +1255 0 +1256 0 +1257 0 +1258 0 +1259 0 +1260 0 +1261 0 +1262 0 +1301 0 +1302 0 +1303 0 +1304 0 +1305 0 +1306 0 +1310 0 +1311 0 +1312 0 +1313 0 +1314 0 +1315 0 +1316 0 +1317 0 +1318 0 +1319 0 +1320 0 +1321 0 +1322 0 +1323 0 +1324 0 +1325 0 +1326 0 +1327 0 +1328 0 +1329 0 +1330 0 +1331 0 +1332 0 +1333 0 +1334 0 +1335 0 +1336 0 +1337 0 +1338 0 +1339 0 +1340 0 +1341 0 +1342 0 +1343 0 +1344 0 +1345 0 +1346 0 +1347 0 +1348 0 +1349 0 +1350 0 +1351 0 +1352 0 +1353 0 +1354 0 +1355 0 +1356 0 +1357 0 +1358 0 +1359 0 +1360 0 +1361 0 +1362 0 +1363 0 +1364 0 +1365 0 +1366 0 +1367 0 +1368 0 +1369 0 +1370 0 +1371 0 +1372 0 +1373 0 +1374 0 +1375 0 +1376 0 +1377 0 +1378 0 +1379 0 +1380 0 +1381 0 +1382 0 +1383 0 +1384 0 +1385 0 +1386 0 +1387 0 +1388 0 +1389 0 +1390 0 +1391 0 +1392 0 +1393 0 +1394 0 +1395 0 +1396 0 +1397 0 +1398 0 +1399 0 +1400 0 +1401 0 +1402 0 +1403 0 +1404 0 +1405 0 +1406 0 +1407 0 +1408 0 +1409 0 +1410 0 +1411 0 +1412 0 +1413 0 +1414 0 +1415 0 +1416 0 +1417 0 +1418 0 +1419 0 +1420 0 +1421 0 +1422 0 +1423 0 +1424 0 +1425 0 +1426 0 +1427 0 +1428 0 +1429 0 +1430 0 +1431 0 +1432 0 +1433 0 +1434 0 +1435 0 +1436 0 +1437 0 +1438 0 +1439 0 +1440 0 +1441 0 +1442 0 +1443 0 +1444 0 +1445 0 +1446 0 +1447 0 +1448 0 +1449 0 +1450 0 +1451 0 +1452 0 +1453 0 +1454 0 +1455 0 +1456 0 +1457 0 +1458 0 +1459 0 +1460 0 +1461 0 +1462 0 +1463 0 +1464 0 +1465 0 +1466 0 +1467 0 +1468 0 +1469 0 +1470 0 +1471 0 +1472 0 +1473 0 +1474 0 +1475 0 +1476 0 +1477 0 +1478 0 +1479 0 +1480 0 +1481 0 +1482 0 +1483 0 +1484 0 +1485 0 +1486 0 +1487 0 +1488 0 +1489 0 +1490 0 +1491 0 +1492 0 +1493 0 +1494 0 +1495 0 +1496 0 +1497 0 +1498 0 +1499 0 +1500 0 +1501 0 +1502 0 +1503 0 +1504 0 +1505 0 +1506 0 +1507 0 +1508 0 +1509 0 +1510 0 +1511 0 +1512 0 +1513 0 +1514 0 +1515 0 +1516 0 +1517 0 +1518 0 +1519 0 +1520 0 +1521 0 +1522 0 +1523 0 +1524 0 +1525 0 +1526 0 +1527 0 +1528 0 +1529 0 +1530 0 +1531 0 +1532 0 +1533 0 +1534 0 +1535 0 +1536 0 +1537 0 +1538 0 +1539 0 +1540 0 +1541 0 +1542 0 +1543 0 +1544 0 +1545 0 +1546 0 +1547 0 +1548 0 +1549 0 +1550 0 +1551 0 +1552 0 +1553 0 +1554 0 +1555 0 +1556 0 +1557 0 +1558 0 +1559 0 +1560 0 +1561 0 +1562 0 +1563 0 +1564 0 +1565 0 +1570 0 +1571 0 +1572 0 +1575 0 +1573 0 +1574 0 +1600 0 +1601 0 +1602 0 +1603 0 +1604 0 +1605 0 +1606 0 +1607 0 +1610 0 +1611 0 +1612 0 +1613 0 +1614 0 +1615 0 +1616 0 +1617 0 +1701 0 +1702 0 +1703 0 +1704 0 +1705 0 +1706 0 +1707 0 +1708 0 +1709 0 +1710 0 +1711 0 diff --git a/evidence/allen-omega-L694/L748/final.exit b/evidence/allen-omega-L694/L748/final.exit new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/L748/final.exit @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/L748/final.log b/evidence/allen-omega-L694/L748/final.log new file mode 100644 index 00000000..ecf723fa --- /dev/null +++ b/evidence/allen-omega-L694/L748/final.log @@ -0,0 +1,43 @@ +runtime compile=0 native-exit=0 +code compile=0 native-exit=0 +courier compile=0 native-exit=0 +scheduler compile=0 native-exit=0 +application compile=0 native-exit=0 +provider-core compile=0 native-exit=0 +memory compile=0 native-exit=0 +context compile=0 native-exit=0 +intent compile=0 native-exit=0 +reply compile=0 native-exit=0 +view compile=0 native-exit=0 +scene compile=0 native-exit=0 +scene-input compile=0 native-exit=0 +paint compile=0 native-exit=0 +edges compile=0 native-exit=0 +fixture compile=0 native-exit=0 +golden compile=0 native-exit=0 +render compile=0 native-exit=0 +stdio native-exit=0 golden-cmp=0 +stdio overflow native-exit=65 no-later-command=PASS +provider malformed mode=1 exit=65 no-later-command=PASS +provider malformed mode=2 exit=65 no-later-command=PASS +provider malformed mode=3 exit=65 no-later-command=PASS +provider malformed mode=4 exit=65 no-later-command=PASS +provider malformed mode=5 exit=65 no-later-command=PASS +provider malformed mode=6 exit=65 no-later-command=PASS +provider native-exit=0 fragmented-pipe=0 output-verifier=0 +stale mutant compile=0 rejected-exit=3 +crc mutant compile=0 rejected-exit=2 +hash mutant compile=0 rejected-exit=2 +readback mutant compile=0 rejected-exit=7 +session mutant compile=0 rejected-exit=1 +keepalive mutant compile=0 rejected-exit=40 +ackstop mutant compile=0 rejected-exit=27 +pendingwire mutant compile=0 rejected-exit=1 +appcode mutant compile=0 rejected-exit=3 +thinking mutant compile=0 rejected-exit=6 +scenecap mutant compile=0 rejected-exit=3 +contextnote mutant compile=0 rejected-exit=5 +contextjob mutant compile=0 rejected-exit=36 +autosent mutant compile=0 rejected-exit=8 +framecheck mutant compile=0 rejected-exit=4 +ALLEN_OMEGA_HOST: PASS; target=NOT_RUN; live=NOT_RUN diff --git a/evidence/allen-omega-L694/L748/framecheck-mutant.log b/evidence/allen-omega-L694/L748/framecheck-mutant.log new file mode 100644 index 00000000..d5454577 --- /dev/null +++ b/evidence/allen-omega-L694/L748/framecheck-mutant.log @@ -0,0 +1,100 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 1 +7 1 +8 1 +9 1 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 diff --git a/evidence/allen-omega-L694/L748/full.exit b/evidence/allen-omega-L694/L748/full.exit new file mode 100644 index 00000000..b6a7d89c --- /dev/null +++ b/evidence/allen-omega-L694/L748/full.exit @@ -0,0 +1 @@ +16 diff --git a/evidence/allen-omega-L694/L748/full.log b/evidence/allen-omega-L694/L748/full.log new file mode 100644 index 00000000..0919171a --- /dev/null +++ b/evidence/allen-omega-L694/L748/full.log @@ -0,0 +1,41 @@ +runtime compile=0 native-exit=0 +code compile=0 native-exit=0 +courier compile=0 native-exit=0 +scheduler compile=0 native-exit=0 +application compile=0 native-exit=0 +provider-core compile=0 native-exit=0 +memory compile=0 native-exit=0 +context compile=0 native-exit=0 +intent compile=0 native-exit=0 +reply compile=0 native-exit=0 +view compile=0 native-exit=0 +scene compile=0 native-exit=0 +scene-input compile=0 native-exit=0 +paint compile=0 native-exit=0 +edges compile=0 native-exit=0 +fixture compile=0 native-exit=0 +golden compile=0 native-exit=0 +render compile=0 native-exit=0 +stdio native-exit=0 golden-cmp=0 +stdio overflow native-exit=65 no-later-command=PASS +provider malformed mode=1 exit=65 no-later-command=PASS +provider malformed mode=2 exit=65 no-later-command=PASS +provider malformed mode=3 exit=65 no-later-command=PASS +provider malformed mode=4 exit=65 no-later-command=PASS +provider malformed mode=5 exit=65 no-later-command=PASS +provider malformed mode=6 exit=65 no-later-command=PASS +provider native-exit=0 fragmented-pipe=0 output-verifier=0 +stale mutant compile=0 rejected-exit=3 +crc mutant compile=0 rejected-exit=2 +hash mutant compile=0 rejected-exit=2 +readback mutant compile=0 rejected-exit=7 +session mutant compile=0 rejected-exit=1 +keepalive mutant compile=0 rejected-exit=40 +ackstop mutant compile=0 rejected-exit=27 +pendingwire mutant compile=0 rejected-exit=1 +appcode mutant compile=0 rejected-exit=3 +thinking mutant compile=0 rejected-exit=6 +scenecap mutant compile=0 rejected-exit=3 +contextnote mutant compile=0 rejected-exit=5 +contextjob mutant compile=0 rejected-exit=36 +omc: line 3510: error 16 diff --git a/evidence/allen-omega-L694/L748/green1.exit b/evidence/allen-omega-L694/L748/green1.exit new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/L748/green1.exit @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/L748/green1.log b/evidence/allen-omega-L694/L748/green1.log new file mode 100644 index 00000000..5bff02cf --- /dev/null +++ b/evidence/allen-omega-L694/L748/green1.log @@ -0,0 +1,97 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 diff --git a/evidence/allen-omega-L694/L748/hash-mutant.log b/evidence/allen-omega-L694/L748/hash-mutant.log new file mode 100644 index 00000000..c75cfefb --- /dev/null +++ b/evidence/allen-omega-L694/L748/hash-mutant.log @@ -0,0 +1,79 @@ +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 1 +310 1 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +362 0 +363 0 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 0 +361 0 diff --git a/evidence/allen-omega-L694/L748/independent-review/count-correction.md b/evidence/allen-omega-L694/L748/independent-review/count-correction.md new file mode 100644 index 00000000..e9dcb194 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/count-correction.md @@ -0,0 +1 @@ +The original report says25 boundary assertions and872 total. The retained log has26 passing rows, including its final count assertion. Parent rebuilt the exact boundary input, obtained a byte-identical binary, and replayed26/26. Actual provider-review total is873 passing assertion rows. Original report retained unchanged. diff --git a/evidence/allen-omega-L694/L748/independent-review/inventory.json b/evidence/allen-omega-L694/L748/independent-review/inventory.json new file mode 100644 index 00000000..7e242e0b --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/inventory.json @@ -0,0 +1,154 @@ +{ + "count-correction.md": "e0fc65d2dd4428e6ba2ea9c0f63e7d617a4ef91b6fd22217365127b0b82d6143", + "parent-boundary.log": "69318135260b334c2b4e28c0dcde808e8ea649fab689b7ce9dc6a61aa1effdc4", + "parent-provider.output": "94a3fc4b05bef182b4d33e6adf875bf638f89b01315ea1081da0cbdb950a6ac0", + "parent-verification.json": "e0a9a2c4149144932e4a1827fcceb6561fe6882ef5b85b1fff325800492c7569", + "probes/core.om": "f5984ce7290b7853446ca2bc2d192d76dfd13bd90dad2c97c5acfd5720f95ba5", + "probes/provider-boundary-test-final.om": "7b05323ea8180d39996404367059426371b082028cbd52bba8a2fe55ba0fe57e", + "probes/provider-boundary-test-v2.om": "b3cbcb68a885546aac1338d3e5c1f80dde1d6627f08911198e34a46fcf1e0ba2", + "probes/provider-boundary-test.om": "ca1b9d61eab55954ac0fed582b22f27eea0ca6daad534ef0363624f54d345fd8", + "probes/provider-boundary.om": "f0642cdbea86e6181cb5cf9349d2069cea35e398197a1d264a56adc1d26b42b8", + "probes/provider-core-test.om": "e56b53d01133d3fd7babd76a37bc59af8b31156d33e2b79ccbf8a3ea6b49868d", + "probes/provider-input-test.om": "5815a0c8afeb4f2eb858a1180099bf0d21883a3543d704ac3e2613cb860d9bcd", + "probes/provider-output-test.om": "5da89211ae500e9190b3e2ab8919b78dce6bbb0078cf15ab8daf4de6fce30352", + "probes/provider-process-test.om": "281f4e63aeb402de2752b342820dac97e67053bcc8868fb4e2ff9df8506012db", + "probes/provider-semantic-input-test-v2.om": "7adfe5e00906277368761ce6f12e4fe53249963e56fa1e0b4880bfe9823c5eaa", + "probes/provider-semantic-input-test-v3.om": "cca7ec68e609bef07289afa4053f71f1af75aca69c289ccab94768017ed0a344", + "probes/provider-semantic-input-test-v4.om": "cd1f6da74057c4118c1dbc20d85334082558caac07a92e90b040429cb22265d6", + "probes/provider-semantic-input-test.om": "7adfe5e00906277368761ce6f12e4fe53249963e56fa1e0b4880bfe9823c5eaa", + "probes/provider-semantic-input.om": "9932322990aee378f59097663b341f7dff6cacf004cef8971762f34e84dd7766", + "probes/provider-semantic-output-test-final.om": "bdfe51578d66616d051fbe8557e42a1cd7de0e25f5c077c57472109a2a28bd15", + "probes/provider-semantic-output-test-final2.om": "a0c530ae578c178f8972588518a2a26fd9509ba87f89b816e53bf1e8af63c402", + "probes/provider-semantic-output-test-final3.om": "04a9e4facb92689ba2d56727704f6d1d5b5c38affff868a40cc441ac2025158c", + "probes/provider-semantic-output-test-v3.om": "1da10526358510342d59818732adece30ed7529b696cb4a505cca47e58af1ca2", + "probes/provider-semantic-output-test-v4.om": "8591ca0dc189c7a7b52bc9e698e72e1247d932f6c1ba6fc701383710d5dcadbd", + "probes/provider-semantic-output-test-v5.om": "6d678e1f4da778139d34facc5f4940f2eb78c313345dada839be150aabb9f67e", + "probes/provider-semantic-output-test-v6.om": "f06d2b0a77dffa160f09995e0545357647f16aca3033a2ba30b432262ccf4512", + "probes/provider-semantic-output.om": "1ad2c2667f403d92664768b5cc008b16aff570a2d97ea9827cdee333bb3f6ff3", + "probes/provider-shortwrite-check-test-final.om": "4c4fce3ddbaf2b266c6df43804754637cdb1cd1a189c23945f7ab002ef9e3e69", + "probes/provider-shortwrite-check-test-v2.om": "4eecb657385c51d6f529ae98d6baf28769646c9ca835c164314babd52786ee98", + "probes/provider-shortwrite-check-test-v3.om": "fdda8e4be5615a26890861726c60a318026943ceb38e966f73c75104d6d1ad83", + "probes/provider-shortwrite-check-test-v4.om": "129b8ae97efa4b14efb1191eff2412a1b0bb705e29c455e3afece517299309ee", + "probes/provider-shortwrite-check-test-v5.om": "56275a40ba2f9881123d35b48c1bf472adb5ba4dd35aa9db172d4831cdbf7eb5", + "probes/provider-shortwrite-check-test.om": "e446c58a76bf5f695faaf02b25686a5c04dcaa99d728dae56c47cb4d3bb8cae9", + "probes/provider-shortwrite-check.om": "7a41bf77c01faf4adea9da7c5bd63a7a96e5c51ca8a9dec70a1270ed77a3686d", + "probes/provider.om": "7ce870b4adc39d0fe38a336ba0f19009dcb28f9761d7c10c760603efe564f924", + "raw/SHA256SUMS.pre-report": "17c3b0fe00774d762fd4590f2cc8476c79c4d0b23ea3ab35bc7c2764cd80d896", + "raw/application-numbered.txt": "149c86c580d055212b030f15223efbf61fc77e941cd3026a329d98f04373e797", + "raw/builds-final.sha256": "c60310ca34301e81cef053e9ba376ac7dd7f064f0c5a829d29b60caece99e67a", + "raw/builds.sha256": "e1143e9516dc5614a94515370c20655a46f9000fd9aed19f08662d45a0e623bd", + "raw/compiler.sha256": "41cfc578c1aa995e9b8ff0547c18acd2d9d2816680b57b0da1ba613b133d4cf4", + "raw/context-restore-numbered.txt": "2d9a3c4c37f3234249719134d11aff790623b930e838c0cdca311745e3cc8702", + "raw/failed-probes/invalid-time.exit": "979b894f2d91bf199766571d58024f020d1a44a417da5f48e1fa1cdf554a14f5", + "raw/failed-probes/invalid-time.input": "46eaf5338a37ae4de81bbe77714ba8df5a54d0b9d39cf9390db0fe3c6a9a5fe1", + "raw/failed-probes/invalid-time.output": "0a1dae7e76e5fb41aed0ce664f9a8a8196c0cdcd620b535b5dfc7005a5799681", + "raw/failed-probes/invalid-time.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "raw/failed-probes/missing-entry.compile.exit": "f0b5c2c2211c8d67ed15e75e656c7862d086e9245420892a7de62cd9ec582a06", + "raw/failed-probes/missing-entry.compile.log": "bac11db2729587f90a499b706c6aa92ed2183c7c9c37e5b3a3a85d329922a12e", + "raw/failed-probes/provider-boundary-missing-entry": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "raw/failed-probes/provider-boundary-missing-entry.om": "a87e6c7d19c6b7f3332c6a1eadc8771ec2f9d4c7b2e0ad5ebd1efafa3907a9b5", + "raw/failed-probes/provider-boundary-wrong-count-test": "75a8cca0a568f268e617c4a3131e71cc9967aa9e4f0b7495d0487cd60a4802fd", + "raw/failed-probes/provider-boundary-wrong-count-test.om": "6aa2d32599babbaffcf7c354e50addd36ddeff6d2f12cad2ec7e897d52da13a1", + "raw/failed-probes/provider-boundary-wrong-count.om": "b18266366739227acca27d9ead48c42f370b64e062bbf21fb96e3177e641de6c", + "raw/failed-probes/provider-semantic-invalid-time-test": "4040de7fe90c2dca9d68556a7bb23d5264d71027bd54f8277a1eebea452a1d66", + "raw/failed-probes/provider-semantic-invalid-time-test.om": "cca7ec68e609bef07289afa4053f71f1af75aca69c289ccab94768017ed0a344", + "raw/failed-probes/provider-semantic-invalid-time.om": "19370bac9519c21e6c71207657321a6bd22df380befa7b3c19f9405054318a4c", + "raw/failed-probes/wrong-count.exit": "4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865", + "raw/failed-probes/wrong-count.log": "3bfa0432504c94ba21aaf265f73af49ada07d4bc484ef2fa3a809f68cc9749ce", + "raw/focused-inputs.sha256": "3d59cfaef014da864a760771938fa0847da539f5946816136ff4721931c1a4b9", + "raw/git-source.paths": "671c5d51da86d0554bb6d242f145b51bb22fd520177e45fbeef200a02e04863f", + "raw/memory-restore-numbered.txt": "d70c344115f1aac0b1ecbf348f3298cc1975331634b9a41be196d5c1b59acf33", + "raw/pins.txt": "7d931199f90a0d238d58c2d9abac45df4520ac9f2ef396504e136b9d503b17d5", + "raw/provider-boundary-final.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa", + "raw/provider-boundary-final.log": "69318135260b334c2b4e28c0dcde808e8ea649fab689b7ce9dc6a61aa1effdc4", + "raw/provider-boundary.exit": "4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865", + "raw/provider-boundary.log": "3bfa0432504c94ba21aaf265f73af49ada07d4bc484ef2fa3a809f68cc9749ce", + "raw/provider-core-numbered.txt": "4b6fcafad2946e37eb832da122176742047661874351d7151658885d3fc8e472", + "raw/provider-core.exit": "9a6f0211f12d0930331efa31d7bf65dcbf2a4c71c55d101e1df4077cd3d71db4", + "raw/provider-core.log": "fbfe365c7485671f3c8e0ccf480be062034b65360b2005530c258e1577aaec04", + "raw/provider-entry-numbered.txt": "f96657de953a7827768f2a62851b8830926c2f1a556a72272654742125c4f48f", + "raw/provider-eof.err": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "raw/provider-eof.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa", + "raw/provider-eof.out": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "raw/provider-fragment-producer.err": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "raw/provider-fragment-producer.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa", + "raw/provider-fragment.check.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa", + "raw/provider-fragment.check.log": "49c437a2551e71a10bc26bc969f55103611991adea98696503cbdb8e686d1ba3", + "raw/provider-fragment.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa", + "raw/provider-fragment.mode": "7902699be42c8a8e46fbbb4501726517e86b22c56a189f7625a6da49081b2451", + "raw/provider-fragment.output": "94a3fc4b05bef182b4d33e6adf875bf638f89b01315ea1081da0cbdb950a6ac0", + "raw/provider-fragment.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "raw/provider-fragment.strace": "718fa4fce2aafd2d658e1d7a776ed8ca22b23bbbc616a28ed74aac5b787e55fb", + "raw/provider-full.exit": "93a73825c1b761d11bf2b3f4dff760d07888d3fde05dcf55f1da84aa6041a5a8", + "raw/provider-full.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "raw/provider-normal-producer.err": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "raw/provider-normal.check.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa", + "raw/provider-normal.check.log": "49c437a2551e71a10bc26bc969f55103611991adea98696503cbdb8e686d1ba3", + "raw/provider-normal.input": "520bdb2f475e7ff86edfd6618b04d672c6a9b90ce09e4f249e3c615078855867", + "raw/provider-normal.output": "94a3fc4b05bef182b4d33e6adf875bf638f89b01315ea1081da0cbdb950a6ac0", + "raw/provider-normal.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "raw/provider-partial-write-check-final.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa", + "raw/provider-partial-write-check-final.log": "247f163efbac7aca478706f7ba00072b808450055e6ba819208f1d20a41a1f50", + "raw/provider-partial-write-check.exit": "4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865", + "raw/provider-partial-write-check.log": "5458fb305ce1bed0daf4a87e2afe15dffa92d34e239d90ec4db99cd8f7bbdc05", + "raw/provider-partial-write.exit": "93a73825c1b761d11bf2b3f4dff760d07888d3fde05dcf55f1da84aa6041a5a8", + "raw/provider-partial-write.output": "c9d6ffd3da9f61111b290c837735758566f93a95f203467268e3cc70e2b84a01", + "raw/provider-partial-write.receipt": "93e3aee03715093b7cbf8b04c9c6f7355739cff5e33cdecb2df16893020e4b40", + "raw/provider-partial-write.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "raw/provider-partial-write.strace": "310c498a976ca7397be904709499cad567c341e35d39ddd9ed9df81d148c5903", + "raw/provider-semantic-check.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa", + "raw/provider-semantic-check.log": "6a87eb69ca54f8d30d653737c7ba17efe564a66d1a6b343fd8483e370441d90b", + "raw/provider-semantic.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa", + "raw/provider-semantic.input": "b52911d5d588f47d3a3469a966975d52e7c7646a2793f3533741247d316125e4", + "raw/provider-semantic.output": "c3db64fe5747f8601b4aee0dd132e881676249faa93709a7c296dc7ef060098c", + "raw/provider-semantic.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "raw/provider.elf.txt": "763921ec6cbbfbe18891cc29b474ee14cfb20851846b6ef6bd5757d65540b90b", + "raw/release-source.paths": "671c5d51da86d0554bb6d242f145b51bb22fd520177e45fbeef200a02e04863f", + "raw/report.sha256": "043bfc6b007cf28852903a366736c165fb1f6c6c781c99e3244f967acd7d064d", + "raw/report.sha256.verify": "043bfc6b007cf28852903a366736c165fb1f6c6c781c99e3244f967acd7d064d", + "raw/short-1.check.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c", + "raw/short-1.input": "b9d4174daac045b3088a0d53515083432b86dd4b5bdf5f1d67b8c7a4c144dd13", + "raw/short-1.output": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "raw/short-1.receipt": "4a4a5cc6008f0286443686c10c17919e7e3a3e2258a6b97bf06311c9afe0dfe4", + "raw/short-1.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "raw/short-2.check.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c", + "raw/short-2.input": "5db852bf971a13086b099baa093cf88fbdaf42852f1cba8e938799a34109f332", + "raw/short-2.output": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "raw/short-2.receipt": "437701d7771dcdcc130e256587a9251dbeabef08feb3d518d93f7db29b32619b", + "raw/short-2.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "raw/short-3-traced.exit": "979b894f2d91bf199766571d58024f020d1a44a417da5f48e1fa1cdf554a14f5", + "raw/short-3-traced.output": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "raw/short-3-traced.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "raw/short-3.check.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c", + "raw/short-3.input": "509158d4cc5ee28556c0a1518ef3f7a97594e33aebe934a02a59f18c7ac5c230", + "raw/short-3.output": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "raw/short-3.receipt": "cf271c014ed96ffcad97c0ddde9a784deae63b48ab54ead38a601896a2cdfa05", + "raw/short-3.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "raw/short-3.strace": "ff002d74cd52f18355e768381e8dc8af5f8b44f87cdb39cc604aec984bd6367c", + "raw/short-4-traced.exit": "979b894f2d91bf199766571d58024f020d1a44a417da5f48e1fa1cdf554a14f5", + "raw/short-4-traced.output": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "raw/short-4-traced.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "raw/short-4.check.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c", + "raw/short-4.input": "9aec780192d96833fb57d407522db00fc6c6bf60b2fdf99ffbbbf5bdd9bfcb8d", + "raw/short-4.output": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "raw/short-4.receipt": "3be14d5117cfd9923743dc772ac727cb30372228ca81879e3cac708dc9700d9a", + "raw/short-4.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "raw/short-4.strace": "bcd0008ce257d99d270023add3ebdb45a84317ce804107fe85e5106453ce2c95", + "raw/short-5.check.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c", + "raw/short-5.input": "c42c9f8a6a3589d3aa3dfa90194663bfc26bd5575c60787c9a355f93fb9511fb", + "raw/short-5.output": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "raw/short-5.receipt": "311ce7da405cd8858718b28b45415028dedec82003dcb862d1b5ceea26c84646", + "raw/short-5.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "raw/short-6.check.log": "a0cc795fae1ca892318f47133f6c48e1c8bb6aad118ff7f2b00c8e8967393435", + "raw/short-6.input": "8ea63ccc995ca2f50cae898a5dd97a15c90d8650e190a824f857d4cb362a8e91", + "raw/short-6.output": "691fee447b7b1453a429e23f01152ffacca0570ccce92f525af024aa0d934519", + "raw/short-6.receipt": "26e7d22e42e36c12f4341bf1e1838f7fa84402571f3127fb91208ac45a05f64b", + "raw/short-6.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "raw/source-membership.diff": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "raw/trace-producer.err": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "raw/trace-producer.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa", + "raw/trace-provider.err": "074ffaa4fc78b6d5e8c4cc646123d4e16efe0ef9e081c9aab78c479da1b07e34", + "raw/trace-provider.exit": "93a73825c1b761d11bf2b3f4dff760d07888d3fde05dcf55f1da84aa6041a5a8", + "raw/trace-provider.out": "c9d6ffd3da9f61111b290c837735758566f93a95f203467268e3cc70e2b84a01", + "report.md": "f846dec7f6003c0740cbafa58622432c8b916ace31f230ac8faeec8b5e4e6274" +} diff --git a/evidence/allen-omega-L694/L748/independent-review/parent-boundary.log b/evidence/allen-omega-L694/L748/independent-review/parent-boundary.log new file mode 100644 index 00000000..4ef2f89c --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/parent-boundary.log @@ -0,0 +1,26 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 diff --git a/evidence/allen-omega-L694/L748/independent-review/parent-provider.output b/evidence/allen-omega-L694/L748/independent-review/parent-provider.output new file mode 100644 index 00000000..12949c15 Binary files /dev/null and b/evidence/allen-omega-L694/L748/independent-review/parent-provider.output differ diff --git a/evidence/allen-omega-L694/L748/independent-review/parent-verification.json b/evidence/allen-omega-L694/L748/independent-review/parent-verification.json new file mode 100644 index 00000000..1fcf8a5c --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/parent-verification.json @@ -0,0 +1,34 @@ +{ + "source_closures": [ + { + "pin": "43eae848f0a44604b42378d9ea3170278b5f3f8f", + "files": 51, + "core_sha256": "f5984ce7290b7853446ca2bc2d192d76dfd13bd90dad2c97c5acfd5720f95ba5" + }, + { + "pin": "4c7888f65dca209a1e2b859ba695ae308657c03e", + "files": 55, + "core_sha256": "65db52e4ec165ae64b71b7a2c68c6263890ecf6fc9cc9f27db68e2374dcfcbf0" + } + ], + "provider_review_checks": { + "provider-core.log": 100, + "provider-normal.check.log": 292, + "provider-fragment.check.log": 292, + "provider-boundary-final.log": 26, + "provider-semantic-check.log": 38, + "provider-partial-write-check-final.log": 83, + "short-1.check.log": 5, + "short-2.check.log": 5, + "short-3.check.log": 5, + "short-4.check.log": 5, + "short-5.check.log": 5, + "short-6.check.log": 17 + }, + "presentation_review_checks": 98, + "parent_provider_sha256": "c9367d4cbc9261ebc0faaf3a99c2988ee36abda197670d868bd202a3bb19cccd", + "parent_presentation_sha256": "24285077f8ff55875bac7834cb711f28b116ee11b5dd055fdd12bbfb7756c8aa", + "parent_presentation_checks": 23, + "report_sha256": "f846dec7f6003c0740cbafa58622432c8b916ace31f230ac8faeec8b5e4e6274", + "scope": "Host only; no correctness findings; original raw failures and scope limits retained." +} diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/core.om b/evidence/allen-omega-L694/L748/independent-review/probes/core.om new file mode 100644 index 00000000..0047c212 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/probes/core.om @@ -0,0 +1,3682 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-boundary-test-final.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-boundary-test-final.om new file mode 100644 index 00000000..c5a63ca2 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-boundary-test-final.om @@ -0,0 +1,3771 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +text Bmagic "ALNPRV01" +fn btest ok bool to void +check ok add get Checks 0 1 +end +fn bword off ulong v ulong to void +for i ulong 8 +put Ph add off i uchar and shr v mul i 8 255 +end +end +fn bframe op ulong now ulong arg ulong size ulong to void +for i ulong 8 +put Ph i get Bmagic i +end +bword 8 op +bword 16 now +bword 24 arg +bword 32 size +end +fn main to int +bframe 1 sub ulong 0 1 1 0 +btest prparse +btest eq get Pv 1 sub ulong 0 1 +bframe 1 shl ulong 1 63 sub ulong 0 1 0 +btest prparse +btest eq get Pv 1 shl ulong 1 63 +btest eq get Pv 2 sub ulong 0 1 +bframe sub ulong 0 1 0 0 0 +btest not prparse +bframe 2 0 0 0 +btest not prparse +bframe 2 0 0 1 +btest prparse +bframe 2 0 0 159 +btest prparse +bframe 2 0 0 160 +btest not prparse +bframe 5 0 0 64 +btest not prparse +bframe 5 0 0 65 +btest prparse +bframe 5 0 0 1200 +btest prparse +bframe 5 0 0 1201 +btest not prparse +bframe 8 0 0 4096 +btest prparse +bframe 8 0 1 4096 +btest prparse +bframe 8 0 2 4096 +btest not prparse +bframe 8 1 0 4096 +btest not prparse +bframe 9 0 0 4096 +btest prparse +bframe 9 0 511 4096 +btest prparse +bframe 9 0 512 4096 +btest not prparse +bframe 6 0 0 0 +btest prparse +bframe 6 1 0 0 +btest not prparse +bframe 7 0 1 0 +btest not prparse +bframe 10 0 0 0 +btest prparse +btest eq get Checks 0 25 +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-boundary-test-v2.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-boundary-test-v2.om new file mode 100644 index 00000000..a1ae6ef8 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-boundary-test-v2.om @@ -0,0 +1,3771 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +text Bmagic "ALNPRV01" +fn btest ok bool to void +check ok add get Checks 0 1 +end +fn bword off ulong v ulong to void +for i ulong 8 +put Ph add off i uchar and shr v mul i 8 255 +end +end +fn bframe op ulong now ulong arg ulong size ulong to void +for i ulong 8 +put Ph i get Bmagic i +end +bword 8 op +bword 16 now +bword 24 arg +bword 32 size +end +fn main to int +bframe 1 sub ulong 0 1 1 0 +btest prparse +btest eq get Pv 1 sub ulong 0 1 +bframe 1 shl ulong 1 63 sub ulong 0 1 0 +btest prparse +btest eq get Pv 1 shl ulong 1 63 +btest eq get Pv 2 sub ulong 0 1 +bframe sub ulong 0 1 0 0 0 +btest not prparse +bframe 2 0 0 0 +btest not prparse +bframe 2 0 0 1 +btest prparse +bframe 2 0 0 159 +btest prparse +bframe 2 0 0 160 +btest not prparse +bframe 5 0 0 64 +btest not prparse +bframe 5 0 0 65 +btest prparse +bframe 5 0 0 1200 +btest prparse +bframe 5 0 0 1201 +btest not prparse +bframe 8 0 0 4096 +btest prparse +bframe 8 0 1 4096 +btest prparse +bframe 8 0 2 4096 +btest not prparse +bframe 8 1 0 4096 +btest not prparse +bframe 9 0 0 4096 +btest prparse +bframe 9 0 511 4096 +btest prparse +bframe 9 0 512 4096 +btest not prparse +bframe 6 0 0 0 +btest prparse +bframe 6 1 0 0 +btest not prparse +bframe 7 0 1 0 +btest not prparse +bframe 10 0 0 0 +btest prparse +btest eq get Checks 0 28 +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-boundary-test.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-boundary-test.om new file mode 100644 index 00000000..d5fba9fa --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-boundary-test.om @@ -0,0 +1,3771 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +text Bmagic "ALNPRV01" +fn btest ok bool to void +check ok add get Checks 0 1 +end +fn bword off ulong v ulong to void +for i ulong 8 +put Ph add off i uchar and shr v mul i 8 255 +end +end +fn bframe op ulong now ulong arg ulong size ulong to void +for i ulong 8 +put Ph i get Bmagic i +end +bword 8 op +bword 16 now +bword 24 arg +bword 32 size +end +fn bmain to int +bframe 1 sub ulong 0 1 1 0 +btest prparse +btest eq get Pv 1 sub ulong 0 1 +bframe 1 shl ulong 1 63 sub ulong 0 1 0 +btest prparse +btest eq get Pv 1 shl ulong 1 63 +btest eq get Pv 2 sub ulong 0 1 +bframe sub ulong 0 1 0 0 0 +btest not prparse +bframe 2 0 0 0 +btest not prparse +bframe 2 0 0 1 +btest prparse +bframe 2 0 0 159 +btest prparse +bframe 2 0 0 160 +btest not prparse +bframe 5 0 0 64 +btest not prparse +bframe 5 0 0 65 +btest prparse +bframe 5 0 0 1200 +btest prparse +bframe 5 0 0 1201 +btest not prparse +bframe 8 0 0 4096 +btest prparse +bframe 8 0 1 4096 +btest prparse +bframe 8 0 2 4096 +btest not prparse +bframe 8 1 0 4096 +btest not prparse +bframe 9 0 0 4096 +btest prparse +bframe 9 0 511 4096 +btest prparse +bframe 9 0 512 4096 +btest not prparse +bframe 6 0 0 0 +btest prparse +bframe 6 1 0 0 +btest not prparse +bframe 7 0 1 0 +btest not prparse +bframe 10 0 0 0 +btest prparse +btest eq get Checks 0 28 +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-boundary.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-boundary.om new file mode 100644 index 00000000..cf104df5 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-boundary.om @@ -0,0 +1,72 @@ +text Bmagic "ALNPRV01" +fn btest ok bool to void +check ok add get Checks 0 1 +end +fn bword off ulong v ulong to void +for i ulong 8 +put Ph add off i uchar and shr v mul i 8 255 +end +end +fn bframe op ulong now ulong arg ulong size ulong to void +for i ulong 8 +put Ph i get Bmagic i +end +bword 8 op +bword 16 now +bword 24 arg +bword 32 size +end +fn main to int +bframe 1 sub ulong 0 1 1 0 +btest prparse +btest eq get Pv 1 sub ulong 0 1 +bframe 1 shl ulong 1 63 sub ulong 0 1 0 +btest prparse +btest eq get Pv 1 shl ulong 1 63 +btest eq get Pv 2 sub ulong 0 1 +bframe sub ulong 0 1 0 0 0 +btest not prparse +bframe 2 0 0 0 +btest not prparse +bframe 2 0 0 1 +btest prparse +bframe 2 0 0 159 +btest prparse +bframe 2 0 0 160 +btest not prparse +bframe 5 0 0 64 +btest not prparse +bframe 5 0 0 65 +btest prparse +bframe 5 0 0 1200 +btest prparse +bframe 5 0 0 1201 +btest not prparse +bframe 8 0 0 4096 +btest prparse +bframe 8 0 1 4096 +btest prparse +bframe 8 0 2 4096 +btest not prparse +bframe 8 1 0 4096 +btest not prparse +bframe 9 0 0 4096 +btest prparse +bframe 9 0 511 4096 +btest prparse +bframe 9 0 512 4096 +btest not prparse +bframe 6 0 0 0 +btest prparse +bframe 6 1 0 0 +btest not prparse +bframe 7 0 1 0 +btest not prparse +bframe 10 0 0 0 +btest prparse +btest eq get Checks 0 25 +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-core-test.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-core-test.om new file mode 100644 index 00000000..c8460592 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-core-test.om @@ -0,0 +1,3952 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +text Fmagic "ALNPRV01" +text Hi "hi" +text Reply "SAY 1 1/1 hello" +text Askcode "write a calculator" +text Tinycode "CODE 2 1/1 2 d8932aac text hi" +text Done "SAY 2 1/1 Done." +global Held uchar 8192 +global Holdn ulong 2 +global Before uchar 8192 +fn test ok bool to void +note Direct write logger would clobber the very datagram being tested. +put Holdn 0 get Outlen 0 +put Holdn 1 get Err 0 +for i ulong get Outlen 0 +put Held i get Outb i +end +check ok add get Checks 0 1 +for i ulong get Holdn 0 +put Outb i get Held i +end +put Outlen 0 get Holdn 0 +put Err 0 get Holdn 1 +end +fn hword off ulong v ulong to void +for i ulong 8 +put Ph add off i uchar and shr v mul i 8 255 +end +end +fn frame op ulong now ulong arg ulong size ulong to void +for i ulong 8 +put Ph i get Fmagic i +end +hword 8 op +hword 16 now +hword 24 arg +hword 32 size +end +fn oword off ulong to ulong +v = ulong 0 +for i ulong 8 +v = or v shl ulong get Pout add off i mul i 8 +end +ret v +end +fn receive part ulong size ulong to void +note Caller placed LINE payload in In; packet overwrites Outb, so preserve it. +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Held i get Outb i +end +put Inlen 0 size +b = packet 2 get Q 1 part 0 0 +size = get Outlen 0 +for i ulong size +put Pb i get Outb i +end +for i ulong n +put Outb i get Held i +end +put Outlen 0 n +put Err 0 e +frame 5 4294967297 0 size +end +fn main to int +frame 1 4294967296 77 0 +test prparse +test eq get Pv 0 1 +test eq get Pv 1 4294967296 +test eq get Pv 2 77 +put Ph 0 88 +test not prparse +frame 11 0 0 0 +test not prparse +frame 1 0 77 1 +test not prparse +frame 3 0 2 0 +test not prparse +frame 2 0 0 160 +test not prparse +frame 10 0 0 0 +test prdo +test eq oword 16 1 +test eq get Pc 0 1 +mset32 0 3 +mset32 36 1 +test memenc 10 +for i ulong 4096 +put Pb i get Enc i +end +frame 8 0 1 4096 +test prdo +test eq oword 16 1 +test eq get St 0 10 +test prdo +test eq oword 16 0 +frame 1 4294967296 77 0 +test prdo +test eq oword 16 0 +for i ulong 4096 +put Pb i 0 +end +frame 8 0 0 4096 +test prdo +test eq oword 16 2 +test eq get Pc 0 2 +test eq get St 0 10 +frame 1 4294967296 77 0 +test prdo +test eq oword 16 0 +put Ns 0 2 +put Ns 1 0 +put Ns 2 3 +put Ns 3 0 +put Note 0 78 +put Note 1 48 +test noteenc +for i ulong 4096 +put Pb i get Enc i +end +frame 9 0 1 4096 +test prdo +test eq oword 16 0 +frame 9 0 0 4096 +test prdo +test eq oword 16 1 +test eq get Pc 0 3 +frame 1 4294967296 77 0 +test prdo +test eq oword 16 1 +test eq get A 0 1 +test prdo +test eq oword 16 0 +frame 10 0 0 0 +test prdo +test eq oword 16 0 +test eq mem32 0 3 +frame 2 4294967297 0 len Hi +for i ulong len Hi +put Pb i get Hi i +end +test prdo +test eq oword 16 1 +test eq get R 0 1 +frame 3 4294967297 1 0 +test prdo +test eq oword 16 3 +test eq oword 32 get Outlen 0 +test eq get T 10 5 +same = true +for i ulong get Outlen 0 +if ne get Pout add i 40 get Outb i +same = false +end +end +test same +test prdo +test eq oword 16 1 +test eq get T 10 5 +frame 4 4294967297 0 0 +test prdo +test eq get T 3 0 +frame 3 4294967297 1 0 +test prdo +test eq oword 16 3 +frame 4 4294967297 1 0 +test prdo +test eq get T 3 1 +frame 3 4294967297 1 0 +test prdo +test eq get T 10 1 +for i ulong len Reply +put In i get Reply i +end +receive 1 len Reply +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Before i get Outb i +end +test prdo +test eq get Outlen 0 n +test eq get Err 0 e +same = true +for i ulong n +if ne get Outb i get Before i +same = false +end +end +test same +test eq oword 16 1 +test eq oword 24 1 +test eq oword 32 5 +test eq get Pout 40 104 +test eq get R 1 0 +test eq get T 10 1 +test eq get Outb 0 65 +frame 4 4294967297 1 0 +test prdo +frame 3 4294967297 1 0 +test prdo +test eq oword 16 3 +test eq get T 10 3 +frame 4 4294967297 1 0 +test prdo +frame 3 4294967297 1 0 +test prdo +test eq oword 16 1 +test eq oword 32 0 +frame 2 4294967297 0 len Askcode +for i ulong len Askcode +put Pb i get Askcode i +end +test prdo +test eq oword 24 1 +test eq oword 32 len Ack +for i ulong len Tinycode +put In i get Tinycode i +end +receive 1 len Tinycode +test prdo +test eq oword 24 0 +frame 3 4294967297 1 0 +test prdo +frame 4 4294967297 1 0 +test prdo +for i ulong len Done +put In i get Done i +end +receive 2 len Done +test prdo +test eq oword 24 1 +test eq oword 32 5 +off = ulong 45 +test eq oword add off 8 11 +test eq oword add off 32 2 +test eq get Pout add off 40 104 +test eq get Pout add off 41 105 +test eq get Pn 0 add off 42 +frame 3 4294967296 1 0 +test prdo +test eq oword 16 0 +test eq oword 24 0 +frame 7 0 0 0 +test prdo +test eq get R 9 0 +test eq get R 0 2 +test eq get Q 1 2 +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-input-test.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-input-test.om new file mode 100644 index 00000000..7ad3d79d --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-input-test.om @@ -0,0 +1,3843 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +note Generates real framed stdin. Mode byte0 normal,1..5 malformed,6 fail-fast. +text Iomagic "ALNPRV01" +text Wireline "ALLEN-COURIER v=1 run=000000000000004d kind=LINE seq=1 part=1/0 bytes=0\nSAY 1 1/1 hello" +global Ih uchar 40 +global Choice uchar 1 +fn iword off ulong v ulong to void +for i ulong 8 +put Ih add off i uchar and shr v mul i 8 255 +end +end +fn ihead op ulong now ulong arg ulong size ulong to void +for i ulong 8 +put Ih i get Iomagic i +end +iword 8 op +iword 16 now +iword 24 arg +iword 32 size +end +fn ihwrite count ulong to bool +p = ulong 0 +while lt p count +size = sub count p +if eq get Choice 0 55 +size = 1 +end +n = write 1 Ih p size +if le n 0 +ret false +end +p = add p ulong n +end +ret true +end +fn ibwrite count ulong to bool +p = ulong 0 +while lt p count +size = sub count p +if eq get Choice 0 55 +size = 1 +end +n = write 1 Pb p size +if le n 0 +ret false +end +p = add p ulong n +end +ret true +end +fn iframe op ulong now ulong arg ulong size ulong to bool +ihead op now arg size +if not ihwrite 40 +ret false +end +ret ibwrite size +end +fn main to int +n = read 0 Choice 0 1 +if ne n 1 +ret 65 +end +mode = get Choice 0 +if eq mode 56 +ihead 1 1 0 0 +b = ihwrite 40 +ret 0 +end +if eq mode 49 +ihead 1 0 77 0 +put Ih 0 88 +b = ihwrite 40 +ret 0 +end +if eq mode 50 +ihead 2 0 0 160 +b = ihwrite 40 +ret 0 +end +if eq mode 51 +ihead 1 0 77 0 +b = ihwrite 39 +ret 0 +end +if eq mode 52 +ihead 2 0 0 2 +b = ihwrite 40 +put Pb 0 104 +b = ibwrite 1 +ret 0 +end +if eq mode 53 +ihead 11 0 0 0 +b = ihwrite 40 +ret 0 +end +if not iframe 1 0 77 0 +ret 74 +end +if eq mode 54 +ihead 2 1 0 160 +b = ihwrite 40 +for i ulong 160 +put Pb i 120 +end +b = ibwrite 160 +put Pb 0 104 +put Pb 1 105 +b = iframe 2 1 0 2 +ret 0 +end +put Pb 0 104 +put Pb 1 105 +if not iframe 2 1 0 2 +ret 74 +end +if not iframe 3 1 1 0 +ret 74 +end +if not iframe 4 1 1 0 +ret 74 +end +if not iframe 3 1 1 0 +ret 74 +end +if not iframe 4 1 1 0 +ret 74 +end +for i ulong len Wireline +put Pb i get Wireline i +end +if not iframe 5 2 0 len Wireline +ret 74 +end +if not iframe 3 2 1 0 +ret 74 +end +if not iframe 4 2 1 0 +ret 74 +end +if not iframe 3 2 1 0 +ret 74 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-output-test.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-output-test.om new file mode 100644 index 00000000..8b36852e --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-output-test.om @@ -0,0 +1,3803 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +note Independent stream-output assertions, not a captured/blessed output fixture. +global Vbuf uchar 65536 +text Vmagic "ALNPRV01" +text Ops "1234345343" +text Hello "ALLEN-COURIER v=1 run=000000000000004d kind=HELLO seq=0 part=0/0 bytes=0\n" +text Got "ALLEN-COURIER v=1 run=000000000000004d kind=GOT seq=1 part=1/0 bytes=0\n" +text Jobtail "hi\tself=Allen\tstarts=0" +text Wordsout "hello" +fn test ok bool to void +check ok add get Checks 0 1 +end +fn vword off ulong to ulong +v = ulong 0 +for i ulong 8 +v = or v shl ulong get Vbuf add off i mul i 8 +end +ret v +end +fn vbyte at ulong expected uchar to void +test eq get Vbuf at expected +end +fn verify n ulong to int +p = ulong 0 +count = ulong 0 +while lt p n +if or lt sub n p 40 ge count 10 +ret 65 +end +for i ulong 8 +vbyte add p i get Vmagic i +end +op = vword add p 8 +status = vword add p 16 +event = vword add p 24 +size = vword add p 32 +p = add p 40 +if gt size sub n p +ret 65 +end +test eq op sub ulong get Ops count 48 +wanted = ulong 1 +if or eq count 2 eq count 4 +wanted = 3 +end +if eq count 7 +wanted = 3 +end +test eq status wanted +if eq count 6 +test eq event 1 +test eq size len Wordsout +for i ulong len Wordsout +vbyte add p i get Wordsout i +end +else +test eq event 0 +end +if eq count 2 +test eq size len Hello +for i ulong len Hello +vbyte add p i get Hello i +end +end +if eq count 7 +test eq size len Got +for i ulong len Got +vbyte add p i get Got i +end +end +if eq count 4 +test ge size len Jobtail +if ge size len Jobtail +at = add p sub size len Jobtail +for i ulong len Jobtail +vbyte add at i get Jobtail i +end +end +end +if and ne wanted 3 ne count 6 +test eq size 0 +end +p = add p size +count = add count 1 +end +test eq count 10 +if ne get Fails 0 0 +ret 1 +end +ret 0 +end +fn main to int +n = ulong 0 +while lt n len Vbuf +r = read 0 Vbuf n sub len Vbuf n +if lt r 0 +ret 74 +end +if eq r 0 +ret verify n +end +n = add n ulong r +end +ret 65 +end diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-process-test.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-process-test.om new file mode 100644 index 00000000..dab97e9d --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-process-test.om @@ -0,0 +1,3799 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +note Native assertions over host-collected process receipts. +note Four decimal lines: mode, exit, stdout bytes, stderr bytes; then stdout+stderr. +global Procbuf uchar 65536 +global Procnum ulong 4 +global Procpos ulong 1 +text Procmag "ALNPRV01" +fn pcheck ok bool to void +check ok add get Checks 0 1 +end +fn pnumber n ulong to bool +v = ulong 0 +digits = ulong 0 +while lt get Procpos 0 n +c = get Procbuf get Procpos 0 +put Procpos 0 add get Procpos 0 1 +if eq c 10 +if eq digits 0 +ret false +end +put Procnum 3 v +ret true +end +if or lt c 48 gt c 57 +ret false +end +if ge digits 8 +ret false +end +v = add mul v 10 sub ulong c 48 +digits = add digits 1 +end +ret false +end +fn pword off ulong to ulong +v = ulong 0 +for i ulong 8 +v = or v shl ulong get Procbuf add off i mul i 8 +end +ret v +end +fn pverify n ulong to int +for i ulong 3 +if not pnumber n +ret 65 +end +put Procnum i get Procnum 3 +end +if not pnumber n +ret 65 +end +mode = get Procnum 0 +rc = get Procnum 1 +size = get Procnum 2 +err = get Procnum 3 +p = get Procpos 0 +pcheck eq n add add p size err +pcheck eq err 0 +if le mode 6 +pcheck ge mode 1 +pcheck eq rc 65 +if eq mode 6 +pcheck eq size 40 +if ge sub n p 40 +for i ulong 8 +pcheck eq get Procbuf add p i get Procmag i +end +pcheck eq pword add p 8 1 +pcheck eq pword add p 16 1 +pcheck eq pword add p 24 0 +pcheck eq pword add p 32 0 +end +else +pcheck eq size 0 +end +else +if eq mode 7 +pcheck eq rc 0 +else +ret 65 +end +end +if ne get Fails 0 0 +ret 1 +end +ret 0 +end +fn main to int +n = ulong 0 +while lt n len Procbuf +r = read 0 Procbuf n sub len Procbuf n +if lt r 0 +ret 74 +end +if eq r 0 +ret pverify n +end +n = add n ulong r +end +ret 65 +end diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-input-test-v2.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-input-test-v2.om new file mode 100644 index 00000000..c0cba97d --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-input-test-v2.om @@ -0,0 +1,3743 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +text Smagic "ALNPRV01" +global Sh uchar 40 +fn sword off ulong v ulong to void +for i ulong 8 +put Sh add off i uchar and shr v mul i 8 255 +end +end +fn shead op ulong now ulong arg ulong size ulong to void +for i ulong 8 +put Sh i get Smagic i +end +sword 8 op +sword 16 now +sword 24 arg +sword 32 size +end +fn swrite p ulong n ulong to bool +at = ulong 0 +while lt at n +left = sub n at +r = write 1 p at left +if le r 0 +ret false +end +at = add at ulong r +end +ret true +end +fn frame op ulong now ulong arg ulong size ulong to bool +shead op now arg size +ret swrite Sh 40 +end +fn main to int +if not frame 1 1 77 0 +ret 74 +end +if not frame 1 2 78 0 +ret 74 +end +if not frame 6 3 0 0 +ret 74 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-input-test-v3.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-input-test-v3.om new file mode 100644 index 00000000..c028a9ad --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-input-test-v3.om @@ -0,0 +1,3743 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +text Smagic "ALNPRV01" +global Sh uchar 40 +fn sword off ulong v ulong to void +for i ulong 8 +put Sh add off i uchar and shr v mul i 8 255 +end +end +fn shead op ulong now ulong arg ulong size ulong to void +for i ulong 8 +put Sh i get Smagic i +end +sword 8 op +sword 16 now +sword 24 arg +sword 32 size +end +fn swrite n ulong to bool +at = ulong 0 +while lt at n +left = sub n at +r = write 1 Sh at left +if le r 0 +ret false +end +at = add at ulong r +end +ret true +end +fn frame op ulong now ulong arg ulong size ulong to bool +shead op now arg size +ret swrite 40 +end +fn main to int +if not frame 1 1 77 0 +ret 74 +end +if not frame 1 2 78 0 +ret 74 +end +if not frame 6 3 0 0 +ret 74 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-input-test-v4.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-input-test-v4.om new file mode 100644 index 00000000..7e13fb0b --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-input-test-v4.om @@ -0,0 +1,3743 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +text Smagic "ALNPRV01" +global Sh uchar 40 +fn sword off ulong v ulong to void +for i ulong 8 +put Sh add off i uchar and shr v mul i 8 255 +end +end +fn shead op ulong now ulong arg ulong size ulong to void +for i ulong 8 +put Sh i get Smagic i +end +sword 8 op +sword 16 now +sword 24 arg +sword 32 size +end +fn swrite n ulong to bool +at = ulong 0 +while lt at n +left = sub n at +r = write 1 Sh at left +if le r 0 +ret false +end +at = add at ulong r +end +ret true +end +fn frame op ulong now ulong arg ulong size ulong to bool +shead op now arg size +ret swrite 40 +end +fn main to int +if not frame 1 1 77 0 +ret 74 +end +if not frame 1 2 78 0 +ret 74 +end +if not frame 6 0 0 0 +ret 74 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-input-test.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-input-test.om new file mode 100644 index 00000000..c0cba97d --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-input-test.om @@ -0,0 +1,3743 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +text Smagic "ALNPRV01" +global Sh uchar 40 +fn sword off ulong v ulong to void +for i ulong 8 +put Sh add off i uchar and shr v mul i 8 255 +end +end +fn shead op ulong now ulong arg ulong size ulong to void +for i ulong 8 +put Sh i get Smagic i +end +sword 8 op +sword 16 now +sword 24 arg +sword 32 size +end +fn swrite p ulong n ulong to bool +at = ulong 0 +while lt at n +left = sub n at +r = write 1 p at left +if le r 0 +ret false +end +at = add at ulong r +end +ret true +end +fn frame op ulong now ulong arg ulong size ulong to bool +shead op now arg size +ret swrite Sh 40 +end +fn main to int +if not frame 1 1 77 0 +ret 74 +end +if not frame 1 2 78 0 +ret 74 +end +if not frame 6 3 0 0 +ret 74 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-input.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-input.om new file mode 100644 index 00000000..b414928a --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-input.om @@ -0,0 +1,44 @@ +text Smagic "ALNPRV01" +global Sh uchar 40 +fn sword off ulong v ulong to void +for i ulong 8 +put Sh add off i uchar and shr v mul i 8 255 +end +end +fn shead op ulong now ulong arg ulong size ulong to void +for i ulong 8 +put Sh i get Smagic i +end +sword 8 op +sword 16 now +sword 24 arg +sword 32 size +end +fn swrite n ulong to bool +at = ulong 0 +while lt at n +left = sub n at +r = write 1 Sh at left +if le r 0 +ret false +end +at = add at ulong r +end +ret true +end +fn frame op ulong now ulong arg ulong size ulong to bool +shead op now arg size +ret swrite 40 +end +fn main to int +if not frame 1 1 77 0 +ret 74 +end +if not frame 1 2 78 0 +ret 74 +end +if not frame 6 0 0 0 +ret 74 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output-test-final.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output-test-final.om new file mode 100644 index 00000000..cf40e0d2 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output-test-final.om @@ -0,0 +1,3745 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +global Obuf uchar 256 +text Omagic "ALNPRV01" +fn test ok bool to void +check ok add get Checks 0 1 +end +fn getheader p ulong to ulong +v = ulong 0 +for i ulong 8 +v = or v shl ulong get Obuf add p i mul i 8 +end +ret v +end +fn main to int +n = ulong 0 +while lt n len Obuf +r = read 0 Obuf n sub len Obuf n +if le r 0 +ret 65 +end +n = add n ulong r +end +test eq n 120 +for rec ulong 3 +p = mul rec 40 +for i ulong 8 +test eq get Obuf add p i get Omagic i +end +test eq getheader add p 8 sub rec 3 +if eq rec 0 +test eq getheader add p 16 1 +else +if eq rec 1 +test eq getheader add p 16 0 +else +test eq getheader add p 16 1 +end +end +test eq getheader add p 24 0 +test eq getheader add p 32 0 +end +test eq get Checks 0 60 +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output-test-final2.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output-test-final2.om new file mode 100644 index 00000000..2f6762aa --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output-test-final2.om @@ -0,0 +1,3749 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +global Obuf uchar 256 +text Omagic "ALNPRV01" +fn test ok bool to void +check ok add get Checks 0 1 +end +fn getheader p ulong to ulong +v = ulong 0 +for i ulong 8 +v = or v shl ulong get Obuf add p i mul i 8 +end +ret v +end +fn main to int +n = ulong 0 +while lt n len Obuf +r = read 0 Obuf n sub len Obuf n +if le r 0 +ret 65 +end +n = add n ulong r +end +test eq n 120 +for rec ulong 3 +p = mul rec 40 +for i ulong 8 +test eq get Obuf add p i get Omagic i +end +if eq rec 2 +test eq getheader add p 8 6 +else +test eq getheader add p 8 1 +end +if eq rec 0 +test eq getheader add p 16 1 +else +if eq rec 1 +test eq getheader add p 16 0 +else +test eq getheader add p 16 1 +end +end +test eq getheader add p 24 0 +test eq getheader add p 32 0 +end +test eq get Checks 0 37 +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output-test-final3.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output-test-final3.om new file mode 100644 index 00000000..72ed7adc --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output-test-final3.om @@ -0,0 +1,3749 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +global Obuf uchar 256 +text Omagic "ALNPRV01" +fn test ok bool to void +check ok add get Checks 0 1 +end +fn getheader p ulong to ulong +v = ulong 0 +for i ulong 8 +v = or v shl ulong get Obuf add p i mul i 8 +end +ret v +end +fn main to int +n = ulong 0 +while lt n 120 +r = read 0 Obuf n sub len Obuf n +if le r 0 +ret 65 +end +n = add n ulong r +end +test eq n 120 +for rec ulong 3 +p = mul rec 40 +for i ulong 8 +test eq get Obuf add p i get Omagic i +end +if eq rec 2 +test eq getheader add p 8 6 +else +test eq getheader add p 8 1 +end +if eq rec 0 +test eq getheader add p 16 1 +else +if eq rec 1 +test eq getheader add p 16 0 +else +test eq getheader add p 16 1 +end +end +test eq getheader add p 24 0 +test eq getheader add p 32 0 +end +test eq get Checks 0 37 +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output-test-v3.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output-test-v3.om new file mode 100644 index 00000000..98af86c5 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output-test-v3.om @@ -0,0 +1,3745 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +global O uchar 256 +text M "ALNPRV01" +fn test ok bool to void +check ok add get Checks 0 1 +end +fn word p ulong to ulong +v = ulong 0 +for i ulong 8 +v = or v shl ulong get O add p i mul i 8 +end +ret v +end +fn main to int +n = ulong 0 +while lt n len O +r = read 0 O n sub len O n +if le r 0 +ret 65 +end +n = add n ulong r +end +test eq n 120 +for rec ulong 3 +p = mul rec 40 +for i ulong 8 +test eq get O add p i get M i +end +test eq word add p 8 sub rec 3 +if eq rec 0 +test eq word add p 16 1 +else +if eq rec 1 +test eq word add p 16 0 +else +test eq word add p 16 1 +end +end +test eq word add p 24 0 +test eq word add p 32 0 +end +test eq get Checks 0 60 +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output-test-v4.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output-test-v4.om new file mode 100644 index 00000000..57c669f1 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output-test-v4.om @@ -0,0 +1,3745 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +global Obuf uchar 256 +text Omagic "ALNPRV01" +fn test ok bool to void +check ok add get Checks 0 1 +end +fn oword p ulong to ulong +v = ulong 0 +for i ulong 8 +v = or v shl ulong get Obuf add p i mul i 8 +end +ret v +end +fn main to int +n = ulong 0 +while lt n len Obuf +r = read 0 Obuf n sub len Obuf n +if le r 0 +ret 65 +end +n = add n ulong r +end +test eq n 120 +for rec ulong 3 +p = mul rec 40 +for i ulong 8 +test eq get Obuf add p i get Omagic i +end +test eq oword add p 8 sub rec 3 +if eq rec 0 +test eq word add p 16 1 +else +if eq rec 1 +test eq word add p 16 0 +else +test eq word add p 16 1 +end +end +test eq word add p 24 0 +test eq word add p 32 0 +end +test eq get Checks 0 60 +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output-test-v5.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output-test-v5.om new file mode 100644 index 00000000..c74ae9bb --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output-test-v5.om @@ -0,0 +1,3745 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +global Obuf uchar 256 +text Omagic "ALNPRV01" +fn test ok bool to void +check ok add get Checks 0 1 +end +fn ooword p ulong to ulong +v = ulong 0 +for i ulong 8 +v = or v shl ulong get Obuf add p i mul i 8 +end +ret v +end +fn main to int +n = ulong 0 +while lt n len Obuf +r = read 0 Obuf n sub len Obuf n +if le r 0 +ret 65 +end +n = add n ulong r +end +test eq n 120 +for rec ulong 3 +p = mul rec 40 +for i ulong 8 +test eq get Obuf add p i get Omagic i +end +test eq ooword add p 8 sub rec 3 +if eq rec 0 +test eq oword add p 16 1 +else +if eq rec 1 +test eq oword add p 16 0 +else +test eq oword add p 16 1 +end +end +test eq oword add p 24 0 +test eq oword add p 32 0 +end +test eq get Checks 0 60 +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output-test-v6.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output-test-v6.om new file mode 100644 index 00000000..0218dbd3 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output-test-v6.om @@ -0,0 +1,3745 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +global Obuf uchar 256 +text Omagic "ALNPRV01" +fn test ok bool to void +check ok add get Checks 0 1 +end +fn oooword p ulong to ulong +v = ulong 0 +for i ulong 8 +v = or v shl ulong get Obuf add p i mul i 8 +end +ret v +end +fn main to int +n = ulong 0 +while lt n len Obuf +r = read 0 Obuf n sub len Obuf n +if le r 0 +ret 65 +end +n = add n ulong r +end +test eq n 120 +for rec ulong 3 +p = mul rec 40 +for i ulong 8 +test eq get Obuf add p i get Omagic i +end +test eq oooword add p 8 sub rec 3 +if eq rec 0 +test eq ooword add p 16 1 +else +if eq rec 1 +test eq ooword add p 16 0 +else +test eq ooword add p 16 1 +end +end +test eq ooword add p 24 0 +test eq ooword add p 32 0 +end +test eq get Checks 0 60 +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output.om new file mode 100644 index 00000000..00ca94a5 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-semantic-output.om @@ -0,0 +1,50 @@ +global Obuf uchar 256 +text Omagic "ALNPRV01" +fn test ok bool to void +check ok add get Checks 0 1 +end +fn getheader p ulong to ulong +v = ulong 0 +for i ulong 8 +v = or v shl ulong get Obuf add p i mul i 8 +end +ret v +end +fn main to int +n = ulong 0 +while lt n 120 +r = read 0 Obuf n sub len Obuf n +if le r 0 +ret 65 +end +n = add n ulong r +end +test eq n 120 +for rec ulong 3 +p = mul rec 40 +for i ulong 8 +test eq get Obuf add p i get Omagic i +end +if eq rec 2 +test eq getheader add p 8 6 +else +test eq getheader add p 8 1 +end +if eq rec 0 +test eq getheader add p 16 1 +else +if eq rec 1 +test eq getheader add p 16 0 +else +test eq getheader add p 16 1 +end +end +test eq getheader add p 24 0 +test eq getheader add p 32 0 +end +test eq get Checks 0 37 +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-shortwrite-check-test-final.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-shortwrite-check-test-final.om new file mode 100644 index 00000000..a2a38068 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-shortwrite-check-test-final.om @@ -0,0 +1,3783 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +global Receipt uchar 4096 +global V ulong 4 +global Pos ulong 1 +global Sstart ulong 1 +text Mag "ALNPRV01" +fn checknum ok bool to void +check ok add get Checks 0 1 +end +fn parsenum n ulong to bool +v = ulong 0 +digits = ulong 0 +while lt get Pos 0 n +c = get Receipt get Pos 0 +put Pos 0 add get Pos 0 1 +if eq c 10 +if eq digits 0 +ret false +end +put V get Sstart 0 v +put Sstart 0 add get Sstart 0 1 +ret true +end +if or lt c 48 gt c 57 +ret false +end +v = add mul v 10 sub ulong c 48 +digits = add digits 1 +end +ret false +end +fn sbyte p ulong c uchar to void +checknum eq get Receipt p c +end +fn shead p ulong to ulong +v = ulong 0 +for i ulong 8 +v = or v shl ulong get Receipt add p i mul i 8 +end +ret v +end +fn main to int +n = ulong 0 +while lt n 1036 +r = read 0 Receipt n sub len Receipt n +if le r 0 +ret 65 +end +n = add n ulong r +end +for i ulong 4 +if not parsenum n +ret 65 +end +end +checknum eq get V 0 8 +checknum eq get V 1 74 +checknum eq get V 2 1024 +checknum eq get V 3 0 +p = get Pos 0 +checknum eq n add p 1024 +for rec ulong 7 +for i ulong 8 +sbyte add p i get Mag i +end +size = shead add p 32 +checknum le size 8192 +p = add add p 40 size +end +checknum eq p add get Pos 0 923 +remain = sub n p +checknum eq remain 101 +for i ulong 8 +sbyte add p i get Mag i +end +checknum eq shead add p 8 3 +checknum eq shead add p 16 3 +checknum eq shead add p 24 0 +checknum eq shead add p 32 71 +checknum eq get Checks 0 82 +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-shortwrite-check-test-v2.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-shortwrite-check-test-v2.om new file mode 100644 index 00000000..f280db1c --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-shortwrite-check-test-v2.om @@ -0,0 +1,3783 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +global Receipt uchar 4096 +global V ulong 4 +global Pos ulong 1 +global Sstart ulong 1 +text Mag "ALNPRV01" +fn checknum ok bool to void +check ok add get Checks 0 1 +end +fn parsenum n ulong to bool +v = ulong 0 +digits = ulong 0 +while lt get Pos 0 n +c = get Receipt get Pos 0 +put Pos 0 add get Pos 0 1 +if eq c 10 +if eq digits 0 +ret false +end +put V get Sstart 0 v +put Sstart 0 add get Sstart 0 1 +ret true +end +if or lt c 48 gt c 57 +ret false +end +v = add mul v 10 sub ulong c 48 +digits = add digits 1 +end +ret false +end +fn sbyte p ulong c uchar to void +checknum eq get Receipt p c +end +fn shead p ulong to ulong +v = ulong 0 +for i ulong 8 +v = or v shl ulong get Receipt add p i mul i 8 +end +ret v +end +fn main to int +n = ulong 0 +while lt n len Receipt +r = read 0 Receipt n sub len Receipt n +if le r 0 +ret 65 +end +n = add n ulong r +end +for i ulong 4 +if not parsenum n +ret 65 +end +end +checknum eq get V 0 8 +checknum eq get V 1 74 +checknum eq get V 2 1024 +checknum eq get V 3 0 +p = get Pos 0 +checknum eq n add p 1024 +for rec ulong 7 +for i ulong 8 +sbyte add p i get Mag i +end +size = shead add p 32 +checknum le size 8192 +p = add add p 40 size +end +checknum eq p add get Pos 0 923 +remaining = sub n p +checknum eq remaining 101 +for i ulong 8 +sbyte add p i get Mag i +end +checknum eq shead add p 8 3 +checknum eq shead add p 16 3 +checknum eq shead add p 24 0 +checknum eq shead add p 32 71 +checknum eq get Checks 0 17 +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-shortwrite-check-test-v3.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-shortwrite-check-test-v3.om new file mode 100644 index 00000000..7cca6cee --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-shortwrite-check-test-v3.om @@ -0,0 +1,3783 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +global Receipt uchar 4096 +global V ulong 4 +global Pos ulong 1 +global Sstart ulong 1 +text Mag "ALNPRV01" +fn checknum ok bool to void +check ok add get Checks 0 1 +end +fn parsenum n ulong to bool +v = ulong 0 +digits = ulong 0 +while lt get Pos 0 n +c = get Receipt get Pos 0 +put Pos 0 add get Pos 0 1 +if eq c 10 +if eq digits 0 +ret false +end +put V get Sstart 0 v +put Sstart 0 add get Sstart 0 1 +ret true +end +if or lt c 48 gt c 57 +ret false +end +v = add mul v 10 sub ulong c 48 +digits = add digits 1 +end +ret false +end +fn sbyte p ulong c uchar to void +checknum eq get Receipt p c +end +fn shead p ulong to ulong +v = ulong 0 +for i ulong 8 +v = or v shl ulong get Receipt add p i mul i 8 +end +ret v +end +fn main to int +n = ulong 0 +while lt n len Receipt +r = read 0 Receipt n sub len Receipt n +if le r 0 +ret 65 +end +n = add n ulong r +end +for i ulong 4 +if not parsenum n +ret 65 +end +end +checknum eq get V 0 8 +checknum eq get V 1 74 +checknum eq get V 2 1024 +checknum eq get V 3 0 +p = get Pos 0 +checknum eq n add p 1024 +for rec ulong 7 +for i ulong 8 +sbyte add p i get Mag i +end +size = shead add p 32 +checknum le size 8192 +p = add add p 40 size +end +checknum eq p add get Pos 0 923 +remain = sub n p +checknum eq remain 101 +for i ulong 8 +sbyte add p i get Mag i +end +checknum eq shead add p 8 3 +checknum eq shead add p 16 3 +checknum eq shead add p 24 0 +checknum eq shead add p 32 71 +checknum eq get Checks 0 17 +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-shortwrite-check-test-v4.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-shortwrite-check-test-v4.om new file mode 100644 index 00000000..79f471b9 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-shortwrite-check-test-v4.om @@ -0,0 +1,3783 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +global Receipt uchar 4096 +global V ulong 4 +global Pos ulong 1 +global Sstart ulong 1 +text Mag "ALNPRV01" +fn checknum ok bool to void +check ok add get Checks 0 1 +end +fn parsenum n ulong to bool +v = ulong 0 +digits = ulong 0 +while lt get Pos 0 n +c = get Receipt get Pos 0 +put Pos 0 add get Pos 0 1 +if eq c 10 +if eq digits 0 +ret false +end +put V get Sstart 0 v +put Sstart 0 add get Sstart 0 1 +ret true +end +if or lt c 48 gt c 57 +ret false +end +v = add mul v 10 sub ulong c 48 +digits = add digits 1 +end +ret false +end +fn sbyte p ulong c uchar to void +checknum eq get Receipt p c +end +fn shead p ulong to ulong +v = ulong 0 +for i ulong 8 +v = or v shl ulong get Receipt add p i mul i 8 +end +ret v +end +fn main to int +n = ulong 0 +while lt n 1037 +r = read 0 Receipt n sub len Receipt n +if le r 0 +ret 65 +end +n = add n ulong r +end +for i ulong 4 +if not parsenum n +ret 65 +end +end +checknum eq get V 0 8 +checknum eq get V 1 74 +checknum eq get V 2 1024 +checknum eq get V 3 0 +p = get Pos 0 +checknum eq n add p 1024 +for rec ulong 7 +for i ulong 8 +sbyte add p i get Mag i +end +size = shead add p 32 +checknum le size 8192 +p = add add p 40 size +end +checknum eq p add get Pos 0 923 +remain = sub n p +checknum eq remain 101 +for i ulong 8 +sbyte add p i get Mag i +end +checknum eq shead add p 8 3 +checknum eq shead add p 16 3 +checknum eq shead add p 24 0 +checknum eq shead add p 32 71 +checknum eq get Checks 0 83 +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-shortwrite-check-test-v5.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-shortwrite-check-test-v5.om new file mode 100644 index 00000000..583d31b1 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-shortwrite-check-test-v5.om @@ -0,0 +1,3783 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +global Receipt uchar 4096 +global V ulong 4 +global Pos ulong 1 +global Sstart ulong 1 +text Mag "ALNPRV01" +fn checknum ok bool to void +check ok add get Checks 0 1 +end +fn parsenum n ulong to bool +v = ulong 0 +digits = ulong 0 +while lt get Pos 0 n +c = get Receipt get Pos 0 +put Pos 0 add get Pos 0 1 +if eq c 10 +if eq digits 0 +ret false +end +put V get Sstart 0 v +put Sstart 0 add get Sstart 0 1 +ret true +end +if or lt c 48 gt c 57 +ret false +end +v = add mul v 10 sub ulong c 48 +digits = add digits 1 +end +ret false +end +fn sbyte p ulong c uchar to void +checknum eq get Receipt p c +end +fn shead p ulong to ulong +v = ulong 0 +for i ulong 8 +v = or v shl ulong get Receipt add p i mul i 8 +end +ret v +end +fn main to int +n = ulong 0 +while lt n 1036 +r = read 0 Receipt n sub len Receipt n +if le r 0 +ret 65 +end +n = add n ulong r +end +for i ulong 4 +if not parsenum n +ret 65 +end +end +checknum eq get V 0 8 +checknum eq get V 1 74 +checknum eq get V 2 1024 +checknum eq get V 3 0 +p = get Pos 0 +checknum eq n add p 1024 +for rec ulong 7 +for i ulong 8 +sbyte add p i get Mag i +end +size = shead add p 32 +checknum le size 8192 +p = add add p 40 size +end +checknum eq p add get Pos 0 923 +remain = sub n p +checknum eq remain 101 +for i ulong 8 +sbyte add p i get Mag i +end +checknum eq shead add p 8 3 +checknum eq shead add p 16 3 +checknum eq shead add p 24 0 +checknum eq shead add p 32 71 +checknum eq get Checks 0 83 +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-shortwrite-check-test.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-shortwrite-check-test.om new file mode 100644 index 00000000..f6293d3b --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-shortwrite-check-test.om @@ -0,0 +1,3783 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +global Receipt uchar 4096 +global V ulong 4 +global Pos ulong 1 +global Sstart ulong 1 +text Mag "ALNPRV01" +fn checknum ok bool to void +check ok add get Checks 0 1 +end +fn number n ulong to bool +v = ulong 0 +digits = ulong 0 +while lt get Pos 0 n +c = get Receipt get Pos 0 +put Pos 0 add get Pos 0 1 +if eq c 10 +if eq digits 0 +ret false +end +put V get Sstart 0 v +put Sstart 0 add get Sstart 0 1 +ret true +end +if or lt c 48 gt c 57 +ret false +end +v = add mul v 10 sub ulong c 48 +digits = add digits 1 +end +ret false +end +fn sbyte p ulong c uchar to void +checknum eq get Receipt p c +end +fn shead p ulong to ulong +v = ulong 0 +for i ulong 8 +v = or v shl ulong get Receipt add p i mul i 8 +end +ret v +end +fn main to int +n = ulong 0 +while lt n len Receipt +r = read 0 Receipt n sub len Receipt n +if le r 0 +ret 65 +end +n = add n ulong r +end +for i ulong 4 +if not number n +ret 65 +end +end +checknum eq get V 0 8 +checknum eq get V 1 74 +checknum eq get V 2 1024 +checknum eq get V 3 0 +p = get Pos 0 +checknum eq n add p 1024 +for rec ulong 7 +for i ulong 8 +sbyte add p i get Mag i +end +size = shead add p 32 +checknum le size 8192 +p = add add p 40 size +end +checknum eq p add get Pos 0 923 +remaining = sub n p +checknum eq remaining 101 +for i ulong 8 +sbyte add p i get Mag i +end +checknum eq shead add p 8 3 +checknum eq shead add p 16 3 +checknum eq shead add p 24 0 +checknum eq shead add p 32 71 +checknum eq get Checks 0 17 +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider-shortwrite-check.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider-shortwrite-check.om new file mode 100644 index 00000000..27a8d4fb --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider-shortwrite-check.om @@ -0,0 +1,84 @@ +global Receipt uchar 4096 +global V ulong 4 +global Pos ulong 1 +global Sstart ulong 1 +text Mag "ALNPRV01" +fn checknum ok bool to void +check ok add get Checks 0 1 +end +fn parsenum n ulong to bool +v = ulong 0 +digits = ulong 0 +while lt get Pos 0 n +c = get Receipt get Pos 0 +put Pos 0 add get Pos 0 1 +if eq c 10 +if eq digits 0 +ret false +end +put V get Sstart 0 v +put Sstart 0 add get Sstart 0 1 +ret true +end +if or lt c 48 gt c 57 +ret false +end +v = add mul v 10 sub ulong c 48 +digits = add digits 1 +end +ret false +end +fn sbyte p ulong c uchar to void +checknum eq get Receipt p c +end +fn shead p ulong to ulong +v = ulong 0 +for i ulong 8 +v = or v shl ulong get Receipt add p i mul i 8 +end +ret v +end +fn main to int +n = ulong 0 +while lt n 1036 +r = read 0 Receipt n sub len Receipt n +if le r 0 +ret 65 +end +n = add n ulong r +end +for i ulong 4 +if not parsenum n +ret 65 +end +end +checknum eq get V 0 8 +checknum eq get V 1 74 +checknum eq get V 2 1024 +checknum eq get V 3 0 +p = get Pos 0 +checknum eq n add p 1024 +for rec ulong 7 +for i ulong 8 +sbyte add p i get Mag i +end +size = shead add p 32 +checknum le size 8192 +p = add add p 40 size +end +checknum eq p add get Pos 0 923 +remain = sub n p +checknum eq remain 101 +for i ulong 8 +sbyte add p i get Mag i +end +checknum eq shead add p 8 3 +checknum eq shead add p 16 3 +checknum eq shead add p 24 0 +checknum eq shead add p 32 71 +checknum eq get Checks 0 82 +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L748/independent-review/probes/provider.om b/evidence/allen-omega-L694/L748/independent-review/probes/provider.om new file mode 100644 index 00000000..69a14d40 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/probes/provider.om @@ -0,0 +1,3752 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +note Native Linux stdin/stdout provider-stream entry. No fake clock or transport. +fn prreadhead to int +p = ulong 0 +while lt p 40 +n = read 0 Ph p sub ulong 40 p +if lt n 0 +ret 74 +end +if eq n 0 +if eq p 0 +ret 0 +end +ret 65 +end +p = add p ulong n +end +ret 1 +end +fn prreadbody to int +p = ulong 0 +size = get Pv 3 +while lt p size +n = read 0 Pb p sub size p +if lt n 0 +ret 74 +end +if eq n 0 +ret 65 +end +p = add p ulong n +end +ret 0 +end +fn prwrite to bool +p = ulong 0 +while lt p get Pn 0 +n = write 1 Pout p sub get Pn 0 p +if le n 0 +ret false +end +p = add p ulong n +end +ret true +end +fn main to int +constants +while true +status = prreadhead +if eq status 0 +ret 0 +end +if ne status 1 +ret status +end +if not prparse +ret 65 +end +status = prreadbody +if ne status 0 +ret status +end +if not prdo +ret 65 +end +if not prwrite +ret 74 +end +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/SHA256SUMS.pre-report b/evidence/allen-omega-L694/L748/independent-review/raw/SHA256SUMS.pre-report new file mode 100644 index 00000000..0079f00e --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/SHA256SUMS.pre-report @@ -0,0 +1,47 @@ +149c86c580d055212b030f15223efbf61fc77e941cd3026a329d98f04373e797 /home/drakestapleton/handoffs/L753-review/raw/application-numbered.txt +c60310ca34301e81cef053e9ba376ac7dd7f064f0c5a829d29b60caece99e67a /home/drakestapleton/handoffs/L753-review/raw/builds-final.sha256 +e1143e9516dc5614a94515370c20655a46f9000fd9aed19f08662d45a0e623bd /home/drakestapleton/handoffs/L753-review/raw/builds.sha256 +41cfc578c1aa995e9b8ff0547c18acd2d9d2816680b57b0da1ba613b133d4cf4 /home/drakestapleton/handoffs/L753-review/raw/compiler.sha256 +2d9a3c4c37f3234249719134d11aff790623b930e838c0cdca311745e3cc8702 /home/drakestapleton/handoffs/L753-review/raw/context-restore-numbered.txt +3d59cfaef014da864a760771938fa0847da539f5946816136ff4721931c1a4b9 /home/drakestapleton/handoffs/L753-review/raw/focused-inputs.sha256 +671c5d51da86d0554bb6d242f145b51bb22fd520177e45fbeef200a02e04863f /home/drakestapleton/handoffs/L753-review/raw/git-source.paths +d70c344115f1aac0b1ecbf348f3298cc1975331634b9a41be196d5c1b59acf33 /home/drakestapleton/handoffs/L753-review/raw/memory-restore-numbered.txt +7d931199f90a0d238d58c2d9abac45df4520ac9f2ef396504e136b9d503b17d5 /home/drakestapleton/handoffs/L753-review/raw/pins.txt +4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865 /home/drakestapleton/handoffs/L753-review/raw/provider-boundary.exit +9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa /home/drakestapleton/handoffs/L753-review/raw/provider-boundary-final.exit +69318135260b334c2b4e28c0dcde808e8ea649fab689b7ce9dc6a61aa1effdc4 /home/drakestapleton/handoffs/L753-review/raw/provider-boundary-final.log +3bfa0432504c94ba21aaf265f73af49ada07d4bc484ef2fa3a809f68cc9749ce /home/drakestapleton/handoffs/L753-review/raw/provider-boundary.log +9a6f0211f12d0930331efa31d7bf65dcbf2a4c71c55d101e1df4077cd3d71db4 /home/drakestapleton/handoffs/L753-review/raw/provider-core.exit +fbfe365c7485671f3c8e0ccf480be062034b65360b2005530c258e1577aaec04 /home/drakestapleton/handoffs/L753-review/raw/provider-core.log +4b6fcafad2946e37eb832da122176742047661874351d7151658885d3fc8e472 /home/drakestapleton/handoffs/L753-review/raw/provider-core-numbered.txt +763921ec6cbbfbe18891cc29b474ee14cfb20851846b6ef6bd5757d65540b90b /home/drakestapleton/handoffs/L753-review/raw/provider.elf.txt +f96657de953a7827768f2a62851b8830926c2f1a556a72272654742125c4f48f /home/drakestapleton/handoffs/L753-review/raw/provider-entry-numbered.txt +e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 /home/drakestapleton/handoffs/L753-review/raw/provider-eof.err +9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa /home/drakestapleton/handoffs/L753-review/raw/provider-eof.exit +e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 /home/drakestapleton/handoffs/L753-review/raw/provider-eof.out +9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa /home/drakestapleton/handoffs/L753-review/raw/provider-fragment.check.exit +49c437a2551e71a10bc26bc969f55103611991adea98696503cbdb8e686d1ba3 /home/drakestapleton/handoffs/L753-review/raw/provider-fragment.check.log +9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa /home/drakestapleton/handoffs/L753-review/raw/provider-fragment.exit +7902699be42c8a8e46fbbb4501726517e86b22c56a189f7625a6da49081b2451 /home/drakestapleton/handoffs/L753-review/raw/provider-fragment.mode +94a3fc4b05bef182b4d33e6adf875bf638f89b01315ea1081da0cbdb950a6ac0 /home/drakestapleton/handoffs/L753-review/raw/provider-fragment.output +e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 /home/drakestapleton/handoffs/L753-review/raw/provider-fragment-producer.err +9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa /home/drakestapleton/handoffs/L753-review/raw/provider-fragment-producer.exit +e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 /home/drakestapleton/handoffs/L753-review/raw/provider-fragment.stderr +718fa4fce2aafd2d658e1d7a776ed8ca22b23bbbc616a28ed74aac5b787e55fb /home/drakestapleton/handoffs/L753-review/raw/provider-fragment.strace +93a73825c1b761d11bf2b3f4dff760d07888d3fde05dcf55f1da84aa6041a5a8 /home/drakestapleton/handoffs/L753-review/raw/provider-full.exit +e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 /home/drakestapleton/handoffs/L753-review/raw/provider-full.stderr +9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa /home/drakestapleton/handoffs/L753-review/raw/provider-normal.check.exit +49c437a2551e71a10bc26bc969f55103611991adea98696503cbdb8e686d1ba3 /home/drakestapleton/handoffs/L753-review/raw/provider-normal.check.log +520bdb2f475e7ff86edfd6618b04d672c6a9b90ce09e4f249e3c615078855867 /home/drakestapleton/handoffs/L753-review/raw/provider-normal.input +94a3fc4b05bef182b4d33e6adf875bf638f89b01315ea1081da0cbdb950a6ac0 /home/drakestapleton/handoffs/L753-review/raw/provider-normal.output +e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 /home/drakestapleton/handoffs/L753-review/raw/provider-normal-producer.err +e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 /home/drakestapleton/handoffs/L753-review/raw/provider-normal.stderr +4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865 /home/drakestapleton/handoffs/L753-review/raw/provider-partial-write-check.exit +9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa /home/drakestapleton/handoffs/L753-review/raw/provider-partial-write-check-final.exit +247f163efbac7aca478706f7ba00072b808450055e6ba819208f1d20a41a1f50 /home/drakestapleton/handoffs/L753-review/raw/provider-partial-write-check-final.log +5458fb305ce1bed0daf4a87e2afe15dffa92d34e239d90ec4db99cd8f7bbdc05 /home/drakestapleton/handoffs/L753-review/raw/provider-partial-write-check.log +93a73825c1b761d11bf2b3f4dff760d07888d3fde05dcf55f1da84aa6041a5a8 /home/drakestapleton/handoffs/L753-review/raw/provider-partial-write.exit +c9d6ffd3da9f61111b290c837735758566f93a95f203467268e3cc70e2b84a01 /home/drakestapleton/handoffs/L753-review/raw/provider-partial-write.output +93e3aee03715093b7cbf8b04c9c6f7355739cff5e33cdecb2df16893020e4b40 /home/drakestapleton/handoffs/L753-review/raw/provider-partial-write.receipt +e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 /home/drakestapleton/handoffs/L753-review/raw/provider-partial-write.stderr +310c498a976ca7397be904709499cad567c341e35d39ddd9ed9df81d148c5903 /home/drakestapleton/handoffs/L753-review/raw/provider-partial-write.strace diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/application-numbered.txt b/evidence/allen-omega-L694/L748/independent-review/raw/application-numbered.txt new file mode 100644 index 00000000..71754bfa --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/application-numbered.txt @@ -0,0 +1,241 @@ + 1 note Native application binding: conversation state, courier lifecycle and reply/code. + 2 note A initialized, queued AGAIN bytes, per-call event, reserved. + 3 note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, + 4 note 4 refused LINE payload,5 slow notice,6 silence timeout. + 5 note Transport acceptance is separate from payload acceptance: appreceive true + 6 note means envelope accepted; inspect A2 for malformed payload, never invent text. + 7 global A ulong 4 + 8 global Appjob uchar 4096 + 9 global Appwire uchar 8192 + 10 global Askin uchar 160 + 11 fn appinit run ulong now ulong to bool + 12 if or ne get A 0 0 ne get R 0 0 + 13 ret false + 14 end + 15 if ne get Q 0 0 + 16 ret false + 17 end + 18 if not qstart run now + 19 ret false + 20 end + 21 constants + 22 put A 0 1 + 23 put A 1 0 + 24 put A 2 0 + 25 ret true + 26 end + 27 fn appclock now ulong to bool + 28 if eq get A 0 0 + 29 ret false + 30 end + 31 ret and ge now get T 0 ge now get R 4 + 32 end + 33 fn appask now ulong to bool + 34 if not appclock now + 35 ret false + 36 end + 37 if or ne get R 1 0 ne get A 1 0 + 38 ret false + 39 end + 40 if or ne get T 10 0 ne get T 13 0 + 41 ret false + 42 end + 43 if and ne get T 5 0 eq get T 6 0 + 44 ret false + 45 end + 46 if or ge get R 0 4294967295 ge get Q 1 4294967295 + 47 ret false + 48 end + 49 if not textok + 50 ret false + 51 end + 52 kind = classify + 53 if or lt kind 1 gt kind 3 + 54 ret false + 55 end + 56 if and eq kind 3 eq get R 6 0 + 57 ret false + 58 end + 59 note Validate restored context before jobbuild reads its variable-layout names. + 60 if not ctxmeta 6 + 61 ret false + 62 end + 63 if not jobbuild kind add get R 0 1 + 64 ret false + 65 end + 66 if not ctxappend + 67 ret false + 68 end + 69 n = get Inlen 0 + 70 size = get Outlen 0 + 71 for i ulong n + 72 put Askin i get In i + 73 end + 74 for i ulong size + 75 put Appjob i get Outb i + 76 end + 77 for i ulong size + 78 put In i get Appjob i + 79 end + 80 put Inlen 0 size + 81 queued = qsubmit now + 82 for i ulong n + 83 put In i get Askin i + 84 end + 85 put Inlen 0 n + 86 if not queued + 87 ret false + 88 end + 89 note start preconditions were checked before qsubmit; no concurrent calls permitted. + 90 if not start kind now + 91 qcancel + 92 ret false + 93 end + 94 put A 2 0 + 95 if gt kind 1 + 96 codebeg get R 0 + 97 put A 2 1 + 98 end + 99 ret true + 100 end + 101 fn appcancel to void + 102 cancel + 103 qcancel + 104 put A 1 0 + 105 put A 2 0 + 106 end + 107 fn appreset to void + 108 appcancel + 109 reset + 110 end + 111 note First acknowledge the triggering LINE, then submit AGAIN with a new wire + 112 note sequence while retaining the original conversation ID in its body. + 113 fn appqueue now ulong to bool + 114 if eq get A 1 0 + 115 ret true + 116 end + 117 if or ne get T 10 0 ne get T 13 0 + 118 ret true + 119 end + 120 put Inlen 0 get A 1 + 121 for i ulong get A 1 + 122 put In i get Appjob i + 123 end + 124 if not qsubmit now + 125 ret false + 126 end + 127 put A 1 0 + 128 ret true + 129 end + 130 fn apppoll now ulong link bool to bool + 131 if not appclock now + 132 ret false + 133 end + 134 put A 2 0 + 135 put T 0 now + 136 status = tick now + 137 if eq status 1 + 138 put A 2 5 + 139 end + 140 if eq status 2 + 141 qcancel + 142 put A 1 0 + 143 put A 2 6 + 144 end + 145 if not appqueue now + 146 appcancel + 147 put A 2 3 + 148 ret false + 149 end + 150 ret qnext now link + 151 end + 152 fn appsent now ulong ok bool to bool + 153 if not appclock now + 154 ret false + 155 end + 156 if not qsent now ok + 157 ret false + 158 end + 159 put A 2 0 + 160 ret true + 161 end + 162 fn appbody now ulong to bool + 163 if eq get R 1 0 + 164 put A 2 4 + 165 ret true + 166 end + 167 if ineq 0 67 + 168 if or le get R 2 1 ne get C 0 get R 0 + 169 put A 2 4 + 170 ret true + 171 end + 172 if codetake + 173 if heard get C 0 now + 174 ret true + 175 end + 176 end + 177 put A 2 4 + 178 ret true + 179 end + 180 if or ineq 0 83 ineq 0 87 + 181 status = saytake now + 182 if eq status 1 + 183 if eq get R 1 0 + 184 put A 1 0 + 185 end + 186 if ne get S 1 0 + 187 put A 2 1 + 188 end + 189 ret true + 190 end + 191 if eq status 2 + 192 n = get Outlen 0 + 193 if or eq n 0 gt n 4096 + 194 cancel + 195 put A 1 0 + 196 put A 2 3 + 197 ret true + 198 end + 199 for i ulong n + 200 put Appjob i get Outb i + 201 end + 202 put A 1 n + 203 put A 2 2 + 204 ret true + 205 end + 206 if eq status 3 + 207 put A 1 0 + 208 put A 2 3 + 209 ret true + 210 end + 211 end + 212 put A 2 4 + 213 ret true + 214 end + 215 note Reply parsing can serialize AGAIN internally. Preserve the already offered + 216 note datagram until the provider records its send result, including on refusal. + 217 fn appreceive now ulong to bool + 218 if not appclock now + 219 ret false + 220 end + 221 result = qincoming now + 222 if eq result 0 + 223 ret false + 224 end + 225 put A 2 0 + 226 if not qtake + 227 ret true + 228 end + 229 n = get Outlen 0 + 230 e = get Err 0 + 231 for i ulong n + 232 put Appwire i get Outb i + 233 end + 234 ok = appbody now + 235 for i ulong n + 236 put Outb i get Appwire i + 237 end + 238 put Outlen 0 n + 239 put Err 0 e + 240 ret ok + 241 end diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/builds-final.sha256 b/evidence/allen-omega-L694/L748/independent-review/raw/builds-final.sha256 new file mode 100644 index 00000000..c15400d5 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/builds-final.sha256 @@ -0,0 +1,8 @@ +c9367d4cbc9261ebc0faaf3a99c2988ee36abda197670d868bd202a3bb19cccd /home/drakestapleton/handoffs/L753-review/build/provider +49085d1c4e23dcd67fd89df63a711ccd57adfac88e2fd83f84c6ab9982abcaee /home/drakestapleton/handoffs/L753-review/build/provider-core-test +8eeda9f344c1c28f6e05308acbeb243ea8ee74e29e290e45b746e20cd5873e24 /home/drakestapleton/handoffs/L753-review/build/provider-output-test +f27b24582f22767dbf7eb3f9e8b5d06b0f37f54371e91dec125ee7544f65d259 /home/drakestapleton/handoffs/L753-review/build/provider-process-test +2bac15d89211b6fee18d7bfe7d17bc087151180ae4ed90b6c641e967ac6a8ec7 /home/drakestapleton/handoffs/L753-review/build/provider-boundary-test-final2 +8801a190bb476d2d1b108d0ef511e27f3b2814d91e486820e5265f675ff7d497 /home/drakestapleton/handoffs/L753-review/build/provider-semantic-input-test-v4 +a68d9aed28deaf4ba38987294df52b840bd34998132853ee9e265580c62d5472 /home/drakestapleton/handoffs/L753-review/build/provider-semantic-output-test-final3 +e35924cdb3da915ae919b4addefade4b702202655e1ea3c320b4835631ba22b0 /home/drakestapleton/handoffs/L753-review/build/provider-input-test diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/builds.sha256 b/evidence/allen-omega-L694/L748/independent-review/raw/builds.sha256 new file mode 100644 index 00000000..d9aacfd7 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/builds.sha256 @@ -0,0 +1,7 @@ +c9367d4cbc9261ebc0faaf3a99c2988ee36abda197670d868bd202a3bb19cccd /home/drakestapleton/handoffs/L753-review/build/provider +49085d1c4e23dcd67fd89df63a711ccd57adfac88e2fd83f84c6ab9982abcaee /home/drakestapleton/handoffs/L753-review/build/provider-core-test +8eeda9f344c1c28f6e05308acbeb243ea8ee74e29e290e45b746e20cd5873e24 /home/drakestapleton/handoffs/L753-review/build/provider-output-test +f27b24582f22767dbf7eb3f9e8b5d06b0f37f54371e91dec125ee7544f65d259 /home/drakestapleton/handoffs/L753-review/build/provider-process-test +d4881950daa1e6039ec6aa84c684659361e801c35109bda66468a175041609d3 /home/drakestapleton/handoffs/L753-review/build/provider-boundary-test-v3 +75a8cca0a568f268e617c4a3131e71cc9967aa9e4f0b7495d0487cd60a4802fd /home/drakestapleton/handoffs/L753-review/build/provider-boundary-test-final +2bac15d89211b6fee18d7bfe7d17bc087151180ae4ed90b6c641e967ac6a8ec7 /home/drakestapleton/handoffs/L753-review/build/provider-boundary-test-final2 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/compiler.sha256 b/evidence/allen-omega-L694/L748/independent-review/raw/compiler.sha256 new file mode 100644 index 00000000..50e79ea9 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/compiler.sha256 @@ -0,0 +1 @@ +191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9 /home/drakestapleton/handoffs/allen-omega-L694/omc diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/context-restore-numbered.txt b/evidence/allen-omega-L694/L748/independent-review/raw/context-restore-numbered.txt new file mode 100644 index 00000000..27f8038b --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/context-restore-numbered.txt @@ -0,0 +1,100 @@ + 1 note Restored note catalog and bounded model-job context. No storage provider. + 2 note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. + 3 global Cx ulong 5 + 4 global Ctxtext uchar 65536 + 5 global Ctxlen ulong 512 + 6 global Ctxgone uchar 512 + 7 global Ctxseen uchar 512 + 8 global Ctxstart ulong 512 + 9 global Meta uchar 4096 + 10 global Mx ulong 2 + 11 global Mdigits uchar 20 + 12 text Mtself "\tself=" + 13 text Mtname "\tname=" + 14 text Mtstart "\tstarts=" + 15 text Mtfact "\tfact " + 16 text Mtis " is " + 17 text Mtare " are " + 18 text Mtnote "\tnote " + 19 fn ctxidle to bool + 20 if ne get R 1 0 + 21 ret false + 22 end + 23 ret and eq get Tx 0 0 eq get Nt 0 0 + 24 end + 25 fn ctxbegin to bool + 26 if not ctxidle + 27 ret false + 28 end + 29 n = mem32 36 + 30 if gt n 512 + 31 ret false + 32 end + 33 for i ulong 512 + 34 put Ctxlen i 0 + 35 put Ctxgone i 1 + 36 put Ctxseen i 0 + 37 put Ctxstart i 0 + 38 end + 39 put Cx 0 n + 40 put Cx 1 0 + 41 put Cx 2 0 + 42 put Cx 3 0 + 43 put Cx 4 1 + 44 if eq n 0 + 45 put Cx 2 1 + 46 put Cx 4 0 + 47 end + 48 ret true + 49 end + 50 note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. + 51 fn ctxtake index ulong to ulong + 52 if not ctxidle + 53 ret 0 + 54 end + 55 if or eq get Cx 4 0 ge index get Cx 0 + 56 ret 0 + 57 end + 58 if ne get Ctxseen index 0 + 59 ret 0 + 60 end + 61 status = ulong 2 + 62 if notedec index + 63 n = get Ns 0 + 64 for i ulong n + 65 put Ctxtext add mul index 128 i get Note i + 66 end + 67 put Ctxlen index n + 68 put Ctxgone index uchar get Ns 3 + 69 put Ctxstart index get Ns 2 + 70 status = 1 + 71 else + 72 put Cx 3 add get Cx 3 1 + 73 end + 74 put Ctxseen index 1 + 75 put Cx 1 add get Cx 1 1 + 76 if eq get Cx 1 get Cx 0 + 77 put Cx 2 1 + 78 put Cx 4 0 + 79 end + 80 ret status + 81 end + 82 fn mtemit c uchar to void + 83 if ne get Mx 1 0 + 84 ret + 85 end + 86 n = get Mx 0 + 87 if ge n 4096 + 88 put Mx 1 1 + 89 ret + 90 end + 91 put Meta n c + 92 put Mx 0 add n 1 + 93 end + 94 fn mtnum v ulong to void + 95 n = ulong 0 + 96 while gt v 9 + 97 put Mdigits n uchar rem v 10 + 98 v = div v 10 + 99 n = add n 1 + 100 end diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/invalid-time.exit b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/invalid-time.exit new file mode 100644 index 00000000..1479e19b --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/invalid-time.exit @@ -0,0 +1 @@ +65 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/invalid-time.input b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/invalid-time.input new file mode 100644 index 00000000..92df4c82 Binary files /dev/null and b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/invalid-time.input differ diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/invalid-time.output b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/invalid-time.output new file mode 100644 index 00000000..97d5bdec Binary files /dev/null and b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/invalid-time.output differ diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/invalid-time.stderr b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/invalid-time.stderr new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/missing-entry.compile.exit b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/missing-entry.compile.exit new file mode 100644 index 00000000..7ed6ff82 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/missing-entry.compile.exit @@ -0,0 +1 @@ +5 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/missing-entry.compile.log b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/missing-entry.compile.log new file mode 100644 index 00000000..6d9c96b4 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/missing-entry.compile.log @@ -0,0 +1 @@ +omc: line 3: error 5 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-boundary-missing-entry b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-boundary-missing-entry new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-boundary-missing-entry.om b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-boundary-missing-entry.om new file mode 100644 index 00000000..00fb0cbe --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-boundary-missing-entry.om @@ -0,0 +1,72 @@ +text Bmagic "ALNPRV01" +fn btest ok bool to void +check ok add get Checks 0 1 +end +fn bword off ulong v ulong to void +for i ulong 8 +put Ph add off i uchar and shr v mul i 8 255 +end +end +fn bframe op ulong now ulong arg ulong size ulong to void +for i ulong 8 +put Ph i get Bmagic i +end +bword 8 op +bword 16 now +bword 24 arg +bword 32 size +end +fn bmain to int +bframe 1 sub ulong 0 1 1 0 +btest prparse +btest eq get Pv 1 sub ulong 0 1 +bframe 1 shl ulong 1 63 sub ulong 0 1 0 +btest prparse +btest eq get Pv 1 shl ulong 1 63 +btest eq get Pv 2 sub ulong 0 1 +bframe sub ulong 0 1 0 0 0 +btest not prparse +bframe 2 0 0 0 +btest not prparse +bframe 2 0 0 1 +btest prparse +bframe 2 0 0 159 +btest prparse +bframe 2 0 0 160 +btest not prparse +bframe 5 0 0 64 +btest not prparse +bframe 5 0 0 65 +btest prparse +bframe 5 0 0 1200 +btest prparse +bframe 5 0 0 1201 +btest not prparse +bframe 8 0 0 4096 +btest prparse +bframe 8 0 1 4096 +btest prparse +bframe 8 0 2 4096 +btest not prparse +bframe 8 1 0 4096 +btest not prparse +bframe 9 0 0 4096 +btest prparse +bframe 9 0 511 4096 +btest prparse +bframe 9 0 512 4096 +btest not prparse +bframe 6 0 0 0 +btest prparse +bframe 6 1 0 0 +btest not prparse +bframe 7 0 1 0 +btest not prparse +bframe 10 0 0 0 +btest prparse +btest eq get Checks 0 25 +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-boundary-wrong-count-test b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-boundary-wrong-count-test new file mode 100755 index 00000000..57421f2f Binary files /dev/null and b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-boundary-wrong-count-test differ diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-boundary-wrong-count-test.om b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-boundary-wrong-count-test.om new file mode 100644 index 00000000..56647643 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-boundary-wrong-count-test.om @@ -0,0 +1,3771 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +text Bmagic "ALNPRV01" +fn btest ok bool to void +check ok add get Checks 0 1 +end +fn bword off ulong v ulong to void +for i ulong 8 +put Ph add off i uchar and shr v mul i 8 255 +end +end +fn bframe op ulong now ulong arg ulong size ulong to void +for i ulong 8 +put Ph i get Bmagic i +end +bword 8 op +bword 16 now +bword 24 arg +bword 32 size +end +fn main to int +bframe 1 sub ulong 0 1 1 0 +btest prparse +btest eq get Pv 1 sub ulong 0 1 +bframe 1 shl ulong 1 63 sub ulong 0 1 0 +btest prparse +btest eq get Pv 1 shl ulong 1 63 +btest eq get Pv 2 sub ulong 0 1 +bframe sub ulong 0 1 0 0 0 +btest not prparse +bframe 2 0 0 0 +btest not prparse +bframe 2 0 0 1 +btest prparse +bframe 2 0 0 159 +btest prparse +bframe 2 0 0 160 +btest not prparse +bframe 5 0 0 64 +btest not prparse +bframe 5 0 0 65 +btest prparse +bframe 5 0 0 1200 +btest prparse +bframe 5 0 0 1201 +btest not prparse +bframe 8 0 0 4096 +btest prparse +bframe 8 0 1 4096 +btest prparse +bframe 8 0 2 4096 +btest not prparse +bframe 8 1 0 4096 +btest not prparse +bframe 9 0 0 4096 +btest prparse +bframe 9 0 511 4096 +btest prparse +bframe 9 0 512 4096 +btest not prparse +bframe 6 0 0 0 +btest prparse +bframe 6 1 0 0 +btest not prparse +bframe 7 0 1 0 +btest not prparse +bframe 10 0 0 0 +btest prparse +btest eq get Checks 0 26 +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-boundary-wrong-count.om b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-boundary-wrong-count.om new file mode 100644 index 00000000..6bff1651 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-boundary-wrong-count.om @@ -0,0 +1,72 @@ +text Bmagic "ALNPRV01" +fn btest ok bool to void +check ok add get Checks 0 1 +end +fn bword off ulong v ulong to void +for i ulong 8 +put Ph add off i uchar and shr v mul i 8 255 +end +end +fn bframe op ulong now ulong arg ulong size ulong to void +for i ulong 8 +put Ph i get Bmagic i +end +bword 8 op +bword 16 now +bword 24 arg +bword 32 size +end +fn main to int +bframe 1 sub ulong 0 1 1 0 +btest prparse +btest eq get Pv 1 sub ulong 0 1 +bframe 1 shl ulong 1 63 sub ulong 0 1 0 +btest prparse +btest eq get Pv 1 shl ulong 1 63 +btest eq get Pv 2 sub ulong 0 1 +bframe sub ulong 0 1 0 0 0 +btest not prparse +bframe 2 0 0 0 +btest not prparse +bframe 2 0 0 1 +btest prparse +bframe 2 0 0 159 +btest prparse +bframe 2 0 0 160 +btest not prparse +bframe 5 0 0 64 +btest not prparse +bframe 5 0 0 65 +btest prparse +bframe 5 0 0 1200 +btest prparse +bframe 5 0 0 1201 +btest not prparse +bframe 8 0 0 4096 +btest prparse +bframe 8 0 1 4096 +btest prparse +bframe 8 0 2 4096 +btest not prparse +bframe 8 1 0 4096 +btest not prparse +bframe 9 0 0 4096 +btest prparse +bframe 9 0 511 4096 +btest prparse +bframe 9 0 512 4096 +btest not prparse +bframe 6 0 0 0 +btest prparse +bframe 6 1 0 0 +btest not prparse +bframe 7 0 1 0 +btest not prparse +bframe 10 0 0 0 +btest prparse +btest eq get Checks 0 26 +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-semantic-invalid-time-test b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-semantic-invalid-time-test new file mode 100755 index 00000000..afc17e4d Binary files /dev/null and b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-semantic-invalid-time-test differ diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-semantic-invalid-time-test.om b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-semantic-invalid-time-test.om new file mode 100644 index 00000000..c028a9ad --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-semantic-invalid-time-test.om @@ -0,0 +1,3743 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +text Smagic "ALNPRV01" +global Sh uchar 40 +fn sword off ulong v ulong to void +for i ulong 8 +put Sh add off i uchar and shr v mul i 8 255 +end +end +fn shead op ulong now ulong arg ulong size ulong to void +for i ulong 8 +put Sh i get Smagic i +end +sword 8 op +sword 16 now +sword 24 arg +sword 32 size +end +fn swrite n ulong to bool +at = ulong 0 +while lt at n +left = sub n at +r = write 1 Sh at left +if le r 0 +ret false +end +at = add at ulong r +end +ret true +end +fn frame op ulong now ulong arg ulong size ulong to bool +shead op now arg size +ret swrite 40 +end +fn main to int +if not frame 1 1 77 0 +ret 74 +end +if not frame 1 2 78 0 +ret 74 +end +if not frame 6 3 0 0 +ret 74 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-semantic-invalid-time.om b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-semantic-invalid-time.om new file mode 100644 index 00000000..daac0e70 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/provider-semantic-invalid-time.om @@ -0,0 +1,44 @@ +text Smagic "ALNPRV01" +global Sh uchar 40 +fn sword off ulong v ulong to void +for i ulong 8 +put Sh add off i uchar and shr v mul i 8 255 +end +end +fn shead op ulong now ulong arg ulong size ulong to void +for i ulong 8 +put Sh i get Smagic i +end +sword 8 op +sword 16 now +sword 24 arg +sword 32 size +end +fn swrite n ulong to bool +at = ulong 0 +while lt at n +left = sub n at +r = write 1 Sh at left +if le r 0 +ret false +end +at = add at ulong r +end +ret true +end +fn frame op ulong now ulong arg ulong size ulong to bool +shead op now arg size +ret swrite 40 +end +fn main to int +if not frame 1 1 77 0 +ret 74 +end +if not frame 1 2 78 0 +ret 74 +end +if not frame 6 3 0 0 +ret 74 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/wrong-count.exit b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/wrong-count.exit new file mode 100644 index 00000000..d00491fd --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/wrong-count.exit @@ -0,0 +1 @@ +1 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/wrong-count.log b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/wrong-count.log new file mode 100644 index 00000000..0f55b086 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/failed-probes/wrong-count.log @@ -0,0 +1,26 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 1 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/focused-inputs.sha256 b/evidence/allen-omega-L694/L748/independent-review/raw/focused-inputs.sha256 new file mode 100644 index 00000000..6ce8096a --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/focused-inputs.sha256 @@ -0,0 +1,6 @@ +330b31b81a60f3dc553b87316d2fa1c3df9106af5fe7975911ba00b8c356f626 /home/drakestapleton/handoffs/L753-review/source/native/omega/allen/provider-core.om +ef0d5dcc14b68bf4ee24468db703fd7dc98ffd982e045c719d42a78e442546ba /home/drakestapleton/handoffs/L753-review/source/native/omega/allen/provider.om +4b942849652c81ee775b6089e2696c059de934d7fd0ff2a81ae380b2b39ffbfe /home/drakestapleton/handoffs/L753-review/source/native/omega/allen/tests/provider-core.om +b98923bd7df278ed0cd8a46c90d90fda296e27c8d60afdd4848ed86dba8221cc /home/drakestapleton/handoffs/L753-review/source/native/omega/allen/tests/provider-input.om +d1b1338b2cabe207c1cd9a4bd92b11f51502c29af4b754e2b39fac06d80b28ed /home/drakestapleton/handoffs/L753-review/source/native/omega/allen/tests/provider-output.om +8616252944ac2f2903427a6cbf165137087addf3eff169f05f6801d38dac0962 /home/drakestapleton/handoffs/L753-review/source/native/omega/allen/tests/provider-process.om diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/git-source.paths b/evidence/allen-omega-L694/L748/independent-review/raw/git-source.paths new file mode 100644 index 00000000..ace3a725 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/git-source.paths @@ -0,0 +1,51 @@ +native/omega/allen/application.om +native/omega/allen/base.om +native/omega/allen/build-one.sh +native/omega/allen/code.om +native/omega/allen/context.om +native/omega/allen/courier.om +native/omega/allen/gate.sh +native/omega/allen/golden.sh +native/omega/allen/intent.om +native/omega/allen/main.om +native/omega/allen/memory.om +native/omega/allen/paint.om +native/omega/allen/provider-core.om +native/omega/allen/PROVIDER.md +native/omega/allen/provider.om +native/omega/allen/README.md +native/omega/allen/reply.om +native/omega/allen/runtime.om +native/omega/allen/scene-input.om +native/omega/allen/scene.om +native/omega/allen/scheduler.om +native/omega/allen/tests/application.om +native/omega/allen/tests/check.om +native/omega/allen/tests/code.om +native/omega/allen/tests/context.om +native/omega/allen/tests/courier.om +native/omega/allen/tests/edges.om +native/omega/allen/tests/fixture.om +native/omega/allen/tests/golden.om +native/omega/allen/tests/intent.om +native/omega/allen/tests/memory.om +native/omega/allen/tests/paint.om +native/omega/allen/tests/probe.om +native/omega/allen/tests/provider-core.om +native/omega/allen/tests/provider-input.om +native/omega/allen/tests/provider-mutants.om +native/omega/allen/tests/provider-output.om +native/omega/allen/tests/provider-process.om +native/omega/allen/tests/render.om +native/omega/allen/tests/reply.om +native/omega/allen/tests/runtime.om +native/omega/allen/tests/scene-input.om +native/omega/allen/tests/scene.om +native/omega/allen/tests/scheduler.om +native/omega/allen/tests/stdio-overflow.om +native/omega/allen/tests/view.om +native/omega/allen/vendor/OMEGA-LICENSE +native/omega/allen/vendor/PROVENANCE.md +native/omega/allen/vendor/sha256-core.om +native/omega/allen/vendor/sha256.om +native/omega/allen/view.om diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/memory-restore-numbered.txt b/evidence/allen-omega-L694/L748/independent-review/raw/memory-restore-numbered.txt new file mode 100644 index 00000000..0ef6b59f --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/memory-restore-numbered.txt @@ -0,0 +1,51 @@ + 370 if lt get St 2 2 + 371 put St 2 add get St 2 1 + 372 end + 373 ret true + 374 end + 375 note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. + 376 fn loadbeg to void + 377 for i ulong 3 + 378 put St i 0 + 379 end + 380 put Load 0 0 + 381 end + 382 fn loadcopy slot ulong to bool + 383 if gt slot 1 + 384 ret false + 385 end + 386 if ne and get Load 0 shl ulong 1 slot 0 + 387 ret false + 388 end + 389 if not memvalid + 390 ret false + 391 end + 392 put Load 0 or get Load 0 shl ulong 1 slot + 393 put St 2 add get St 2 1 + 394 if gt get64 16 get St 0 + 395 b = memdec + 396 put St 0 get Md 0 + 397 put St 1 slot + 398 end + 399 ret true + 400 end + 401 note Note transaction completes before the parent copy may publish its count. + 402 fn nbegin to bool + 403 if or ne get Nt 0 0 ne get Tx 0 0 + 404 ret false + 405 end + 406 if not noteenc + 407 ret false + 408 end + 409 put Nt 1 get Ns 1 + 410 put Nt 0 1 + 411 ret true + 412 end + 413 fn nwrite ok bool to bool + 414 if ne get Nt 0 1 + 415 ret false + 416 end + 417 if not ok + 418 put Nt 0 0 + 419 ret false + 420 end diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/pins.txt b/evidence/allen-omega-L694/L748/independent-review/raw/pins.txt new file mode 100644 index 00000000..dff89471 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/pins.txt @@ -0,0 +1,2 @@ +pin=43eae848f0a44604b42378d9ea3170278b5f3f8f +base=be28deb21721f54fc46b5402076c7e8ac8fde151 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-boundary-final.exit b/evidence/allen-omega-L694/L748/independent-review/raw/provider-boundary-final.exit new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-boundary-final.exit @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-boundary-final.log b/evidence/allen-omega-L694/L748/independent-review/raw/provider-boundary-final.log new file mode 100644 index 00000000..4ef2f89c --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-boundary-final.log @@ -0,0 +1,26 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-boundary.exit b/evidence/allen-omega-L694/L748/independent-review/raw/provider-boundary.exit new file mode 100644 index 00000000..d00491fd --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-boundary.exit @@ -0,0 +1 @@ +1 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-boundary.log b/evidence/allen-omega-L694/L748/independent-review/raw/provider-boundary.log new file mode 100644 index 00000000..0f55b086 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-boundary.log @@ -0,0 +1,26 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 1 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-core-numbered.txt b/evidence/allen-omega-L694/L748/independent-review/raw/provider-core-numbered.txt new file mode 100644 index 00000000..a02b0400 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-core-numbered.txt @@ -0,0 +1,256 @@ + 1 note Host provider stream core. PROVIDER.md is the framing/state contract. + 2 global Ph uchar 40 + 3 global Pb uchar 4096 + 4 global Pv ulong 4 + 5 global Pc ulong 2 + 6 global Pe ulong 2 + 7 global Pout uchar 65536 + 8 global Pn ulong 1 + 9 text Prmagic "ALNPRV01" + 10 fn prshape to bool + 11 op = get Pv 0 + 12 now = get Pv 1 + 13 arg = get Pv 2 + 14 n = get Pv 3 + 15 if eq op 1 + 16 ret and gt arg 0 eq n 0 + 17 end + 18 if eq op 2 + 19 if ne arg 0 + 20 ret false + 21 end + 22 ret and gt n 0 le n 159 + 23 end + 24 if or eq op 3 eq op 4 + 25 ret and le arg 1 eq n 0 + 26 end + 27 if eq op 5 + 28 if ne arg 0 + 29 ret false + 30 end + 31 ret and ge n 65 le n 1200 + 32 end + 33 if ne now 0 + 34 ret false + 35 end + 36 if or eq op 6 eq op 7 + 37 ret and eq arg 0 eq n 0 + 38 end + 39 if eq op 8 + 40 ret and le arg 1 eq n 4096 + 41 end + 42 if eq op 9 + 43 ret and le arg 511 eq n 4096 + 44 end + 45 if eq op 10 + 46 ret and eq arg 0 eq n 0 + 47 end + 48 ret false + 49 end + 50 fn prparse to bool + 51 for i ulong 8 + 52 if ne get Ph i get Prmagic i + 53 ret false + 54 end + 55 end + 56 for k ulong 4 + 57 v = ulong 0 + 58 for i ulong 8 + 59 off = add add 8 mul k 8 i + 60 v = or v shl ulong get Ph off mul i 8 + 61 end + 62 put Pv k v + 63 end + 64 ret prshape + 65 end + 66 fn prbyte c uchar to void + 67 put Pout get Pn 0 c + 68 put Pn 0 add get Pn 0 1 + 69 end + 70 fn prword v ulong to void + 71 for i ulong 8 + 72 prbyte uchar and shr v mul i 8 255 + 73 end + 74 end + 75 fn prhead op ulong status ulong event ulong size ulong to void + 76 for i ulong 8 + 77 prbyte get Prmagic i + 78 end + 79 prword op + 80 prword status + 81 prword event + 82 prword size + 83 end + 84 fn prreply status ulong to void + 85 put Pn 0 0 + 86 kind = get Pe 1 + 87 size = ulong 0 + 88 if eq kind 1 + 89 size = get Outlen 0 + 90 end + 91 if eq kind 2 + 92 size = get R 8 + 93 end + 94 prhead get Pv 0 status get Pe 0 size + 95 for i ulong size + 96 if eq kind 1 + 97 prbyte get Outb i + 98 else + 99 prbyte get Answer i + 100 end + 101 end + 102 if eq kind 2 + 103 if and gt get R 2 1 eq get R 1 0 + 104 if and ne get R 6 0 eq codestat 2 + 105 prhead 11 1 1 get C 2 + 106 for i ulong get C 2 + 107 prbyte get Code i + 108 end + 109 end + 110 end + 111 end + 112 end + 113 fn prevent to void + 114 put Pe 0 get A 2 + 115 if eq get A 2 1 + 116 put Pe 1 2 + 117 end + 118 end + 119 fn prload to ulong + 120 if or ne get A 0 0 not ctxidle + 121 ret 0 + 122 end + 123 constants + 124 for i ulong 3692 + 125 put Mem i 0 + 126 end + 127 loadbeg + 128 b = ctxbegin + 129 put Pc 0 1 + 130 put Pc 1 0 + 131 ret 1 + 132 end + 133 fn prcopy to ulong + 134 if or ne get A 0 0 ne get Pc 0 1 + 135 ret 0 + 136 end + 137 if not ctxidle + 138 ret 0 + 139 end + 140 slot = get Pv 2 + 141 bit = shl ulong 1 slot + 142 if ne and get Pc 1 bit 0 + 143 ret 0 + 144 end + 145 for i ulong 4096 + 146 put Unit i get Pb i + 147 end + 148 status = ulong 2 + 149 if loadcopy slot + 150 status = 1 + 151 end + 152 put Pc 1 or get Pc 1 bit + 153 if eq get Pc 1 3 + 154 if not ctxbegin + 155 ret 0 + 156 end + 157 put Pc 0 2 + 158 if ne get Cx 2 0 + 159 put Pc 0 3 + 160 end + 161 end + 162 ret status + 163 end + 164 fn prnote to ulong + 165 if or ne get A 0 0 ne get Pc 0 2 + 166 ret 0 + 167 end + 168 if not ctxidle + 169 ret 0 + 170 end + 171 for i ulong 4096 + 172 put Unit i get Pb i + 173 end + 174 status = ctxtake get Pv 2 + 175 if ne get Cx 2 0 + 176 put Pc 0 3 + 177 end + 178 ret status + 179 end + 180 fn prapply to ulong + 181 op = get Pv 0 + 182 now = get Pv 1 + 183 arg = get Pv 2 + 184 if eq op 10 + 185 ret prload + 186 end + 187 if eq op 8 + 188 ret prcopy + 189 end + 190 if eq op 9 + 191 ret prnote + 192 end + 193 if eq op 1 + 194 if or eq get Pc 0 1 eq get Pc 0 2 + 195 ret 0 + 196 end + 197 if appinit arg now + 198 ret 1 + 199 end + 200 ret 0 + 201 end + 202 if eq get A 0 0 + 203 ret 0 + 204 end + 205 if eq op 6 + 206 appcancel + 207 ret 1 + 208 end + 209 if eq op 7 + 210 appreset + 211 ret 1 + 212 end + 213 if not appclock now + 214 ret 0 + 215 end + 216 if eq op 3 + 217 offer = apppoll now ne arg 0 + 218 prevent + 219 if offer + 220 put Pe 1 1 + 221 ret 3 + 222 end + 223 ret 1 + 224 end + 225 if eq op 4 + 226 if appsent now ne arg 0 + 227 ret 1 + 228 end + 229 ret 0 + 230 end + 231 for i ulong get Pv 3 + 232 put In i get Pb i + 233 end + 234 put Inlen 0 get Pv 3 + 235 if eq op 2 + 236 if not appask now + 237 ret 0 + 238 end + 239 else + 240 if not appreceive now + 241 ret 0 + 242 end + 243 end + 244 prevent + 245 ret 1 + 246 end + 247 fn prdo to bool + 248 if not prparse + 249 ret false + 250 end + 251 put Pe 0 0 + 252 put Pe 1 0 + 253 status = prapply + 254 prreply status + 255 ret true + 256 end diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-core.exit b/evidence/allen-omega-L694/L748/independent-review/raw/provider-core.exit new file mode 100644 index 00000000..22adbfd2 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-core.exit @@ -0,0 +1 @@ +provider-core exit=0 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-core.log b/evidence/allen-omega-L694/L748/independent-review/raw/provider-core.log new file mode 100644 index 00000000..88d1b135 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-core.log @@ -0,0 +1,100 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-entry-numbered.txt b/evidence/allen-omega-L694/L748/independent-review/raw/provider-entry-numbered.txt new file mode 100644 index 00000000..485e09a5 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-entry-numbered.txt @@ -0,0 +1,70 @@ + 1 note Native Linux stdin/stdout provider-stream entry. No fake clock or transport. + 2 fn prreadhead to int + 3 p = ulong 0 + 4 while lt p 40 + 5 n = read 0 Ph p sub ulong 40 p + 6 if lt n 0 + 7 ret 74 + 8 end + 9 if eq n 0 + 10 if eq p 0 + 11 ret 0 + 12 end + 13 ret 65 + 14 end + 15 p = add p ulong n + 16 end + 17 ret 1 + 18 end + 19 fn prreadbody to int + 20 p = ulong 0 + 21 size = get Pv 3 + 22 while lt p size + 23 n = read 0 Pb p sub size p + 24 if lt n 0 + 25 ret 74 + 26 end + 27 if eq n 0 + 28 ret 65 + 29 end + 30 p = add p ulong n + 31 end + 32 ret 0 + 33 end + 34 fn prwrite to bool + 35 p = ulong 0 + 36 while lt p get Pn 0 + 37 n = write 1 Pout p sub get Pn 0 p + 38 if le n 0 + 39 ret false + 40 end + 41 p = add p ulong n + 42 end + 43 ret true + 44 end + 45 fn main to int + 46 constants + 47 while true + 48 status = prreadhead + 49 if eq status 0 + 50 ret 0 + 51 end + 52 if ne status 1 + 53 ret status + 54 end + 55 if not prparse + 56 ret 65 + 57 end + 58 status = prreadbody + 59 if ne status 0 + 60 ret status + 61 end + 62 if not prdo + 63 ret 65 + 64 end + 65 if not prwrite + 66 ret 74 + 67 end + 68 end + 69 ret 0 + 70 end diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-eof.err b/evidence/allen-omega-L694/L748/independent-review/raw/provider-eof.err new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-eof.exit b/evidence/allen-omega-L694/L748/independent-review/raw/provider-eof.exit new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-eof.exit @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-eof.out b/evidence/allen-omega-L694/L748/independent-review/raw/provider-eof.out new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment-producer.err b/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment-producer.err new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment-producer.exit b/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment-producer.exit new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment-producer.exit @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment.check.exit b/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment.check.exit new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment.check.exit @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment.check.log b/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment.check.log new file mode 100644 index 00000000..d91084d1 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment.check.log @@ -0,0 +1,292 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 +183 0 +184 0 +185 0 +186 0 +187 0 +188 0 +189 0 +190 0 +191 0 +192 0 +193 0 +194 0 +195 0 +196 0 +197 0 +198 0 +199 0 +200 0 +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 +225 0 +226 0 +227 0 +228 0 +229 0 +230 0 +231 0 +232 0 +233 0 +234 0 +235 0 +236 0 +237 0 +238 0 +239 0 +240 0 +241 0 +242 0 +243 0 +244 0 +245 0 +246 0 +247 0 +248 0 +249 0 +250 0 +251 0 +252 0 +253 0 +254 0 +255 0 +256 0 +257 0 +258 0 +259 0 +260 0 +261 0 +262 0 +263 0 +264 0 +265 0 +266 0 +267 0 +268 0 +269 0 +270 0 +271 0 +272 0 +273 0 +274 0 +275 0 +276 0 +277 0 +278 0 +279 0 +280 0 +281 0 +282 0 +283 0 +284 0 +285 0 +286 0 +287 0 +288 0 +289 0 +290 0 +291 0 +292 0 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment.exit b/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment.exit new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment.exit @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment.mode b/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment.mode new file mode 100644 index 00000000..c7930257 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment.mode @@ -0,0 +1 @@ +7 \ No newline at end of file diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment.output b/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment.output new file mode 100644 index 00000000..12949c15 Binary files /dev/null and b/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment.output differ diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment.stderr b/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment.stderr new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment.strace b/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment.strace new file mode 100644 index 00000000..874cad32 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-fragment.strace @@ -0,0 +1,14 @@ +read(0, "ALNPRV01\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0M\0\0\0\0\0\0\0"..., 40) = 40 +write(1, "ALNPRV01\1\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 40) = 40 +read(0, "ALNPRV01\2\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 40) = 40 +read(0, "hi", 2) = 2 +write(1, "ALNPRV01\2\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 40) = 40 +read(0, "ALNPRV01\3\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0"..., 40) = 40 +write(1, "ALNPRV01\3\0\0\0\0\0\0\0\3\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 113) = 113 +read(0, "ALNPRV01\4\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0"..., 40) = 40 +write(1, "ALNPRV01\4\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 40) = 40 +read(0, "ALNPRV01\3\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0"..., 40) = 40 +write(1, "ALNPRV01\3\0\0\0\0\0\0\0\3\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 605) = 605 +read(0, "ALNPRV01\4\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0"..., 40) = 40 +write(1, "ALNPRV01\4\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 40) = 40 +read(0, "AL \ No newline at end of file diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-full.exit b/evidence/allen-omega-L694/L748/independent-review/raw/provider-full.exit new file mode 100644 index 00000000..fff0a247 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-full.exit @@ -0,0 +1 @@ +74 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-full.stderr b/evidence/allen-omega-L694/L748/independent-review/raw/provider-full.stderr new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-normal-producer.err b/evidence/allen-omega-L694/L748/independent-review/raw/provider-normal-producer.err new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-normal.check.exit b/evidence/allen-omega-L694/L748/independent-review/raw/provider-normal.check.exit new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-normal.check.exit @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-normal.check.log b/evidence/allen-omega-L694/L748/independent-review/raw/provider-normal.check.log new file mode 100644 index 00000000..d91084d1 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-normal.check.log @@ -0,0 +1,292 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 +183 0 +184 0 +185 0 +186 0 +187 0 +188 0 +189 0 +190 0 +191 0 +192 0 +193 0 +194 0 +195 0 +196 0 +197 0 +198 0 +199 0 +200 0 +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 +225 0 +226 0 +227 0 +228 0 +229 0 +230 0 +231 0 +232 0 +233 0 +234 0 +235 0 +236 0 +237 0 +238 0 +239 0 +240 0 +241 0 +242 0 +243 0 +244 0 +245 0 +246 0 +247 0 +248 0 +249 0 +250 0 +251 0 +252 0 +253 0 +254 0 +255 0 +256 0 +257 0 +258 0 +259 0 +260 0 +261 0 +262 0 +263 0 +264 0 +265 0 +266 0 +267 0 +268 0 +269 0 +270 0 +271 0 +272 0 +273 0 +274 0 +275 0 +276 0 +277 0 +278 0 +279 0 +280 0 +281 0 +282 0 +283 0 +284 0 +285 0 +286 0 +287 0 +288 0 +289 0 +290 0 +291 0 +292 0 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-normal.input b/evidence/allen-omega-L694/L748/independent-review/raw/provider-normal.input new file mode 100644 index 00000000..95d75826 Binary files /dev/null and b/evidence/allen-omega-L694/L748/independent-review/raw/provider-normal.input differ diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-normal.output b/evidence/allen-omega-L694/L748/independent-review/raw/provider-normal.output new file mode 100644 index 00000000..12949c15 Binary files /dev/null and b/evidence/allen-omega-L694/L748/independent-review/raw/provider-normal.output differ diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-normal.stderr b/evidence/allen-omega-L694/L748/independent-review/raw/provider-normal.stderr new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write-check-final.exit b/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write-check-final.exit new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write-check-final.exit @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write-check-final.log b/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write-check-final.log new file mode 100644 index 00000000..4a64a2b7 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write-check-final.log @@ -0,0 +1,83 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write-check.exit b/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write-check.exit new file mode 100644 index 00000000..d00491fd --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write-check.exit @@ -0,0 +1 @@ +1 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write-check.log b/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write-check.log new file mode 100644 index 00000000..52a768ab --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write-check.log @@ -0,0 +1,83 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 1 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write.exit b/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write.exit new file mode 100644 index 00000000..fff0a247 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write.exit @@ -0,0 +1 @@ +74 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write.output b/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write.output new file mode 100644 index 00000000..168db2b7 Binary files /dev/null and b/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write.output differ diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write.receipt b/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write.receipt new file mode 100644 index 00000000..16bf1d6a Binary files /dev/null and b/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write.receipt differ diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write.stderr b/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write.stderr new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write.strace b/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write.strace new file mode 100644 index 00000000..d107af49 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-partial-write.strace @@ -0,0 +1,10 @@ +write(1, "ALNPRV01\1\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 40) = 40 +write(1, "ALNPRV01\2\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 40) = 40 +write(1, "ALNPRV01\3\0\0\0\0\0\0\0\3\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 113) = 113 +write(1, "ALNPRV01\4\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 40) = 40 +write(1, "ALNPRV01\3\0\0\0\0\0\0\0\3\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 605) = 605 +write(1, "ALNPRV01\4\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 40) = 40 +write(1, "ALNPRV01\5\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0"..., 45) = 45 +write(1, "ALNPRV01\3\0\0\0\0\0\0\0\3\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 111) = 101 +write(1, "0 bytes=0\n", 10) = -1 EFBIG (File too large) +--- SIGXFSZ {si_signo=SIGXFSZ, si_code=SI_USER, si_pid=3993378, si_uid=1000} --- diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-semantic-check.exit b/evidence/allen-omega-L694/L748/independent-review/raw/provider-semantic-check.exit new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-semantic-check.exit @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-semantic-check.log b/evidence/allen-omega-L694/L748/independent-review/raw/provider-semantic-check.log new file mode 100644 index 00000000..7a69dff3 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-semantic-check.log @@ -0,0 +1,38 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-semantic.exit b/evidence/allen-omega-L694/L748/independent-review/raw/provider-semantic.exit new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider-semantic.exit @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-semantic.input b/evidence/allen-omega-L694/L748/independent-review/raw/provider-semantic.input new file mode 100644 index 00000000..c09e7612 Binary files /dev/null and b/evidence/allen-omega-L694/L748/independent-review/raw/provider-semantic.input differ diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-semantic.output b/evidence/allen-omega-L694/L748/independent-review/raw/provider-semantic.output new file mode 100644 index 00000000..e3c35b9a Binary files /dev/null and b/evidence/allen-omega-L694/L748/independent-review/raw/provider-semantic.output differ diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider-semantic.stderr b/evidence/allen-omega-L694/L748/independent-review/raw/provider-semantic.stderr new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/provider.elf.txt b/evidence/allen-omega-L694/L748/independent-review/raw/provider.elf.txt new file mode 100644 index 00000000..4cb42eab --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/provider.elf.txt @@ -0,0 +1,30 @@ +ELF Header: + Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 + Class: ELF64 + Data: 2's complement, little endian + Version: 1 (current) + OS/ABI: UNIX - System V + ABI Version: 0 + Type: EXEC (Executable file) + Machine: AArch64 + Version: 0x1 + Entry point address: 0x4000b0 + Start of program headers: 64 (bytes into file) + Start of section headers: 0 (bytes into file) + Flags: 0x0 + Size of this header: 64 (bytes) + Size of program headers: 56 (bytes) + Number of program headers: 2 + Size of section headers: 0 (bytes) + Number of section headers: 0 + Section header string table index: 0 + +Program Headers: + Type Offset VirtAddr PhysAddr + FileSiz MemSiz Flags Align + LOAD 0x0000000000000000 0x0000000000400000 0x0000000000400000 + 0x00000000000131f8 0x00000000000131f8 R E 0x1000 + LOAD 0x0000000000000000 0x0000000010000000 0x0000000010000000 + 0x0000000000000000 0x0000000000881990 RW 0x1000 + +There is no dynamic section in this file. diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/release-source.paths b/evidence/allen-omega-L694/L748/independent-review/raw/release-source.paths new file mode 100644 index 00000000..ace3a725 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/release-source.paths @@ -0,0 +1,51 @@ +native/omega/allen/application.om +native/omega/allen/base.om +native/omega/allen/build-one.sh +native/omega/allen/code.om +native/omega/allen/context.om +native/omega/allen/courier.om +native/omega/allen/gate.sh +native/omega/allen/golden.sh +native/omega/allen/intent.om +native/omega/allen/main.om +native/omega/allen/memory.om +native/omega/allen/paint.om +native/omega/allen/provider-core.om +native/omega/allen/PROVIDER.md +native/omega/allen/provider.om +native/omega/allen/README.md +native/omega/allen/reply.om +native/omega/allen/runtime.om +native/omega/allen/scene-input.om +native/omega/allen/scene.om +native/omega/allen/scheduler.om +native/omega/allen/tests/application.om +native/omega/allen/tests/check.om +native/omega/allen/tests/code.om +native/omega/allen/tests/context.om +native/omega/allen/tests/courier.om +native/omega/allen/tests/edges.om +native/omega/allen/tests/fixture.om +native/omega/allen/tests/golden.om +native/omega/allen/tests/intent.om +native/omega/allen/tests/memory.om +native/omega/allen/tests/paint.om +native/omega/allen/tests/probe.om +native/omega/allen/tests/provider-core.om +native/omega/allen/tests/provider-input.om +native/omega/allen/tests/provider-mutants.om +native/omega/allen/tests/provider-output.om +native/omega/allen/tests/provider-process.om +native/omega/allen/tests/render.om +native/omega/allen/tests/reply.om +native/omega/allen/tests/runtime.om +native/omega/allen/tests/scene-input.om +native/omega/allen/tests/scene.om +native/omega/allen/tests/scheduler.om +native/omega/allen/tests/stdio-overflow.om +native/omega/allen/tests/view.om +native/omega/allen/vendor/OMEGA-LICENSE +native/omega/allen/vendor/PROVENANCE.md +native/omega/allen/vendor/sha256-core.om +native/omega/allen/vendor/sha256.om +native/omega/allen/view.om diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/report.sha256 b/evidence/allen-omega-L694/L748/independent-review/raw/report.sha256 new file mode 100644 index 00000000..c273852f --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/report.sha256 @@ -0,0 +1 @@ +f846dec7f6003c0740cbafa58622432c8b916ace31f230ac8faeec8b5e4e6274 /home/drakestapleton/handoffs/L753-review/report.md diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/report.sha256.verify b/evidence/allen-omega-L694/L748/independent-review/raw/report.sha256.verify new file mode 100644 index 00000000..c273852f --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/report.sha256.verify @@ -0,0 +1 @@ +f846dec7f6003c0740cbafa58622432c8b916ace31f230ac8faeec8b5e4e6274 /home/drakestapleton/handoffs/L753-review/report.md diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-1.check.log b/evidence/allen-omega-L694/L748/independent-review/raw/short-1.check.log new file mode 100644 index 00000000..7da8e511 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/short-1.check.log @@ -0,0 +1,5 @@ +1 0 +2 0 +3 0 +4 0 +5 0 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-1.input b/evidence/allen-omega-L694/L748/independent-review/raw/short-1.input new file mode 100644 index 00000000..1f0e4517 Binary files /dev/null and b/evidence/allen-omega-L694/L748/independent-review/raw/short-1.input differ diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-1.output b/evidence/allen-omega-L694/L748/independent-review/raw/short-1.output new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-1.receipt b/evidence/allen-omega-L694/L748/independent-review/raw/short-1.receipt new file mode 100644 index 00000000..2b29860a --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/short-1.receipt @@ -0,0 +1,4 @@ +1 +65 +0 +0 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-1.stderr b/evidence/allen-omega-L694/L748/independent-review/raw/short-1.stderr new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-2.check.log b/evidence/allen-omega-L694/L748/independent-review/raw/short-2.check.log new file mode 100644 index 00000000..7da8e511 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/short-2.check.log @@ -0,0 +1,5 @@ +1 0 +2 0 +3 0 +4 0 +5 0 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-2.input b/evidence/allen-omega-L694/L748/independent-review/raw/short-2.input new file mode 100644 index 00000000..1db16c18 Binary files /dev/null and b/evidence/allen-omega-L694/L748/independent-review/raw/short-2.input differ diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-2.output b/evidence/allen-omega-L694/L748/independent-review/raw/short-2.output new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-2.receipt b/evidence/allen-omega-L694/L748/independent-review/raw/short-2.receipt new file mode 100644 index 00000000..9ba12cca --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/short-2.receipt @@ -0,0 +1,4 @@ +2 +65 +0 +0 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-2.stderr b/evidence/allen-omega-L694/L748/independent-review/raw/short-2.stderr new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-3-traced.exit b/evidence/allen-omega-L694/L748/independent-review/raw/short-3-traced.exit new file mode 100644 index 00000000..1479e19b --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/short-3-traced.exit @@ -0,0 +1 @@ +65 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-3-traced.output b/evidence/allen-omega-L694/L748/independent-review/raw/short-3-traced.output new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-3-traced.stderr b/evidence/allen-omega-L694/L748/independent-review/raw/short-3-traced.stderr new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-3.check.log b/evidence/allen-omega-L694/L748/independent-review/raw/short-3.check.log new file mode 100644 index 00000000..7da8e511 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/short-3.check.log @@ -0,0 +1,5 @@ +1 0 +2 0 +3 0 +4 0 +5 0 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-3.input b/evidence/allen-omega-L694/L748/independent-review/raw/short-3.input new file mode 100644 index 00000000..e57731f8 Binary files /dev/null and b/evidence/allen-omega-L694/L748/independent-review/raw/short-3.input differ diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-3.output b/evidence/allen-omega-L694/L748/independent-review/raw/short-3.output new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-3.receipt b/evidence/allen-omega-L694/L748/independent-review/raw/short-3.receipt new file mode 100644 index 00000000..199cc204 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/short-3.receipt @@ -0,0 +1,4 @@ +3 +65 +0 +0 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-3.stderr b/evidence/allen-omega-L694/L748/independent-review/raw/short-3.stderr new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-3.strace b/evidence/allen-omega-L694/L748/independent-review/raw/short-3.strace new file mode 100644 index 00000000..f59e1642 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/short-3.strace @@ -0,0 +1,2 @@ +read(0, "ALNPRV01\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0M\0\0\0\0\0\0\0"..., 40) = 39 +read(0, "", 1) = 0 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-4-traced.exit b/evidence/allen-omega-L694/L748/independent-review/raw/short-4-traced.exit new file mode 100644 index 00000000..1479e19b --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/short-4-traced.exit @@ -0,0 +1 @@ +65 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-4-traced.output b/evidence/allen-omega-L694/L748/independent-review/raw/short-4-traced.output new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-4-traced.stderr b/evidence/allen-omega-L694/L748/independent-review/raw/short-4-traced.stderr new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-4.check.log b/evidence/allen-omega-L694/L748/independent-review/raw/short-4.check.log new file mode 100644 index 00000000..7da8e511 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/short-4.check.log @@ -0,0 +1,5 @@ +1 0 +2 0 +3 0 +4 0 +5 0 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-4.input b/evidence/allen-omega-L694/L748/independent-review/raw/short-4.input new file mode 100644 index 00000000..f62d999f Binary files /dev/null and b/evidence/allen-omega-L694/L748/independent-review/raw/short-4.input differ diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-4.output b/evidence/allen-omega-L694/L748/independent-review/raw/short-4.output new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-4.receipt b/evidence/allen-omega-L694/L748/independent-review/raw/short-4.receipt new file mode 100644 index 00000000..26a81c4a --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/short-4.receipt @@ -0,0 +1,4 @@ +4 +65 +0 +0 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-4.stderr b/evidence/allen-omega-L694/L748/independent-review/raw/short-4.stderr new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-4.strace b/evidence/allen-omega-L694/L748/independent-review/raw/short-4.strace new file mode 100644 index 00000000..708f17f0 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/short-4.strace @@ -0,0 +1,3 @@ +read(0, "ALNPRV01\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 40) = 40 +read(0, "h", 2) = 1 +read(0, "", 1) = 0 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-5.check.log b/evidence/allen-omega-L694/L748/independent-review/raw/short-5.check.log new file mode 100644 index 00000000..7da8e511 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/short-5.check.log @@ -0,0 +1,5 @@ +1 0 +2 0 +3 0 +4 0 +5 0 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-5.input b/evidence/allen-omega-L694/L748/independent-review/raw/short-5.input new file mode 100644 index 00000000..63f04014 Binary files /dev/null and b/evidence/allen-omega-L694/L748/independent-review/raw/short-5.input differ diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-5.output b/evidence/allen-omega-L694/L748/independent-review/raw/short-5.output new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-5.receipt b/evidence/allen-omega-L694/L748/independent-review/raw/short-5.receipt new file mode 100644 index 00000000..d79f5995 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/short-5.receipt @@ -0,0 +1,4 @@ +5 +65 +0 +0 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-5.stderr b/evidence/allen-omega-L694/L748/independent-review/raw/short-5.stderr new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-6.check.log b/evidence/allen-omega-L694/L748/independent-review/raw/short-6.check.log new file mode 100644 index 00000000..3f9cc45d --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/short-6.check.log @@ -0,0 +1,17 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-6.input b/evidence/allen-omega-L694/L748/independent-review/raw/short-6.input new file mode 100644 index 00000000..fd23a175 Binary files /dev/null and b/evidence/allen-omega-L694/L748/independent-review/raw/short-6.input differ diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-6.output b/evidence/allen-omega-L694/L748/independent-review/raw/short-6.output new file mode 100644 index 00000000..58e9a74d Binary files /dev/null and b/evidence/allen-omega-L694/L748/independent-review/raw/short-6.output differ diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-6.receipt b/evidence/allen-omega-L694/L748/independent-review/raw/short-6.receipt new file mode 100644 index 00000000..d0b7cd17 Binary files /dev/null and b/evidence/allen-omega-L694/L748/independent-review/raw/short-6.receipt differ diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/short-6.stderr b/evidence/allen-omega-L694/L748/independent-review/raw/short-6.stderr new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/source-membership.diff b/evidence/allen-omega-L694/L748/independent-review/raw/source-membership.diff new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/trace-producer.err b/evidence/allen-omega-L694/L748/independent-review/raw/trace-producer.err new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/trace-producer.exit b/evidence/allen-omega-L694/L748/independent-review/raw/trace-producer.exit new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/trace-producer.exit @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/trace-provider.err b/evidence/allen-omega-L694/L748/independent-review/raw/trace-provider.err new file mode 100644 index 00000000..8d568fd0 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/trace-provider.err @@ -0,0 +1,7 @@ +strace: /home/drakestapleton/handoffs/L753-review/raw/provider-fragment.strace: File too large +strace: /home/drakestapleton/handoffs/L753-review/raw/provider-fragment.strace: File too large +strace: /home/drakestapleton/handoffs/L753-review/raw/provider-fragment.strace: File too large +strace: /home/drakestapleton/handoffs/L753-review/raw/provider-fragment.strace: File too large +strace: /home/drakestapleton/handoffs/L753-review/raw/provider-fragment.strace: File too large +strace: /home/drakestapleton/handoffs/L753-review/raw/provider-fragment.strace: File too large +strace: /home/drakestapleton/handoffs/L753-review/raw/provider-fragment.strace: File too large diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/trace-provider.exit b/evidence/allen-omega-L694/L748/independent-review/raw/trace-provider.exit new file mode 100644 index 00000000..fff0a247 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/raw/trace-provider.exit @@ -0,0 +1 @@ +74 diff --git a/evidence/allen-omega-L694/L748/independent-review/raw/trace-provider.out b/evidence/allen-omega-L694/L748/independent-review/raw/trace-provider.out new file mode 100644 index 00000000..168db2b7 Binary files /dev/null and b/evidence/allen-omega-L694/L748/independent-review/raw/trace-provider.out differ diff --git a/evidence/allen-omega-L694/L748/independent-review/report.md b/evidence/allen-omega-L694/L748/independent-review/report.md new file mode 100644 index 00000000..468784c2 --- /dev/null +++ b/evidence/allen-omega-L694/L748/independent-review/report.md @@ -0,0 +1,49 @@ +# L753 independent review — L748 native Omega provider stream + +**Verdict:** No correctness finding in the reviewed provider core or native stdin/stdout entry at `43eae848f0a44604b42378d9ea3170278b5f3f8f`. The focused independent probes passed. This is source/build/host-stream evidence only; it does not qualify a live model, network, clock, persistent storage, device, x86, or iMac path. + +## Scope and source closure + +- Reviewed exact head `43eae848f0a44604b42378d9ea3170278b5f3f8f` (base `be28deb21721f54fc46b5402076c7e8ac8fde151`), including `native/omega/allen/PROVIDER.md`, `provider-core.om`, `provider.om`, provider tests, and their application, scheduler, memory, context, reply, code, courier, runtime and base callees. +- Exported that commit with `git archive` to `~/handoffs/L753-review/source/`; all 51 tracked `native/omega/allen` paths exactly matched the L748 `source.sha256` membership and every one of its recorded hashes matched `git show :`. The 51-file manifest is broader than the 43-file L747 review closure recorded in L748 summary. +- Pinned `omc` SHA-256: `191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9`. Rebuilt with the exported `build-one.sh`; every binary is a nonempty static AArch64 ELF EXEC with no `INTERP`/`NEEDED` entries. +- Rebuilt provider SHA-256 `c9367d4cbc9261ebc0faaf3a99c2988ee36abda197670d868bd202a3bb19cccd`, exactly matching the L748 author receipt. Provider-core test, output verifier, process verifier, boundary test and custom probe artifact hashes are in `raw/builds-final.sha256` and `raw/builds.sha256`. +- The production worktree was clean at initial inspection. It had unrelated concurrent modifications by final inspection (`README.md`, `gate.sh`, and presentation files); I did not modify or build from that mutable tree. All compilation/replay used the immutable exported pin. + +## Findings + +None. Header fields are decoded little-endian as full 64-bit values; malformed magic/op/shape refuses before later command processing, while semantic refusal remains a framed status-0 response and permits following records. Restore staging gates BOOT, COPY/NOTE are bounded and duplicate visits refuse, offer output is copied to its own buffer without advancing transport completion, and the actual SENT result remains owned by the caller. Reply and completed-code records remain separately framed. + +## Independent execution + +All newly written behavioral probes and receipt checks were handwritten seeded Omega (`.om`). Shell was limited to pinned export/build, wiring real processes/descriptors and retaining logs/statuses. + +| Probe | Result | +|---|---| +| Rebuilt provider-core test from exported callees and pinned source | 100 assertions; exit 0 | +| Rebuilt native stream entry + existing independent output verifier, normal valid stream | 292 assertions; exit 0 | +| Same valid stream through a real FIFO with Omega producer writes selected to one byte at a time | 292 assertions; producer/consumer exit 0; output byte-identical to regular-file replay (1114 bytes) | +| Independent `.om` parser/shape boundaries | 25 assertions; exit 0; included timestamp/op/argument/body-size bounds, 64-bit high-bit round-trip, invalid high-bit op, ASK 0/1/159/160, RECV 64/65/1200/1201, COPY/NOTE index edges, and zero-timestamp rules | +| Independent real process sequence BOOT, duplicate BOOT refusal, then CANCEL | 38 assertions; process exit 0; exactly three 40-byte replies with statuses 1, 0, 1 | +| Existing Omega process receipt verifier over six generated malformed/truncated inputs | 42 assertions; each process refused with exit 65; output was empty except the expected prior BOOT reply (40 bytes) before the malformed next frame | +| Clean EOF and true partial header/body EOF | Clean EOF exit 0 with empty output; 39/40-byte header and 1/2-byte body actually observed by `strace`, then EOF; each truncated process exit 65 | +| Short output write followed by write error | `RLIMIT_FSIZE`/ignored `SIGXFSZ` caused a real 101/111-byte positive write, followed by `EFBIG`; process exited 74 after a 1024-byte prefix. Independent Omega receipt/frame-prefix checker: 83 assertions, exit 0 | +| `/dev/full` output error | Process exit 74; no stderr | + +**Count:** 872 passing Omega assertions across the listed test artifacts (100 + 292 + 292 + 25 + 38 + 42 + 83). This count excludes raw syscall observations and exit-only EOF/`/dev/full` checks. + +## Raw evidence and replay inputs + +- `raw/pins.txt`, `raw/compiler.sha256`, `raw/focused-inputs.sha256`, `raw/source-membership.diff`, `raw/git-source.paths`, and `raw/release-source.paths`: pin/compiler/source closure. +- `raw/provider.elf.txt`, `raw/builds.sha256`, `raw/builds-final.sha256`: ELF and compiled artifact identities. +- `raw/provider-core.log`, `raw/provider-normal.check.log`, `raw/provider-fragment.check.log`, `raw/provider-semantic-check.log`, `raw/provider-boundary-final.log`, `raw/short-*.receipt`, `raw/short-*.check.log`, and `raw/provider-partial-write-check-final.log`: native Omega assertion output and process receipts. +- `raw/short-3.strace`, `raw/short-4.strace`, `raw/provider-fragment.strace`, `raw/provider-partial-write.strace`, and associated input/output/status files: real syscall evidence. +- `raw/failed-probes/`: retained expected probe-construction failures and their statuses. Missing `main` was a compile/setup failure; the initial boundary count was an assertion-count error; a cancellation fixture with nonzero timestamp was malformed and correctly refused (65, with only the two prior 40-byte replies). They are not product failures and were not counted as kills. +- `source/` is the exact source archive export; `build/` contains focused inputs, Omega probes and outputs. No whole suite was rerun; L748's exact-source 2214 assertion/15 compiled-mutant receipt was inspected rather than duplicated. + +## Limits / remaining qualification + +- No live model/provider service, network or datagram transport, monotonic hardware clock, physical persistence, device, x86, or iMac execution was exercised. Host stdin/stdout framing is not those interfaces. +- The byte-at-a-time FIFO run alone did **not** prove short `read(2)` calls (the trace showed a complete 40-byte read); separate truncated-header/body EOF cases did prove positive partial reads. Short output write accounting was directly exercised as a positive short write followed by a subsequent error, not as successful retry/recovery. +- EINTR behavior and inherited SIGPIPE disposition were not injected. The entry maps syscall errors to 74; these signal/interruption cases remain separate qualification limits. +- No production files were changed; no deploy/restart/push or ledger action was performed. diff --git a/evidence/allen-omega-L694/L748/initial-invalid-mutant.om b/evidence/allen-omega-L694/L748/initial-invalid-mutant.om new file mode 100644 index 00000000..94d5b3bf --- /dev/null +++ b/evidence/allen-omega-L694/L748/initial-invalid-mutant.om @@ -0,0 +1,3951 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn b = qsent get Pv 1 true +prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +b = qsent get Pv 1 true +prreply status +ret true +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +text Fmagic "ALNPRV01" +text Hi "hi" +text Reply "SAY 1 1/1 hello" +text Askcode "write a calculator" +text Tinycode "CODE 2 1/1 2 d8932aac text hi" +text Done "SAY 2 1/1 Done." +global Held uchar 8192 +global Holdn ulong 2 +global Before uchar 8192 +fn test ok bool to void +note Direct write logger would clobber the very datagram being tested. +put Holdn 0 get Outlen 0 +put Holdn 1 get Err 0 +for i ulong get Outlen 0 +put Held i get Outb i +end +check ok add get Checks 0 1 +for i ulong get Holdn 0 +put Outb i get Held i +end +put Outlen 0 get Holdn 0 +put Err 0 get Holdn 1 +end +fn hword off ulong v ulong to void +for i ulong 8 +put Ph add off i uchar and shr v mul i 8 255 +end +end +fn frame op ulong now ulong arg ulong size ulong to void +for i ulong 8 +put Ph i get Fmagic i +end +hword 8 op +hword 16 now +hword 24 arg +hword 32 size +end +fn oword off ulong to ulong +v = ulong 0 +for i ulong 8 +v = or v shl ulong get Pout add off i mul i 8 +end +ret v +end +fn receive part ulong size ulong to void +note Caller placed LINE payload in In; packet overwrites Outb, so preserve it. +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Held i get Outb i +end +put Inlen 0 size +b = packet 2 get Q 1 part 0 0 +size = get Outlen 0 +for i ulong size +put Pb i get Outb i +end +for i ulong n +put Outb i get Held i +end +put Outlen 0 n +put Err 0 e +frame 5 4294967297 0 size +end +fn main to int +frame 1 4294967296 77 0 +test prparse +test eq get Pv 0 1 +test eq get Pv 1 4294967296 +test eq get Pv 2 77 +put Ph 0 88 +test not prparse +frame 11 0 0 0 +test not prparse +frame 1 0 77 1 +test not prparse +frame 3 0 2 0 +test not prparse +frame 2 0 0 160 +test not prparse +frame 10 0 0 0 +test prdo +test eq oword 16 1 +test eq get Pc 0 1 +mset32 0 3 +mset32 36 1 +test memenc 10 +for i ulong 4096 +put Pb i get Enc i +end +frame 8 0 1 4096 +test prdo +test eq oword 16 1 +test eq get St 0 10 +test prdo +test eq oword 16 0 +frame 1 4294967296 77 0 +test prdo +test eq oword 16 0 +for i ulong 4096 +put Pb i 0 +end +frame 8 0 0 4096 +test prdo +test eq oword 16 2 +test eq get Pc 0 2 +test eq get St 0 10 +frame 1 4294967296 77 0 +test prdo +test eq oword 16 0 +put Ns 0 2 +put Ns 1 0 +put Ns 2 3 +put Ns 3 0 +put Note 0 78 +put Note 1 48 +test noteenc +for i ulong 4096 +put Pb i get Enc i +end +frame 9 0 1 4096 +test prdo +test eq oword 16 0 +frame 9 0 0 4096 +test prdo +test eq oword 16 1 +test eq get Pc 0 3 +frame 1 4294967296 77 0 +test prdo +test eq oword 16 1 +test eq get A 0 1 +test prdo +test eq oword 16 0 +frame 10 0 0 0 +test prdo +test eq oword 16 0 +test eq mem32 0 3 +frame 2 4294967297 0 len Hi +for i ulong len Hi +put Pb i get Hi i +end +test prdo +test eq oword 16 1 +test eq get R 0 1 +frame 3 4294967297 1 0 +test prdo +test eq oword 16 3 +test eq oword 32 get Outlen 0 +test eq get T 10 5 +same = true +for i ulong get Outlen 0 +if ne get Pout add i 40 get Outb i +same = false +end +end +test same +test prdo +test eq oword 16 1 +test eq get T 10 5 +frame 4 4294967297 0 0 +test prdo +test eq get T 3 0 +frame 3 4294967297 1 0 +test prdo +test eq oword 16 3 +frame 4 4294967297 1 0 +test prdo +test eq get T 3 1 +frame 3 4294967297 1 0 +test prdo +test eq get T 10 1 +for i ulong len Reply +put In i get Reply i +end +receive 1 len Reply +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Before i get Outb i +end +test prdo +test eq get Outlen 0 n +test eq get Err 0 e +same = true +for i ulong n +if ne get Outb i get Before i +same = false +end +end +test same +test eq oword 16 1 +test eq oword 24 1 +test eq oword 32 5 +test eq get Pout 40 104 +test eq get R 1 0 +test eq get T 10 1 +test eq get Outb 0 65 +frame 4 4294967297 1 0 +test prdo +frame 3 4294967297 1 0 +test prdo +test eq oword 16 3 +test eq get T 10 3 +frame 4 4294967297 1 0 +test prdo +frame 3 4294967297 1 0 +test prdo +test eq oword 16 1 +test eq oword 32 0 +frame 2 4294967297 0 len Askcode +for i ulong len Askcode +put Pb i get Askcode i +end +test prdo +test eq oword 24 1 +test eq oword 32 len Ack +for i ulong len Tinycode +put In i get Tinycode i +end +receive 1 len Tinycode +test prdo +test eq oword 24 0 +frame 3 4294967297 1 0 +test prdo +frame 4 4294967297 1 0 +test prdo +for i ulong len Done +put In i get Done i +end +receive 2 len Done +test prdo +test eq oword 24 1 +test eq oword 32 5 +off = ulong 45 +test eq oword add off 8 11 +test eq oword add off 32 2 +test eq get Pout add off 40 104 +test eq get Pout add off 41 105 +test eq get Pn 0 add off 42 +frame 3 4294967296 1 0 +test prdo +test eq oword 16 0 +test eq oword 24 0 +frame 7 0 0 0 +test prdo +test eq get R 9 0 +test eq get R 0 2 +test eq get Q 1 2 +ret int get Fails 0 +end diff --git a/evidence/allen-omega-L694/L748/intent.log b/evidence/allen-omega-L694/L748/intent.log new file mode 100644 index 00000000..5371bd36 --- /dev/null +++ b/evidence/allen-omega-L694/L748/intent.log @@ -0,0 +1,8 @@ +501 0 +502 0 +503 0 +504 0 +505 0 +506 0 +507 0 +508 0 diff --git a/evidence/allen-omega-L694/L748/inventory.json b/evidence/allen-omega-L694/L748/inventory.json new file mode 100644 index 00000000..88e49e1c --- /dev/null +++ b/evidence/allen-omega-L694/L748/inventory.json @@ -0,0 +1,108 @@ +{ + "README.md": "d017f3fc4d54467299783bdf726647ead7fe59fd092c23769e787966a9888022", + "ackstop-mutant.log": "e35f80780a1c1769657287485e65ca25ab222d99277482c91900418d6dc6d433", + "appcode-mutant.log": "087522069b49d76999d8a495fccbff79cad4ff1fdf1d3ebf1e15855d6c959dc1", + "application.log": "799a91676cc7a8b0f4d027392ad8dda0e26af0501906ad906ae1ec8b1703d30a", + "autosent-mutant.log": "fd09242df722583c7e04568d177eed33aeec3b4fbc67f8d1cba666941a81bf08", + "binaries.sha256": "031c54d7912fc8e53d2d2843f57d1eb044d66ee96e5463e1cfce61351f223678", + "code.log": "f4d91fae8c90949b5538689d148384c72984c34d8f84507b499cbb75349ec390", + "context.log": "a93a138b2ffb8a544174d9bc55e3e5e8b7d0f2531f4aff76030eba22e7c7b5e0", + "contextjob-mutant.log": "4f32375d7357e7ebd07106f23fada35d235ad7756a9aba91f6a556fae4d39c3b", + "contextnote-mutant.log": "528e41cd827af033d9f5391f011aba3c9e348051a57916c0c5d52c9e263f87a5", + "courier.log": "466116a0daf08d362ded3aab678a6213671cc17e82ead4bd6fdc5dcedf1674f1", + "crc-mutant.log": "d640ebbfc3be10156ce28e7972bd9931390e4a2c18f90099997e4bd94d941835", + "edges.log": "c3c33b435c05aebcb2c86e76121ca0681bcc58c52bc1388b5a8b47258c5603ed", + "final.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa", + "final.log": "53c5cfa81cec3e8482fb2b8384a0b06483846dc1250ad872c5d8dae050be8239", + "framecheck-mutant.log": "80857ef43f4767086a5154d915825e2d9ab8e1dacf7382cd9cec20a6c9e945eb", + "full.exit": "e6c21e8d260fe71882debdb339d2402a2ca7648529bc2303f48649bce0380017", + "full.log": "fc445be00344cb20620c4d16ce7524764ffbfbc0ca7fc1e559588b71af26324a", + "green1.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa", + "green1.log": "f2c509f02a51654a605cab1eb026e3d316630cf6d9826b37670ff35fa993c3ba", + "hash-mutant.log": "e2900d31ceb87ff95fb84cac73a1e6aa3a0100eebaada0432ec50c2471cd437e", + "initial-invalid-mutant.om": "4162503beef582a5c39338e4497d1ae1a16176f7683a40cac1ead6378d16100a", + "intent.log": "920955281e985095ba5d24b01370dcb7fc022559df06892bfc120a9fc6a04345", + "keepalive-mutant.log": "9cf7f699f4c0a01694b4d3d557857d95fa76bdf5d7d2d58571aef3b9e66da10e", + "long.log": "b37fc9e675de395d9cba4c2e74ae7ea210e617927691c9f1df4896ae1bafe508", + "memory.log": "d8ad7727ab1536ed00ab2a63f0a056e4e4cc237571077c36573952a4c49c9a15", + "native-final.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa", + "native-final.log": "f8c64e32b6443c7240f34e5f663a0ce853689e207d288a59816747b007dffc1d", + "paint.log": "ab43be8b6b42efc70663a0e14d0b44aec7c0766bbb961af2da77d2737f78a81a", + "pendingwire-mutant.log": "6a48c141724f07b9adf2a4da28802544ab29d2d3f42fe1eacb3ef45df2d96657", + "process-red.exit": "4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865", + "process-red.log": "b0a6c00cf43f729dbb43ce13a05d2d985aa4b85a65d188f2752078499db8a181", + "process-red.receipt": "b692935a446f9a441cdda762e29c12d2d6ab075ee10722609daef6122357a17a", + "provider-bad-1.input": "b9d4174daac045b3088a0d53515083432b86dd4b5bdf5f1d67b8c7a4c144dd13", + "provider-bad-1.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c", + "provider-bad-1.output": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "provider-bad-1.receipt": "4a4a5cc6008f0286443686c10c17919e7e3a3e2258a6b97bf06311c9afe0dfe4", + "provider-bad-1.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "provider-bad-2.input": "5db852bf971a13086b099baa093cf88fbdaf42852f1cba8e938799a34109f332", + "provider-bad-2.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c", + "provider-bad-2.output": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "provider-bad-2.receipt": "437701d7771dcdcc130e256587a9251dbeabef08feb3d518d93f7db29b32619b", + "provider-bad-2.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "provider-bad-3.input": "509158d4cc5ee28556c0a1518ef3f7a97594e33aebe934a02a59f18c7ac5c230", + "provider-bad-3.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c", + "provider-bad-3.output": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "provider-bad-3.receipt": "cf271c014ed96ffcad97c0ddde9a784deae63b48ab54ead38a601896a2cdfa05", + "provider-bad-3.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "provider-bad-4.input": "9aec780192d96833fb57d407522db00fc6c6bf60b2fdf99ffbbbf5bdd9bfcb8d", + "provider-bad-4.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c", + "provider-bad-4.output": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "provider-bad-4.receipt": "3be14d5117cfd9923743dc772ac727cb30372228ca81879e3cac708dc9700d9a", + "provider-bad-4.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "provider-bad-5.input": "c42c9f8a6a3589d3aa3dfa90194663bfc26bd5575c60787c9a355f93fb9511fb", + "provider-bad-5.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c", + "provider-bad-5.output": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "provider-bad-5.receipt": "311ce7da405cd8858718b28b45415028dedec82003dcb862d1b5ceea26c84646", + "provider-bad-5.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "provider-bad-6.input": "8ea63ccc995ca2f50cae898a5dd97a15c90d8650e190a824f857d4cb362a8e91", + "provider-bad-6.log": "a0cc795fae1ca892318f47133f6c48e1c8bb6aad118ff7f2b00c8e8967393435", + "provider-bad-6.output": "691fee447b7b1453a429e23f01152ffacca0570ccce92f525af024aa0d934519", + "provider-bad-6.receipt": "26e7d22e42e36c12f4341bf1e1838f7fa84402571f3127fb91208ac45a05f64b", + "provider-bad-6.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "provider-boot.expected": "691fee447b7b1453a429e23f01152ffacca0570ccce92f525af024aa0d934519", + "provider-consumer.log": "d8b9c61c09b396c654162f89688f72787756206bfcc70276d6c2682c3e7710f5", + "provider-consumer.receipt": "fb092a176e79462f135ff6f1aea3e2171eada31ad629d8c498104e43b244dabb", + "provider-core.log": "fbfe365c7485671f3c8e0ccf480be062034b65360b2005530c258e1577aaec04", + "provider-fragment.log": "49c437a2551e71a10bc26bc969f55103611991adea98696503cbdb8e686d1ba3", + "provider-fragment.output": "94a3fc4b05bef182b4d33e6adf875bf638f89b01315ea1081da0cbdb950a6ac0", + "provider-fragment.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "provider-process.log": "d8b9c61c09b396c654162f89688f72787756206bfcc70276d6c2682c3e7710f5", + "provider-process.receipt": "fb092a176e79462f135ff6f1aea3e2171eada31ad629d8c498104e43b244dabb", + "provider-producer.log": "d8b9c61c09b396c654162f89688f72787756206bfcc70276d6c2682c3e7710f5", + "provider-producer.receipt": "b710cb935724406c7cf4e459857b58c47f6026696cc11727da2815675bfec4d9", + "provider-producer.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "provider-stream.log": "49c437a2551e71a10bc26bc969f55103611991adea98696503cbdb8e686d1ba3", + "provider.input": "520bdb2f475e7ff86edfd6618b04d672c6a9b90ce09e4f249e3c615078855867", + "provider.output": "94a3fc4b05bef182b4d33e6adf875bf638f89b01315ea1081da0cbdb950a6ac0", + "provider.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "readback-mutant.log": "c841304340c8e11f4412f33a05d63a76dfc6329270c33f30a4d5fb38c9339c61", + "red.exit": "93a73825c1b761d11bf2b3f4dff760d07888d3fde05dcf55f1da84aa6041a5a8", + "red.log": "40280c9a7b1c8a6314e0562384cc7d80cc6bb4a3af1486a11b4d81f9351baad3", + "red.om": "a503f3dbf1b0108995afb44666a4cc2e87da71a4d5318bb9ffc162032fd45461", + "release.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa", + "release.log": "f8c64e32b6443c7240f34e5f663a0ce853689e207d288a59816747b007dffc1d", + "reply.log": "32d6f801fcebf933a573005fdb8d16376c56b01c34b1004101b0c0f047216162", + "runtime.log": "3113eae822a3529bfeb10a00da4130799a2e951a77ce4d468a7e94ff5a312c51", + "scene-input.log": "613312ef2e6ad6eb62d19f9a161a65dbefd867af59a260d4dd82adef18ff88c9", + "scene.log": "bec37a817909cb5af22c3d82c962698ab0ddaf8a2c16debe86a84ea2a0889bc8", + "scenecap-mutant.log": "aaecc0a85ed361c2a5f6823a85f76ea5c8c60e3bef3d88ef225175ca7c3c090d", + "scheduler.log": "b73f09405c612284cb7eecacb51fbabe60f5f7c6ec11f504cbb76a1e4e83f948", + "session-mutant.log": "b6320567e748c4f1ab264c07c76e22f7091d6bf77c004aae67ecef4d8115e8f2", + "short.log": "b8ed8e2db46290298415a96dbb9f64580f5ff79f631cdcf3b0257f3fb836f8a2", + "source.sha256": "858169ddb766dcc50d17fb2bec4449420d94d674ddff453748046a63d2df11ac", + "stale-mutant.log": "59a77d4cd8683beb2a101425071eafef48c9afba89ac8b6e10edb8ed1098b42b", + "stdio-overflow.input": "9273073a240b9484e26ac34d83e695fa214702c16b9bc72890d37f0a57834a92", + "stdio-overflow.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "stream-green.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa", + "stream-green.log": "49c437a2551e71a10bc26bc969f55103611991adea98696503cbdb8e686d1ba3", + "stream-red.exit": "4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865", + "stream-red.log": "3f11ad6bbc7ecca0b2416b713dee77f1a635c00aaeaa946e14cde1c2bfae56d5", + "stream-red.om": "6cf5c717c76d61c456894d215057d67ffd686063b81beb6b7a06b3e5759b3be6", + "stream-verifier.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa", + "summary.json": "98c68397adc3aee7b18f05fb8453b8765ae0572c14dd40853e2ab8d74ca84369", + "thinking-mutant.log": "908c76c450a2ae6643694cc1f41e2a868792bcc3e20e96c317de6fa764d7f474", + "view.log": "2d117e033fea3f325a11c5cd70be5a181eb4d7d6b08e45b5fd73447d4159550e" +} diff --git a/evidence/allen-omega-L694/L748/keepalive-mutant.log b/evidence/allen-omega-L694/L748/keepalive-mutant.log new file mode 100644 index 00000000..2e3415df --- /dev/null +++ b/evidence/allen-omega-L694/L748/keepalive-mutant.log @@ -0,0 +1,213 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 1 +19 1 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 1 +54 1 +55 1 +56 1 +57 0 +58 0 +59 1 +60 0 +61 0 +62 0 +63 0 +64 0 +65 1 +66 0 +67 0 +68 0 +69 1 +70 1 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 1 +170 0 +171 1 +172 1 +173 0 +174 1 +175 0 +176 0 +177 0 +178 1 +179 1 +180 1 +181 1 +182 1 +183 1 +184 1 +185 1 +186 1 +187 1 +188 1 +189 1 +190 1 +191 1 +192 1 +193 1 +194 1 +195 1 +196 1 +197 1 +198 0 +199 1 +200 0 +201 0 +202 1 +203 1 +204 1 +205 0 +206 1 +207 1 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 diff --git a/evidence/allen-omega-L694/L748/long.log b/evidence/allen-omega-L694/L748/long.log new file mode 100644 index 00000000..0a060bc8 --- /dev/null +++ b/evidence/allen-omega-L694/L748/long.log @@ -0,0 +1,292 @@ +401 0 +410 0 +411 0 +412 0 +413 0 +414 0 +415 0 +416 0 +417 0 +418 0 +419 0 +420 0 +421 0 +422 0 +423 0 +424 0 +425 0 +426 0 +427 0 +428 0 +429 0 +430 0 +431 0 +432 0 +433 0 +434 0 +435 0 +436 0 +437 0 +438 0 +439 0 +440 0 +441 0 +442 0 +443 0 +444 0 +445 0 +446 0 +447 0 +448 0 +449 0 +450 0 +451 0 +452 0 +453 0 +454 0 +455 0 +456 0 +457 0 +458 0 +459 0 +460 0 +461 0 +462 0 +463 0 +464 0 +465 0 +466 0 +467 0 +468 0 +469 0 +470 0 +471 0 +472 0 +473 0 +474 0 +475 0 +476 0 +477 0 +478 0 +479 0 +480 0 +481 0 +482 0 +483 0 +484 0 +485 0 +486 0 +487 0 +488 0 +489 0 +490 0 +491 0 +492 0 +493 0 +494 0 +495 0 +496 0 +497 0 +498 0 +499 0 +500 0 +501 0 +502 0 +503 0 +504 0 +505 0 +506 0 +507 0 +508 0 +509 0 +510 0 +511 0 +512 0 +513 0 +514 0 +515 0 +516 0 +517 0 +518 0 +519 0 +520 0 +521 0 +522 0 +523 0 +524 0 +525 0 +526 0 +527 0 +528 0 +529 0 +530 0 +531 0 +532 0 +533 0 +534 0 +535 0 +536 0 +537 0 +538 0 +539 0 +540 0 +541 0 +542 0 +543 0 +544 0 +545 0 +546 0 +547 0 +548 0 +549 0 +550 0 +402 0 +403 0 +404 0 +405 0 +406 0 +700 0 +701 0 +702 0 +703 0 +704 0 +705 0 +706 0 +707 0 +708 0 +709 0 +710 0 +711 0 +712 0 +713 0 +714 0 +715 0 +716 0 +717 0 +718 0 +719 0 +720 0 +721 0 +722 0 +723 0 +724 0 +725 0 +726 0 +727 0 +728 0 +729 0 +730 0 +731 0 +732 0 +733 0 +734 0 +735 0 +736 0 +737 0 +738 0 +739 0 +740 0 +741 0 +742 0 +743 0 +744 0 +745 0 +746 0 +747 0 +748 0 +749 0 +750 0 +751 0 +752 0 +753 0 +754 0 +755 0 +756 0 +757 0 +758 0 +759 0 +760 0 +761 0 +762 0 +763 0 +764 0 +765 0 +766 0 +767 0 +768 0 +769 0 +770 0 +771 0 +772 0 +773 0 +774 0 +775 0 +776 0 +777 0 +778 0 +779 0 +780 0 +781 0 +782 0 +783 0 +784 0 +785 0 +786 0 +787 0 +788 0 +789 0 +790 0 +791 0 +792 0 +793 0 +794 0 +795 0 +796 0 +797 0 +798 0 +799 0 +800 0 +801 0 +802 0 +803 0 +804 0 +805 0 +806 0 +807 0 +808 0 +809 0 +810 0 +811 0 +812 0 +813 0 +814 0 +815 0 +816 0 +817 0 +818 0 +819 0 +820 0 +821 0 +822 0 +823 0 +824 0 +825 0 +826 0 +827 0 +828 0 +829 0 +830 0 +831 0 +832 0 +833 0 +834 0 +835 0 +836 0 +837 0 +838 0 +839 0 +840 0 +841 0 +407 0 +408 0 +409 0 diff --git a/evidence/allen-omega-L694/L748/memory.log b/evidence/allen-omega-L694/L748/memory.log new file mode 100644 index 00000000..5928102e --- /dev/null +++ b/evidence/allen-omega-L694/L748/memory.log @@ -0,0 +1,79 @@ +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 0 +310 0 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +362 0 +363 0 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 0 +361 0 diff --git a/evidence/allen-omega-L694/L748/native-final.exit b/evidence/allen-omega-L694/L748/native-final.exit new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/L748/native-final.exit @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/L748/native-final.log b/evidence/allen-omega-L694/L748/native-final.log new file mode 100644 index 00000000..96ebefe9 --- /dev/null +++ b/evidence/allen-omega-L694/L748/native-final.log @@ -0,0 +1,43 @@ +runtime compile=0 native-exit=0 +code compile=0 native-exit=0 +courier compile=0 native-exit=0 +scheduler compile=0 native-exit=0 +application compile=0 native-exit=0 +provider-core compile=0 native-exit=0 +memory compile=0 native-exit=0 +context compile=0 native-exit=0 +intent compile=0 native-exit=0 +reply compile=0 native-exit=0 +view compile=0 native-exit=0 +scene compile=0 native-exit=0 +scene-input compile=0 native-exit=0 +paint compile=0 native-exit=0 +edges compile=0 native-exit=0 +fixture compile=0 native-exit=0 +golden compile=0 native-exit=0 +render compile=0 native-exit=0 +stdio native-exit=0 golden-cmp=0 +stdio overflow native-exit=65 no-later-command=PASS +provider malformed mode=1 exit=65 no-later-command=PASS +provider malformed mode=2 exit=65 no-later-command=PASS +provider malformed mode=3 exit=65 no-later-command=PASS +provider malformed mode=4 exit=65 no-later-command=PASS +provider malformed mode=5 exit=65 no-later-command=PASS +provider malformed mode=6 exit=65 no-later-command=PASS +provider native-exit=0 fragmented-pipe=0 output-verifier=0 +stale mutant compile=0 rejected-exit=3 +crc mutant compile=0 rejected-exit=2 +hash mutant compile=0 rejected-exit=2 +readback mutant compile=0 rejected-exit=7 +session mutant compile=0 rejected-exit=1 +keepalive mutant compile=0 rejected-exit=40 +ackstop mutant compile=0 rejected-exit=27 +pendingwire mutant compile=0 rejected-exit=1 +appcode mutant compile=0 rejected-exit=3 +thinking mutant compile=0 rejected-exit=6 +scenecap mutant compile=0 rejected-exit=3 +contextnote mutant compile=0 rejected-exit=5 +contextjob mutant compile=0 rejected-exit=36 +autosent mutant compile=0 rejected-exit=1 +framecheck mutant compile=0 rejected-exit=1 +ALLEN_OMEGA_HOST: PASS; target=NOT_RUN; live=NOT_RUN diff --git a/evidence/allen-omega-L694/L748/paint.log b/evidence/allen-omega-L694/L748/paint.log new file mode 100644 index 00000000..281a5bd2 --- /dev/null +++ b/evidence/allen-omega-L694/L748/paint.log @@ -0,0 +1,11 @@ +1101 0 +1102 0 +1103 0 +1104 0 +1105 0 +1106 0 +1107 0 +1108 0 +1109 0 +1110 0 +1111 0 diff --git a/evidence/allen-omega-L694/L748/pendingwire-mutant.log b/evidence/allen-omega-L694/L748/pendingwire-mutant.log new file mode 100644 index 00000000..48fb2008 --- /dev/null +++ b/evidence/allen-omega-L694/L748/pendingwire-mutant.log @@ -0,0 +1,182 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 1 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 diff --git a/evidence/allen-omega-L694/L748/process-red.exit b/evidence/allen-omega-L694/L748/process-red.exit new file mode 100644 index 00000000..d00491fd --- /dev/null +++ b/evidence/allen-omega-L694/L748/process-red.exit @@ -0,0 +1 @@ +1 diff --git a/evidence/allen-omega-L694/L748/process-red.log b/evidence/allen-omega-L694/L748/process-red.log new file mode 100644 index 00000000..6ee04194 --- /dev/null +++ b/evidence/allen-omega-L694/L748/process-red.log @@ -0,0 +1,5 @@ +1 0 +2 0 +3 0 +4 1 +5 0 diff --git a/evidence/allen-omega-L694/L748/process-red.receipt b/evidence/allen-omega-L694/L748/process-red.receipt new file mode 100644 index 00000000..968ac3ef --- /dev/null +++ b/evidence/allen-omega-L694/L748/process-red.receipt @@ -0,0 +1,4 @@ +1 +0 +0 +0 diff --git a/evidence/allen-omega-L694/L748/provider-bad-1.input b/evidence/allen-omega-L694/L748/provider-bad-1.input new file mode 100644 index 00000000..1f0e4517 Binary files /dev/null and b/evidence/allen-omega-L694/L748/provider-bad-1.input differ diff --git a/evidence/allen-omega-L694/L748/provider-bad-1.log b/evidence/allen-omega-L694/L748/provider-bad-1.log new file mode 100644 index 00000000..7da8e511 --- /dev/null +++ b/evidence/allen-omega-L694/L748/provider-bad-1.log @@ -0,0 +1,5 @@ +1 0 +2 0 +3 0 +4 0 +5 0 diff --git a/evidence/allen-omega-L694/L748/provider-bad-1.output b/evidence/allen-omega-L694/L748/provider-bad-1.output new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L748/provider-bad-1.receipt b/evidence/allen-omega-L694/L748/provider-bad-1.receipt new file mode 100644 index 00000000..2b29860a --- /dev/null +++ b/evidence/allen-omega-L694/L748/provider-bad-1.receipt @@ -0,0 +1,4 @@ +1 +65 +0 +0 diff --git a/evidence/allen-omega-L694/L748/provider-bad-1.stderr b/evidence/allen-omega-L694/L748/provider-bad-1.stderr new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L748/provider-bad-2.input b/evidence/allen-omega-L694/L748/provider-bad-2.input new file mode 100644 index 00000000..1db16c18 Binary files /dev/null and b/evidence/allen-omega-L694/L748/provider-bad-2.input differ diff --git a/evidence/allen-omega-L694/L748/provider-bad-2.log b/evidence/allen-omega-L694/L748/provider-bad-2.log new file mode 100644 index 00000000..7da8e511 --- /dev/null +++ b/evidence/allen-omega-L694/L748/provider-bad-2.log @@ -0,0 +1,5 @@ +1 0 +2 0 +3 0 +4 0 +5 0 diff --git a/evidence/allen-omega-L694/L748/provider-bad-2.output b/evidence/allen-omega-L694/L748/provider-bad-2.output new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L748/provider-bad-2.receipt b/evidence/allen-omega-L694/L748/provider-bad-2.receipt new file mode 100644 index 00000000..9ba12cca --- /dev/null +++ b/evidence/allen-omega-L694/L748/provider-bad-2.receipt @@ -0,0 +1,4 @@ +2 +65 +0 +0 diff --git a/evidence/allen-omega-L694/L748/provider-bad-2.stderr b/evidence/allen-omega-L694/L748/provider-bad-2.stderr new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L748/provider-bad-3.input b/evidence/allen-omega-L694/L748/provider-bad-3.input new file mode 100644 index 00000000..e57731f8 Binary files /dev/null and b/evidence/allen-omega-L694/L748/provider-bad-3.input differ diff --git a/evidence/allen-omega-L694/L748/provider-bad-3.log b/evidence/allen-omega-L694/L748/provider-bad-3.log new file mode 100644 index 00000000..7da8e511 --- /dev/null +++ b/evidence/allen-omega-L694/L748/provider-bad-3.log @@ -0,0 +1,5 @@ +1 0 +2 0 +3 0 +4 0 +5 0 diff --git a/evidence/allen-omega-L694/L748/provider-bad-3.output b/evidence/allen-omega-L694/L748/provider-bad-3.output new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L748/provider-bad-3.receipt b/evidence/allen-omega-L694/L748/provider-bad-3.receipt new file mode 100644 index 00000000..199cc204 --- /dev/null +++ b/evidence/allen-omega-L694/L748/provider-bad-3.receipt @@ -0,0 +1,4 @@ +3 +65 +0 +0 diff --git a/evidence/allen-omega-L694/L748/provider-bad-3.stderr b/evidence/allen-omega-L694/L748/provider-bad-3.stderr new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L748/provider-bad-4.input b/evidence/allen-omega-L694/L748/provider-bad-4.input new file mode 100644 index 00000000..f62d999f Binary files /dev/null and b/evidence/allen-omega-L694/L748/provider-bad-4.input differ diff --git a/evidence/allen-omega-L694/L748/provider-bad-4.log b/evidence/allen-omega-L694/L748/provider-bad-4.log new file mode 100644 index 00000000..7da8e511 --- /dev/null +++ b/evidence/allen-omega-L694/L748/provider-bad-4.log @@ -0,0 +1,5 @@ +1 0 +2 0 +3 0 +4 0 +5 0 diff --git a/evidence/allen-omega-L694/L748/provider-bad-4.output b/evidence/allen-omega-L694/L748/provider-bad-4.output new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L748/provider-bad-4.receipt b/evidence/allen-omega-L694/L748/provider-bad-4.receipt new file mode 100644 index 00000000..26a81c4a --- /dev/null +++ b/evidence/allen-omega-L694/L748/provider-bad-4.receipt @@ -0,0 +1,4 @@ +4 +65 +0 +0 diff --git a/evidence/allen-omega-L694/L748/provider-bad-4.stderr b/evidence/allen-omega-L694/L748/provider-bad-4.stderr new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L748/provider-bad-5.input b/evidence/allen-omega-L694/L748/provider-bad-5.input new file mode 100644 index 00000000..63f04014 Binary files /dev/null and b/evidence/allen-omega-L694/L748/provider-bad-5.input differ diff --git a/evidence/allen-omega-L694/L748/provider-bad-5.log b/evidence/allen-omega-L694/L748/provider-bad-5.log new file mode 100644 index 00000000..7da8e511 --- /dev/null +++ b/evidence/allen-omega-L694/L748/provider-bad-5.log @@ -0,0 +1,5 @@ +1 0 +2 0 +3 0 +4 0 +5 0 diff --git a/evidence/allen-omega-L694/L748/provider-bad-5.output b/evidence/allen-omega-L694/L748/provider-bad-5.output new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L748/provider-bad-5.receipt b/evidence/allen-omega-L694/L748/provider-bad-5.receipt new file mode 100644 index 00000000..d79f5995 --- /dev/null +++ b/evidence/allen-omega-L694/L748/provider-bad-5.receipt @@ -0,0 +1,4 @@ +5 +65 +0 +0 diff --git a/evidence/allen-omega-L694/L748/provider-bad-5.stderr b/evidence/allen-omega-L694/L748/provider-bad-5.stderr new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L748/provider-bad-6.input b/evidence/allen-omega-L694/L748/provider-bad-6.input new file mode 100644 index 00000000..fd23a175 Binary files /dev/null and b/evidence/allen-omega-L694/L748/provider-bad-6.input differ diff --git a/evidence/allen-omega-L694/L748/provider-bad-6.log b/evidence/allen-omega-L694/L748/provider-bad-6.log new file mode 100644 index 00000000..3f9cc45d --- /dev/null +++ b/evidence/allen-omega-L694/L748/provider-bad-6.log @@ -0,0 +1,17 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 diff --git a/evidence/allen-omega-L694/L748/provider-bad-6.output b/evidence/allen-omega-L694/L748/provider-bad-6.output new file mode 100644 index 00000000..58e9a74d Binary files /dev/null and b/evidence/allen-omega-L694/L748/provider-bad-6.output differ diff --git a/evidence/allen-omega-L694/L748/provider-bad-6.receipt b/evidence/allen-omega-L694/L748/provider-bad-6.receipt new file mode 100644 index 00000000..d0b7cd17 Binary files /dev/null and b/evidence/allen-omega-L694/L748/provider-bad-6.receipt differ diff --git a/evidence/allen-omega-L694/L748/provider-bad-6.stderr b/evidence/allen-omega-L694/L748/provider-bad-6.stderr new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L748/provider-boot.expected b/evidence/allen-omega-L694/L748/provider-boot.expected new file mode 100644 index 00000000..58e9a74d Binary files /dev/null and b/evidence/allen-omega-L694/L748/provider-boot.expected differ diff --git a/evidence/allen-omega-L694/L748/provider-consumer.log b/evidence/allen-omega-L694/L748/provider-consumer.log new file mode 100644 index 00000000..9c0592e2 --- /dev/null +++ b/evidence/allen-omega-L694/L748/provider-consumer.log @@ -0,0 +1,3 @@ +1 0 +2 0 +3 0 diff --git a/evidence/allen-omega-L694/L748/provider-consumer.receipt b/evidence/allen-omega-L694/L748/provider-consumer.receipt new file mode 100644 index 00000000..31d93b9d Binary files /dev/null and b/evidence/allen-omega-L694/L748/provider-consumer.receipt differ diff --git a/evidence/allen-omega-L694/L748/provider-core.log b/evidence/allen-omega-L694/L748/provider-core.log new file mode 100644 index 00000000..88d1b135 --- /dev/null +++ b/evidence/allen-omega-L694/L748/provider-core.log @@ -0,0 +1,100 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 diff --git a/evidence/allen-omega-L694/L748/provider-fragment.log b/evidence/allen-omega-L694/L748/provider-fragment.log new file mode 100644 index 00000000..d91084d1 --- /dev/null +++ b/evidence/allen-omega-L694/L748/provider-fragment.log @@ -0,0 +1,292 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 +183 0 +184 0 +185 0 +186 0 +187 0 +188 0 +189 0 +190 0 +191 0 +192 0 +193 0 +194 0 +195 0 +196 0 +197 0 +198 0 +199 0 +200 0 +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 +225 0 +226 0 +227 0 +228 0 +229 0 +230 0 +231 0 +232 0 +233 0 +234 0 +235 0 +236 0 +237 0 +238 0 +239 0 +240 0 +241 0 +242 0 +243 0 +244 0 +245 0 +246 0 +247 0 +248 0 +249 0 +250 0 +251 0 +252 0 +253 0 +254 0 +255 0 +256 0 +257 0 +258 0 +259 0 +260 0 +261 0 +262 0 +263 0 +264 0 +265 0 +266 0 +267 0 +268 0 +269 0 +270 0 +271 0 +272 0 +273 0 +274 0 +275 0 +276 0 +277 0 +278 0 +279 0 +280 0 +281 0 +282 0 +283 0 +284 0 +285 0 +286 0 +287 0 +288 0 +289 0 +290 0 +291 0 +292 0 diff --git a/evidence/allen-omega-L694/L748/provider-fragment.output b/evidence/allen-omega-L694/L748/provider-fragment.output new file mode 100644 index 00000000..12949c15 Binary files /dev/null and b/evidence/allen-omega-L694/L748/provider-fragment.output differ diff --git a/evidence/allen-omega-L694/L748/provider-fragment.stderr b/evidence/allen-omega-L694/L748/provider-fragment.stderr new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L748/provider-process.log b/evidence/allen-omega-L694/L748/provider-process.log new file mode 100644 index 00000000..9c0592e2 --- /dev/null +++ b/evidence/allen-omega-L694/L748/provider-process.log @@ -0,0 +1,3 @@ +1 0 +2 0 +3 0 diff --git a/evidence/allen-omega-L694/L748/provider-process.receipt b/evidence/allen-omega-L694/L748/provider-process.receipt new file mode 100644 index 00000000..31d93b9d Binary files /dev/null and b/evidence/allen-omega-L694/L748/provider-process.receipt differ diff --git a/evidence/allen-omega-L694/L748/provider-producer.log b/evidence/allen-omega-L694/L748/provider-producer.log new file mode 100644 index 00000000..9c0592e2 --- /dev/null +++ b/evidence/allen-omega-L694/L748/provider-producer.log @@ -0,0 +1,3 @@ +1 0 +2 0 +3 0 diff --git a/evidence/allen-omega-L694/L748/provider-producer.receipt b/evidence/allen-omega-L694/L748/provider-producer.receipt new file mode 100644 index 00000000..0967800c --- /dev/null +++ b/evidence/allen-omega-L694/L748/provider-producer.receipt @@ -0,0 +1,4 @@ +7 +0 +0 +0 diff --git a/evidence/allen-omega-L694/L748/provider-producer.stderr b/evidence/allen-omega-L694/L748/provider-producer.stderr new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L748/provider-stream.log b/evidence/allen-omega-L694/L748/provider-stream.log new file mode 100644 index 00000000..d91084d1 --- /dev/null +++ b/evidence/allen-omega-L694/L748/provider-stream.log @@ -0,0 +1,292 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 +183 0 +184 0 +185 0 +186 0 +187 0 +188 0 +189 0 +190 0 +191 0 +192 0 +193 0 +194 0 +195 0 +196 0 +197 0 +198 0 +199 0 +200 0 +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 +225 0 +226 0 +227 0 +228 0 +229 0 +230 0 +231 0 +232 0 +233 0 +234 0 +235 0 +236 0 +237 0 +238 0 +239 0 +240 0 +241 0 +242 0 +243 0 +244 0 +245 0 +246 0 +247 0 +248 0 +249 0 +250 0 +251 0 +252 0 +253 0 +254 0 +255 0 +256 0 +257 0 +258 0 +259 0 +260 0 +261 0 +262 0 +263 0 +264 0 +265 0 +266 0 +267 0 +268 0 +269 0 +270 0 +271 0 +272 0 +273 0 +274 0 +275 0 +276 0 +277 0 +278 0 +279 0 +280 0 +281 0 +282 0 +283 0 +284 0 +285 0 +286 0 +287 0 +288 0 +289 0 +290 0 +291 0 +292 0 diff --git a/evidence/allen-omega-L694/L748/provider.input b/evidence/allen-omega-L694/L748/provider.input new file mode 100644 index 00000000..95d75826 Binary files /dev/null and b/evidence/allen-omega-L694/L748/provider.input differ diff --git a/evidence/allen-omega-L694/L748/provider.output b/evidence/allen-omega-L694/L748/provider.output new file mode 100644 index 00000000..12949c15 Binary files /dev/null and b/evidence/allen-omega-L694/L748/provider.output differ diff --git a/evidence/allen-omega-L694/L748/provider.stderr b/evidence/allen-omega-L694/L748/provider.stderr new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L748/readback-mutant.log b/evidence/allen-omega-L694/L748/readback-mutant.log new file mode 100644 index 00000000..268002ad --- /dev/null +++ b/evidence/allen-omega-L694/L748/readback-mutant.log @@ -0,0 +1,79 @@ +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 0 +310 0 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 1 +339 1 +340 0 +341 0 +342 0 +343 0 +344 1 +345 0 +346 0 +347 0 +348 0 +349 1 +350 1 +351 0 +352 0 +362 0 +363 0 +353 1 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 1 +361 0 diff --git a/evidence/allen-omega-L694/L748/red.exit b/evidence/allen-omega-L694/L748/red.exit new file mode 100644 index 00000000..fff0a247 --- /dev/null +++ b/evidence/allen-omega-L694/L748/red.exit @@ -0,0 +1 @@ +74 diff --git a/evidence/allen-omega-L694/L748/red.log b/evidence/allen-omega-L694/L748/red.log new file mode 100644 index 00000000..ff14d3a5 --- /dev/null +++ b/evidence/allen-omega-L694/L748/red.log @@ -0,0 +1,97 @@ +1 1 +2 1 +3 1 +4 1 +5 0 +6 0 +7 0 +8 0 +9 0 +10 1 +11 1 +12 1 +13 0 +14 1 +15 1 +16 1 +17 1 +18 0 +19 1 +20 0 +21 1 +22 1 +23 1 +24 1 +25 1 +26 0 +27 0 +28 1 +29 0 +30 1 +31 1 +32 1 +33 1 +34 1 +35 1 +36 1 +37 0 +38 1 +39 0 +40 0 +41 1 +42 1 +43 1 +44 1 +45 1 +46 0 +47 1 +48 0 +49 1 +50 1 +51 1 +52 1 +53 0 +54 1 +55 1 +56 1 +57 1 +58 1 +59 1 +60 1 +61 1 +62 1 +63 1 +64 1 +65 0 +66 1 +67 1 +68 1 +69 1 +70 1 +71 1 +72 1 +73 1 +74 1 +75 0 +76 1 +77 1 +78 1 +79 1 +80 0 +81 1 +82 1 +83 1 +84 1 +85 1 +86 1 +87 1 +88 1 +89 1 +90 1 +91 1 +92 0 +93 0 +94 1 +95 0 +96 1 +97 1 diff --git a/evidence/allen-omega-L694/L748/red.om b/evidence/allen-omega-L694/L748/red.om new file mode 100644 index 00000000..2af11597 --- /dev/null +++ b/evidence/allen-omega-L694/L748/red.om @@ -0,0 +1,3691 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +fn prparse to bool +ret false +end +fn prdo to bool +ret false +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +text Fmagic "ALNPRV01" +text Hi "hi" +text Reply "SAY 1 1/1 hello" +text Askcode "write a calculator" +text Tinycode "CODE 2 1/1 2 d8932aac text hi" +text Done "SAY 2 1/1 Done." +global Held uchar 8192 +global Holdn ulong 2 +fn test ok bool to void +note Direct write logger would clobber the very datagram being tested. +put Holdn 0 get Outlen 0 +put Holdn 1 get Err 0 +for i ulong get Outlen 0 +put Held i get Outb i +end +check ok add get Checks 0 1 +for i ulong get Holdn 0 +put Outb i get Held i +end +put Outlen 0 get Holdn 0 +put Err 0 get Holdn 1 +end +fn hword off ulong v ulong to void +for i ulong 8 +put Ph add off i uchar and shr v mul i 8 255 +end +end +fn frame op ulong now ulong arg ulong size ulong to void +for i ulong 8 +put Ph i get Fmagic i +end +hword 8 op +hword 16 now +hword 24 arg +hword 32 size +end +fn oword off ulong to ulong +v = ulong 0 +for i ulong 8 +v = or v shl ulong get Pout add off i mul i 8 +end +ret v +end +fn receive part ulong size ulong to void +note Caller placed LINE payload in In; packet overwrites Outb, so preserve it. +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Held i get Outb i +end +put Inlen 0 size +b = packet 2 get Q 1 part 0 0 +size = get Outlen 0 +for i ulong size +put Pb i get Outb i +end +for i ulong n +put Outb i get Held i +end +put Outlen 0 n +put Err 0 e +frame 5 4294967297 0 size +end +fn main to int +frame 1 4294967296 77 0 +test prparse +test eq get Pv 0 1 +test eq get Pv 1 4294967296 +test eq get Pv 2 77 +put Ph 0 88 +test not prparse +frame 11 0 0 0 +test not prparse +frame 1 0 77 1 +test not prparse +frame 3 0 2 0 +test not prparse +frame 2 0 0 160 +test not prparse +frame 10 0 0 0 +test prdo +test eq oword 16 1 +test eq get Pc 0 1 +mset32 0 3 +mset32 36 1 +test memenc 10 +for i ulong 4096 +put Pb i get Enc i +end +frame 8 0 1 4096 +test prdo +test eq oword 16 1 +test eq get St 0 10 +test prdo +test eq oword 16 0 +frame 1 4294967296 77 0 +test prdo +test eq oword 16 0 +for i ulong 4096 +put Pb i 0 +end +frame 8 0 0 4096 +test prdo +test eq oword 16 2 +test eq get Pc 0 2 +test eq get St 0 10 +frame 1 4294967296 77 0 +test prdo +test eq oword 16 0 +put Ns 0 2 +put Ns 1 0 +put Ns 2 3 +put Ns 3 0 +put Note 0 78 +put Note 1 48 +test noteenc +for i ulong 4096 +put Pb i get Enc i +end +frame 9 0 1 4096 +test prdo +test eq oword 16 0 +frame 9 0 0 4096 +test prdo +test eq oword 16 1 +test eq get Pc 0 3 +frame 1 4294967296 77 0 +test prdo +test eq oword 16 1 +test eq get A 0 1 +test prdo +test eq oword 16 0 +frame 10 0 0 0 +test prdo +test eq oword 16 0 +test eq mem32 0 3 +frame 2 4294967297 0 len Hi +for i ulong len Hi +put Pb i get Hi i +end +test prdo +test eq oword 16 1 +test eq get R 0 1 +frame 3 4294967297 1 0 +test prdo +test eq oword 16 3 +test eq oword 32 get Outlen 0 +test eq get T 10 5 +same = true +for i ulong get Outlen 0 +if ne get Pout add i 40 get Outb i +same = false +end +end +test same +test prdo +test eq oword 16 1 +test eq get T 10 5 +frame 4 4294967297 0 0 +test prdo +test eq get T 3 0 +frame 3 4294967297 1 0 +test prdo +test eq oword 16 3 +frame 4 4294967297 1 0 +test prdo +test eq get T 3 1 +frame 3 4294967297 1 0 +test prdo +test eq get T 10 1 +for i ulong len Reply +put In i get Reply i +end +receive 1 len Reply +test prdo +test eq oword 16 1 +test eq oword 24 1 +test eq oword 32 5 +test eq get Pout 40 104 +test eq get R 1 0 +test eq get T 10 1 +test eq get Outb 0 65 +frame 4 4294967297 1 0 +test prdo +frame 3 4294967297 1 0 +test prdo +test eq oword 16 3 +test eq get T 10 3 +frame 4 4294967297 1 0 +test prdo +frame 3 4294967297 1 0 +test prdo +test eq oword 16 1 +test eq oword 32 0 +frame 2 4294967297 0 len Askcode +for i ulong len Askcode +put Pb i get Askcode i +end +test prdo +test eq oword 24 1 +test eq oword 32 len Ack +for i ulong len Tinycode +put In i get Tinycode i +end +receive 1 len Tinycode +test prdo +test eq oword 24 0 +frame 3 4294967297 1 0 +test prdo +frame 4 4294967297 1 0 +test prdo +for i ulong len Done +put In i get Done i +end +receive 2 len Done +test prdo +test eq oword 24 1 +test eq oword 32 5 +off = ulong 45 +test eq oword add off 8 11 +test eq oword add off 32 2 +test eq get Pout add off 40 104 +test eq get Pout add off 41 105 +test eq get Pn 0 add off 42 +frame 3 4294967296 1 0 +test prdo +test eq oword 16 0 +test eq oword 24 0 +frame 7 0 0 0 +test prdo +test eq get R 9 0 +test eq get R 0 2 +test eq get Q 1 2 +ret int get Fails 0 +end diff --git a/evidence/allen-omega-L694/L748/release.exit b/evidence/allen-omega-L694/L748/release.exit new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/L748/release.exit @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/L748/release.log b/evidence/allen-omega-L694/L748/release.log new file mode 100644 index 00000000..96ebefe9 --- /dev/null +++ b/evidence/allen-omega-L694/L748/release.log @@ -0,0 +1,43 @@ +runtime compile=0 native-exit=0 +code compile=0 native-exit=0 +courier compile=0 native-exit=0 +scheduler compile=0 native-exit=0 +application compile=0 native-exit=0 +provider-core compile=0 native-exit=0 +memory compile=0 native-exit=0 +context compile=0 native-exit=0 +intent compile=0 native-exit=0 +reply compile=0 native-exit=0 +view compile=0 native-exit=0 +scene compile=0 native-exit=0 +scene-input compile=0 native-exit=0 +paint compile=0 native-exit=0 +edges compile=0 native-exit=0 +fixture compile=0 native-exit=0 +golden compile=0 native-exit=0 +render compile=0 native-exit=0 +stdio native-exit=0 golden-cmp=0 +stdio overflow native-exit=65 no-later-command=PASS +provider malformed mode=1 exit=65 no-later-command=PASS +provider malformed mode=2 exit=65 no-later-command=PASS +provider malformed mode=3 exit=65 no-later-command=PASS +provider malformed mode=4 exit=65 no-later-command=PASS +provider malformed mode=5 exit=65 no-later-command=PASS +provider malformed mode=6 exit=65 no-later-command=PASS +provider native-exit=0 fragmented-pipe=0 output-verifier=0 +stale mutant compile=0 rejected-exit=3 +crc mutant compile=0 rejected-exit=2 +hash mutant compile=0 rejected-exit=2 +readback mutant compile=0 rejected-exit=7 +session mutant compile=0 rejected-exit=1 +keepalive mutant compile=0 rejected-exit=40 +ackstop mutant compile=0 rejected-exit=27 +pendingwire mutant compile=0 rejected-exit=1 +appcode mutant compile=0 rejected-exit=3 +thinking mutant compile=0 rejected-exit=6 +scenecap mutant compile=0 rejected-exit=3 +contextnote mutant compile=0 rejected-exit=5 +contextjob mutant compile=0 rejected-exit=36 +autosent mutant compile=0 rejected-exit=1 +framecheck mutant compile=0 rejected-exit=1 +ALLEN_OMEGA_HOST: PASS; target=NOT_RUN; live=NOT_RUN diff --git a/evidence/allen-omega-L694/L748/reply.log b/evidence/allen-omega-L694/L748/reply.log new file mode 100644 index 00000000..d11a72ad --- /dev/null +++ b/evidence/allen-omega-L694/L748/reply.log @@ -0,0 +1,15 @@ +801 0 +802 0 +803 0 +804 0 +805 0 +806 0 +807 0 +808 0 +809 0 +810 0 +811 0 +812 0 +813 0 +814 0 +815 0 diff --git a/evidence/allen-omega-L694/L748/runtime.log b/evidence/allen-omega-L694/L748/runtime.log new file mode 100644 index 00000000..5168e6f3 --- /dev/null +++ b/evidence/allen-omega-L694/L748/runtime.log @@ -0,0 +1,28 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 diff --git a/evidence/allen-omega-L694/L748/scene-input.log b/evidence/allen-omega-L694/L748/scene-input.log new file mode 100644 index 00000000..edd8e122 --- /dev/null +++ b/evidence/allen-omega-L694/L748/scene-input.log @@ -0,0 +1,63 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 diff --git a/evidence/allen-omega-L694/L748/scene.log b/evidence/allen-omega-L694/L748/scene.log new file mode 100644 index 00000000..44a4b2b1 --- /dev/null +++ b/evidence/allen-omega-L694/L748/scene.log @@ -0,0 +1,14 @@ +1001 0 +1002 0 +1003 0 +1004 0 +1005 0 +1006 0 +1007 0 +1008 0 +1009 0 +1010 0 +1011 0 +1012 0 +1013 0 +1014 0 diff --git a/evidence/allen-omega-L694/L748/scenecap-mutant.log b/evidence/allen-omega-L694/L748/scenecap-mutant.log new file mode 100644 index 00000000..502843ec --- /dev/null +++ b/evidence/allen-omega-L694/L748/scenecap-mutant.log @@ -0,0 +1,63 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 1 +60 0 +61 0 +62 1 +63 1 diff --git a/evidence/allen-omega-L694/L748/scheduler.log b/evidence/allen-omega-L694/L748/scheduler.log new file mode 100644 index 00000000..1d8ffd12 --- /dev/null +++ b/evidence/allen-omega-L694/L748/scheduler.log @@ -0,0 +1,213 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 +183 0 +184 0 +185 0 +186 0 +187 0 +188 0 +189 0 +190 0 +191 0 +192 0 +193 0 +194 0 +195 0 +196 0 +197 0 +198 0 +199 0 +200 0 +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 diff --git a/evidence/allen-omega-L694/L748/session-mutant.log b/evidence/allen-omega-L694/L748/session-mutant.log new file mode 100644 index 00000000..9ce7ef78 --- /dev/null +++ b/evidence/allen-omega-L694/L748/session-mutant.log @@ -0,0 +1,24 @@ +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 1 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 diff --git a/evidence/allen-omega-L694/L748/short.log b/evidence/allen-omega-L694/L748/short.log new file mode 100644 index 00000000..a9da2dc8 --- /dev/null +++ b/evidence/allen-omega-L694/L748/short.log @@ -0,0 +1,20 @@ +401 0 +410 0 +411 0 +412 0 +413 0 +414 0 +402 0 +403 0 +404 0 +405 0 +406 0 +700 0 +701 0 +702 0 +703 0 +704 0 +705 0 +407 0 +408 0 +409 0 diff --git a/evidence/allen-omega-L694/L748/source.sha256 b/evidence/allen-omega-L694/L748/source.sha256 new file mode 100644 index 00000000..11b9dd6e --- /dev/null +++ b/evidence/allen-omega-L694/L748/source.sha256 @@ -0,0 +1,51 @@ +56936108de0087499bb62a117a275f27b01d7bfb05eb8f6250f13ab8783e1095 native/omega/allen/application.om +184f4270c72c4eca6a7afdd28b70a608f2e237980b12c8a7bfc2c7d2c3e625b9 native/omega/allen/base.om +795ca28627a19f1088de0f23277e79cdac921ff88451c606c7b655ce0f2e8a5b native/omega/allen/build-one.sh +4d2235ac5d6b237695b1c3112f70ebdfa0cebafa2ec8e691e4be4de37a62199b native/omega/allen/code.om +75e86e193346a5548e596c84fa7d65aaeefd69f9979a648e0bf53f0f97cd9eb4 native/omega/allen/context.om +76ee9cdeaac036905c76dfa29f42bf5a78d1259ad1656adfaa24916c3b93550d native/omega/allen/courier.om +fc8434ba3c4eb22fef5f1c1bdceda032aa31b0165a10aefb8105fe8a4dcc9830 native/omega/allen/gate.sh +9d71a653870eeef678f95df04db9c38aedaadd06e7c74bf3e5d9fde6e28f82f8 native/omega/allen/golden.sh +06087bc573ebb876a0ed80f6025c592fb4b1d23335169c3da402824fd1482c35 native/omega/allen/intent.om +4bc37c95d553364c5d2925d8ff9e8a53b1a61974513e6f492f77b7ebb05bbda4 native/omega/allen/main.om +068292abd04d3a61b063fc5380b22a56c4235a87915c219ebf3b37d16d7bc9c7 native/omega/allen/memory.om +b4d7b6e6cd680d2ba1eec2978b0cbb81ffc63035b73f5c3726bdad97a7b6aa04 native/omega/allen/paint.om +330b31b81a60f3dc553b87316d2fa1c3df9106af5fe7975911ba00b8c356f626 native/omega/allen/provider-core.om +258b9c1f6a7447540c9a8b8cbf2176165ab3e5d80e9528e0b06c37ea745490c1 native/omega/allen/PROVIDER.md +ef0d5dcc14b68bf4ee24468db703fd7dc98ffd982e045c719d42a78e442546ba native/omega/allen/provider.om +2d6d84af7c653625ae62f8cd567ec3c64c5c730a87b89208ead4033aac9be183 native/omega/allen/README.md +e50a7f673aaee92aba4a3aec303aa93b071121c09ad05d4ad1dcc2deb9706dcc native/omega/allen/reply.om +5b01eae03204d08f6d207ef29f2ba09a1d9f249f1738f68f151214675a4ff2ed native/omega/allen/runtime.om +c16d61dbcb81f7ef8196c937929a53e47de3de0015e5d663bcd8e49b3cb05002 native/omega/allen/scene-input.om +c8d4a437b41538cc1eeb62a2029c6993d41e5ef90cc7b26c8e1c92bc98ec57d3 native/omega/allen/scene.om +615dff78462a715153b3d891b2cfe146c318d3a0a26ae1aaa642484f965c12df native/omega/allen/scheduler.om +f4e6bb5571a0700febdecfc6209ae1c088eab50a82bce4d8a10179408e3abb5f native/omega/allen/tests/application.om +f085198549d1c235a97574ff6f6560ce82217611f4051fc3dbbc8286aab6d536 native/omega/allen/tests/check.om +b76438a85257bd95768115047be286c107e3723628a16a0541870732d0849a42 native/omega/allen/tests/code.om +c61bb0ca8f70114e6fd180e9f9a48ec4d2f927152269c11bfc9df55dc13bc1bc native/omega/allen/tests/context.om +98105e1c30626f54da07940fe0415637730b7e112ea39ba2aae1f2d648993373 native/omega/allen/tests/courier.om +f524aab74657dc2e9e4330bf42bc05ef01ce3e8f08a05c80371be0c0a33764d3 native/omega/allen/tests/edges.om +a2e8bcde92d522216a4fa99559dd3bcba096aea86127364587dadcc2bfb585af native/omega/allen/tests/fixture.om +c9ef2bee7cbd1c072c6045d62c55f3bdd938901e91792cee72ea57fb8f25a198 native/omega/allen/tests/golden.om +8ba742d85ea510586f3cf86661bc0f28c5d99b59981c2d3fb220705efad24564 native/omega/allen/tests/intent.om +861d9af698b021056cceb6c00ae3458558db415963fe832d3fca7da55731cf7b native/omega/allen/tests/memory.om +13e4db7436165783c6aad48497ffe89fa6e5ba3de928e66a766c29e1e817fcf5 native/omega/allen/tests/paint.om +e6d232d92d74d88423cebbbbfc6e403ea9b865b80c909e1d23087001d905035a native/omega/allen/tests/probe.om +4b942849652c81ee775b6089e2696c059de934d7fd0ff2a81ae380b2b39ffbfe native/omega/allen/tests/provider-core.om +b98923bd7df278ed0cd8a46c90d90fda296e27c8d60afdd4848ed86dba8221cc native/omega/allen/tests/provider-input.om +37480ca89922dea787a7acb72835a0109b3549461791e7499789ed25932b397c native/omega/allen/tests/provider-mutants.om +d1b1338b2cabe207c1cd9a4bd92b11f51502c29af4b754e2b39fac06d80b28ed native/omega/allen/tests/provider-output.om +8616252944ac2f2903427a6cbf165137087addf3eff169f05f6801d38dac0962 native/omega/allen/tests/provider-process.om +8fbc8a0517900efd771a994686356416a0fea5e20cfd9bc26c787850398113df native/omega/allen/tests/render.om +094a5e833bae7dfd3b013e3f015f143e9d7bd3efe9b9c896a7f58b09e1ec14b8 native/omega/allen/tests/reply.om +bab9b0e853aa4b62918353a5d1625a3171deebfb639e599fe9751b5a61a3df62 native/omega/allen/tests/runtime.om +c5847b4ea0c7df81691fadf9af2f258ad02d3fa588a400448f6d34d7819570b4 native/omega/allen/tests/scene-input.om +b9c84d9a58658589137764fe60209d8320550dd8ed99fa6026df65ba48737e4f native/omega/allen/tests/scene.om +bf984fa9cf63ddb569147afc2a028ccdafdbeae2067125cf35d658e5d00f4c94 native/omega/allen/tests/scheduler.om +521fff50f312b64801017b1349d9a31dac6eac50eb989d93d2dbac4e100f5007 native/omega/allen/tests/stdio-overflow.om +89aee5326b428147ea6da9aa739b6679e214ed114ae5f41d3b70299cf864092c native/omega/allen/tests/view.om +0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0 native/omega/allen/vendor/OMEGA-LICENSE +b234738e8ce81b3d67586deb41fdaab4543169d4b69e86fd3dc28a08432ab5fc native/omega/allen/vendor/PROVENANCE.md +992ec4a4957271b442740598136887a5c610effcd8ae9fb9480a006a4f181097 native/omega/allen/vendor/sha256-core.om +0781cdcec18570a57afbe3be4a6717dd2d1fa4c887b49a3e4cb542b594f8a041 native/omega/allen/vendor/sha256.om +abbefd2f7dc48f2ac28b9526f5c2e5b369da4b7c5e84dde6e6a3cd20bd5687ac native/omega/allen/view.om diff --git a/evidence/allen-omega-L694/L748/stale-mutant.log b/evidence/allen-omega-L694/L748/stale-mutant.log new file mode 100644 index 00000000..ac2e3d09 --- /dev/null +++ b/evidence/allen-omega-L694/L748/stale-mutant.log @@ -0,0 +1,28 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 1 +7 1 +8 1 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 diff --git a/evidence/allen-omega-L694/L748/stdio-overflow.input b/evidence/allen-omega-L694/L748/stdio-overflow.input new file mode 100644 index 00000000..6103faf0 --- /dev/null +++ b/evidence/allen-omega-L694/L748/stdio-overflow.input @@ -0,0 +1,2 @@ +ASK xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +ASK hi diff --git a/evidence/allen-omega-L694/L748/stdio-overflow.stderr b/evidence/allen-omega-L694/L748/stdio-overflow.stderr new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L748/stream-green.exit b/evidence/allen-omega-L694/L748/stream-green.exit new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/L748/stream-green.exit @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/L748/stream-green.log b/evidence/allen-omega-L694/L748/stream-green.log new file mode 100644 index 00000000..d91084d1 --- /dev/null +++ b/evidence/allen-omega-L694/L748/stream-green.log @@ -0,0 +1,292 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 +183 0 +184 0 +185 0 +186 0 +187 0 +188 0 +189 0 +190 0 +191 0 +192 0 +193 0 +194 0 +195 0 +196 0 +197 0 +198 0 +199 0 +200 0 +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 +225 0 +226 0 +227 0 +228 0 +229 0 +230 0 +231 0 +232 0 +233 0 +234 0 +235 0 +236 0 +237 0 +238 0 +239 0 +240 0 +241 0 +242 0 +243 0 +244 0 +245 0 +246 0 +247 0 +248 0 +249 0 +250 0 +251 0 +252 0 +253 0 +254 0 +255 0 +256 0 +257 0 +258 0 +259 0 +260 0 +261 0 +262 0 +263 0 +264 0 +265 0 +266 0 +267 0 +268 0 +269 0 +270 0 +271 0 +272 0 +273 0 +274 0 +275 0 +276 0 +277 0 +278 0 +279 0 +280 0 +281 0 +282 0 +283 0 +284 0 +285 0 +286 0 +287 0 +288 0 +289 0 +290 0 +291 0 +292 0 diff --git a/evidence/allen-omega-L694/L748/stream-red.exit b/evidence/allen-omega-L694/L748/stream-red.exit new file mode 100644 index 00000000..d00491fd --- /dev/null +++ b/evidence/allen-omega-L694/L748/stream-red.exit @@ -0,0 +1 @@ +1 diff --git a/evidence/allen-omega-L694/L748/stream-red.log b/evidence/allen-omega-L694/L748/stream-red.log new file mode 100644 index 00000000..2fb73a07 --- /dev/null +++ b/evidence/allen-omega-L694/L748/stream-red.log @@ -0,0 +1 @@ +1 1 diff --git a/evidence/allen-omega-L694/L748/stream-red.om b/evidence/allen-omega-L694/L748/stream-red.om new file mode 100644 index 00000000..ba121bdf --- /dev/null +++ b/evidence/allen-omega-L694/L748/stream-red.om @@ -0,0 +1,3685 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +fn main to int +ret 0 +end diff --git a/evidence/allen-omega-L694/L748/stream-verifier.exit b/evidence/allen-omega-L694/L748/stream-verifier.exit new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/L748/stream-verifier.exit @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/L748/summary.json b/evidence/allen-omega-L694/L748/summary.json new file mode 100644 index 00000000..03b6d108 --- /dev/null +++ b/evidence/allen-omega-L694/L748/summary.json @@ -0,0 +1,62 @@ +{ + "base": "be28deb21721f54fc46b5402076c7e8ac8fde151", + "compiler_sha256": "191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9", + "provider_sha256": "c9367d4cbc9261ebc0faaf3a99c2988ee36abda197670d868bd202a3bb19cccd", + "checks": { + "runtime": 28, + "code": 23, + "courier": 24, + "scheduler": 213, + "application": 182, + "provider-core": 100, + "memory": 79, + "context": 142, + "intent": 8, + "reply": 15, + "view": 13, + "scene": 14, + "scene-input": 63, + "paint": 11, + "edges": 352, + "short": 20, + "long": 292, + "provider-stream": 292, + "provider-fragment": 292, + "provider-process": 3, + "provider-consumer": 3, + "provider-producer": 3, + "provider-bad-1": 5, + "provider-bad-2": 5, + "provider-bad-3": 5, + "provider-bad-4": 5, + "provider-bad-5": 5, + "provider-bad-6": 17 + }, + "total_checks": 2214, + "compiled_rejected_mutants": { + "ackstop-mutant": 27, + "appcode-mutant": 3, + "autosent-mutant": 8, + "contextjob-mutant": 36, + "contextnote-mutant": 5, + "crc-mutant": 2, + "framecheck-mutant": 4, + "hash-mutant": 2, + "keepalive-mutant": 40, + "pendingwire-mutant": 1, + "readback-mutant": 7, + "scenecap-mutant": 3, + "session-mutant": 1, + "stale-mutant": 3, + "thinking-mutant": 6 + }, + "scope": "AArch64 Linux host streams only; live transport/storage/clock/device/x86/iMac NOT_RUN", + "review_L747": { + "pin": "be28deb21721f54fc46b5402076c7e8ac8fde151", + "source_files": 43, + "parent_probe_sha256": "4a53ec429504131fd48a6f2931a7244053ab9013291d46841dc69545addcabd6", + "parent_checks": 150, + "report_sha256": "ce5862d96c8f8f2b6dd11596f1f16f8996b336aad88ef98051a5b7bf626385d3", + "verdict": "No findings; original failed probe retained as expectation error; host-only." + } +} diff --git a/evidence/allen-omega-L694/L748/thinking-mutant.log b/evidence/allen-omega-L694/L748/thinking-mutant.log new file mode 100644 index 00000000..74b41a12 --- /dev/null +++ b/evidence/allen-omega-L694/L748/thinking-mutant.log @@ -0,0 +1,63 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 1 +15 1 +16 0 +17 0 +18 0 +19 1 +20 1 +21 1 +22 1 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 diff --git a/evidence/allen-omega-L694/L748/view.log b/evidence/allen-omega-L694/L748/view.log new file mode 100644 index 00000000..8b194f11 --- /dev/null +++ b/evidence/allen-omega-L694/L748/view.log @@ -0,0 +1,13 @@ +901 0 +902 0 +903 0 +904 0 +905 0 +906 0 +907 0 +908 0 +909 0 +910 0 +911 0 +912 0 +913 0 diff --git a/evidence/allen-omega-L694/L756/README.md b/evidence/allen-omega-L694/L756/README.md new file mode 100644 index 00000000..e49caab1 --- /dev/null +++ b/evidence/allen-omega-L694/L756/README.md @@ -0,0 +1,22 @@ +# L756 stable application presentation + +Parent-authored seeded Omega binding calls real application ASK/receive functions +and projects accepted event1 into stable scene and completed-code snapshots. +The dedicated suite has75 passing assertions; actual full counts and native hashes +are in summary.json. Initial compilable stub failed42/65; expanded stub failed48/75. +Original failures are retained. Full gate passed and17 compiled mutants were +rejected, including two new Omega-constructed stale-event/input-tail mutations. + +Run: `quiet-build native/omega/allen/gate.sh /absolute/fresh/private/output`. +The emitted `presentation` ELF executes the dedicated actual courier/application +integration tests. New behavior checks, fixtures and mutant construction are Omega; +existing host orchestration builds/connects/collects and compares artifacts. + +Input buffer restoration includes unused bytes touched by decoder normalization. +Invalid/hidden replies retain the prior scene; failed receive cannot replay stale +A2. Completed code snapshots do not alias later Code assembly, and reset zeros the +retained presentation bytes. A code completion with empty closing text can still +update the code snapshot. The current provider stream remains unchanged and does +not invoke the new display wrappers. This does not render pixels or qualify a +live model, multiline model-scene transport, display device or physical iMac. +Independent final-source review remains required. diff --git a/evidence/allen-omega-L694/L756/ackstop-mutant.log b/evidence/allen-omega-L694/L756/ackstop-mutant.log new file mode 100644 index 00000000..5d0598cb --- /dev/null +++ b/evidence/allen-omega-L694/L756/ackstop-mutant.log @@ -0,0 +1,213 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 1 +65 1 +66 0 +67 0 +68 0 +69 1 +70 1 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 1 +165 0 +166 0 +167 0 +168 0 +169 1 +170 0 +171 1 +172 1 +173 0 +174 1 +175 0 +176 0 +177 0 +178 1 +179 0 +180 1 +181 0 +182 1 +183 0 +184 1 +185 0 +186 1 +187 0 +188 1 +189 0 +190 1 +191 0 +192 1 +193 0 +194 1 +195 1 +196 1 +197 1 +198 0 +199 1 +200 0 +201 0 +202 1 +203 1 +204 1 +205 0 +206 1 +207 1 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 diff --git a/evidence/allen-omega-L694/L756/appcode-mutant.log b/evidence/allen-omega-L694/L756/appcode-mutant.log new file mode 100644 index 00000000..c9c50601 --- /dev/null +++ b/evidence/allen-omega-L694/L756/appcode-mutant.log @@ -0,0 +1,182 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 1 +76 1 +77 1 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 diff --git a/evidence/allen-omega-L694/L756/application.log b/evidence/allen-omega-L694/L756/application.log new file mode 100644 index 00000000..2e8a428d --- /dev/null +++ b/evidence/allen-omega-L694/L756/application.log @@ -0,0 +1,182 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 diff --git a/evidence/allen-omega-L694/L756/autosent-mutant.log b/evidence/allen-omega-L694/L756/autosent-mutant.log new file mode 100644 index 00000000..2aed7f8a --- /dev/null +++ b/evidence/allen-omega-L694/L756/autosent-mutant.log @@ -0,0 +1,100 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 1 +48 0 +49 0 +50 1 +51 1 +52 0 +53 1 +54 0 +55 1 +56 0 +57 0 +58 0 +59 1 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 1 +70 0 +71 0 +72 0 +73 0 +74 1 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 diff --git a/evidence/allen-omega-L694/L756/binaries.sha256 b/evidence/allen-omega-L694/L756/binaries.sha256 new file mode 100644 index 00000000..5546f5cf --- /dev/null +++ b/evidence/allen-omega-L694/L756/binaries.sha256 @@ -0,0 +1,44 @@ +dbd72f4bb8bf510d8dc806d03a4419fac3cf4962da3c2e4d0720a6a64489c374 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/provider-core +f082cb8a3f730e32735e4d77ddd89f7b6c2e071f06a9352fb3be822ce6b9ebaf /home/drakestapleton/handoffs/allen-omega-L694/L756/full/scheduler +c924f171425228c3eb4f1d9ab8fd5756fa49294a2cbe8ff18d7df6cc916f34ca /home/drakestapleton/handoffs/allen-omega-L694/L756/full/readback-mutant +f0ec39a426c16eb215436256eb4fbccf54388786e81b87bee835f40e450b8be2 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/view +e2dda6a519494e3ee4c08ec67d1a8c6ee8deb749600243ee2e30d86c17346b3c /home/drakestapleton/handoffs/allen-omega-L694/L756/full/contextnote-mutant +bde7745dea1708f0b8d8d5dacd2fbd9b2db276d52d29ea4a465398f8cc0f8851 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/allen +3bedb5b9b50698c0996d0c7b7ce821e8c7b071f59e09576a32a0d52af6c2d656 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/reply +d133ea1d28887edefc50f27341384ce109e5a9e7de4de895edb0fa41593a6c2a /home/drakestapleton/handoffs/allen-omega-L694/L756/full/thinking-mutant +17665a6e3bd858133f22640ae22ee1af7ad9176cabedae86dcdfde8babd5aa68 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/inputtail-mutant +f9d95a1ceb021d0048bb3cef4984c847ccd256bf4e203f82200f23d564d654dd /home/drakestapleton/handoffs/allen-omega-L694/L756/full/ackstop-mutant +6a25eb5dee199e400229565772f9f0a05d3b3d9cc6e2a544cd5ef0ebae45b380 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/hash-mutant +6f2a323dbdd1c49a6bf1b5850a0686d6aeb3b77502c4a72954ff9993e37daa29 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/golden +b6fa715cf46fbf64c69fd48fdd7183e0ecaf253d698ef8499891f3e525a8ba8f /home/drakestapleton/handoffs/allen-omega-L694/L756/full/session-mutant +b88af4d93bf1b1b402db86e14428140332b49b0d42dbdaa568ef964584f4c4c7 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/scene-input +4c5bca3bc2e7ba2ee9bd564bbd6782437b0cc65b0283480b91108c9ffc9936f8 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/intent +ef364c43870518d683445eee0f6ba9f31ffeda2bd04d422e7fef8263927f08ea /home/drakestapleton/handoffs/allen-omega-L694/L756/full/provider-input +b8712e936cf9486b221dc35d38ee18831c82a90ef68aaea39e0cf78e492cad09 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/fixture +66d1c4e8808581680a2e3dd36d1a9acc5305190374baf9b3e91d902d61a91c6b /home/drakestapleton/handoffs/allen-omega-L694/L756/full/provider +c7683c702399f7ea261d40f75e56163dbed59f55515aa0a3ac92dd5f6d860b4f /home/drakestapleton/handoffs/allen-omega-L694/L756/full/context +2577490ab1061c813839d940f48627a7d666b0e0b1a77c1e9dfa1ca862486bc5 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/staleview-mutant +502d23245559a8cd7fce4e77f8c1b65cd2a6d78892b9d932da28893e5c8adad9 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/runtime +284d4355b5b0e6599064ac937477252bd3149bd2ef26540cc3eaf7f5324567fb /home/drakestapleton/handoffs/allen-omega-L694/L756/full/code +52ffd81fe79089c4e03accba53621f9f90c52d6ae2be6e33fdd0f09e42c07642 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/provider-mutants +90436e21d335d4b363dc93f5d38b1ecb172f3dc0e105a3d2eb59b55d3f005987 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/edges +a389d7dd2f8de1f6d69d888c3ddec7e0fa293ed8eec0504b43d35d2ca79e2463 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/presentation-mutants +c8ed6389d2dd725ca08b7c86f64ace2958862bc4d521a11b4f9ebd5b42f57b79 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/appcode-mutant +8c3e5136ff1f916f905eb02e2272e6aa646023ae25cf7ebe23954a042327ab36 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/render +a8e784178ce41ff0a49e8fb025d36d0f81ed5699459f10f64a0e358ab192fb14 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/stale-mutant +6d73fbe8a0b457326bb150dadc2e6df6b533f57dabc6d654a9a2d62845e31e88 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/courier +79cb2f9586d9c62c62bd804226a6b84138796021000c896a68c834f8551393be /home/drakestapleton/handoffs/allen-omega-L694/L756/full/scene +749a510e3d8922cd7ef28a733b08f46687be36706585261e37f2a3cd6792ab40 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/presentation +33d8c38b63a5ad49461f77b12edcab1715e9d937f6f36db40591949f14b02915 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/pendingwire-mutant +305f7dff2885285b9dab36fe21963f4fb8f0a07e290a041cce16cc32034db70c /home/drakestapleton/handoffs/allen-omega-L694/L756/full/framecheck-mutant +a5fcc51aff461160fc0ee76c5b6c7572fe7614516b8c787e22023e80d006d4c9 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/scenecap-mutant +6180bd76635a73dfdd67868f9f54f0ddcd9fbae5bf454ef489014c1666d0f89b /home/drakestapleton/handoffs/allen-omega-L694/L756/full/contextjob-mutant +0b894efb1f7fdd49cc479175a7fdcfad32112775465c702c0cd5ce9cadfdedde /home/drakestapleton/handoffs/allen-omega-L694/L756/full/paint +df192da44184396bbf6d1a69f4cc971d5453ee01da600cf3a10d600495e9be8f /home/drakestapleton/handoffs/allen-omega-L694/L756/full/crc-mutant +2c388e855a3b2fe9faf204136a03150cbd6dfecb8515e703006f234bec92d51e /home/drakestapleton/handoffs/allen-omega-L694/L756/full/autosent-mutant +2442d67aa0951561442e25fd841693b121ed25475246e318847740e1eb83e87a /home/drakestapleton/handoffs/allen-omega-L694/L756/full/provider-output +71f99242bcad6ede239b240602470fcf3d5da3267eb47a1ad522241958222367 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/stdio-overflow-input +9914acec8db6305f76ae8fd3dd5f48147da60b97c65d0b4e1b19435ece236166 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/keepalive-mutant +8dbfde8dbf2aa5faf113a88b37cc4ee7e8fe545f8e289ea79a3fa046c311d7c2 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/provider-process +7c9f6ffbb1453febc08b803fbf7a496cadc719e65581f604cdc0004313414ef9 /home/drakestapleton/handoffs/allen-omega-L694/L756/full/memory +7d28b14e96244fc0a640483ab4821dbfa9f79d35e1241dafb7fa0391099286dd /home/drakestapleton/handoffs/allen-omega-L694/L756/full/application diff --git a/evidence/allen-omega-L694/L756/code.log b/evidence/allen-omega-L694/L756/code.log new file mode 100644 index 00000000..e7e197b7 --- /dev/null +++ b/evidence/allen-omega-L694/L756/code.log @@ -0,0 +1,23 @@ +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 diff --git a/evidence/allen-omega-L694/L756/context.log b/evidence/allen-omega-L694/L756/context.log new file mode 100644 index 00000000..df62cddb --- /dev/null +++ b/evidence/allen-omega-L694/L756/context.log @@ -0,0 +1,142 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 diff --git a/evidence/allen-omega-L694/L756/contextjob-mutant.log b/evidence/allen-omega-L694/L756/contextjob-mutant.log new file mode 100644 index 00000000..3432d4b2 --- /dev/null +++ b/evidence/allen-omega-L694/L756/contextjob-mutant.log @@ -0,0 +1,142 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 1 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 1 +72 1 +73 1 +74 1 +75 1 +76 1 +77 0 +78 0 +79 1 +80 1 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 1 +88 1 +89 0 +90 1 +91 0 +92 1 +93 0 +94 1 +95 0 +96 1 +97 0 +98 1 +99 0 +100 1 +101 0 +102 1 +103 0 +104 1 +105 0 +106 1 +107 0 +108 1 +109 1 +110 1 +111 1 +112 1 +113 1 +114 1 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 1 +123 0 +124 1 +125 0 +126 1 +127 0 +128 1 +129 0 +130 1 +131 0 +132 1 +133 0 +134 1 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 1 +142 1 diff --git a/evidence/allen-omega-L694/L756/contextnote-mutant.log b/evidence/allen-omega-L694/L756/contextnote-mutant.log new file mode 100644 index 00000000..b5c08759 --- /dev/null +++ b/evidence/allen-omega-L694/L756/contextnote-mutant.log @@ -0,0 +1,142 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 1 +38 1 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 1 +47 0 +48 1 +49 0 +50 0 +51 0 +52 0 +53 0 +54 1 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 diff --git a/evidence/allen-omega-L694/L756/courier.log b/evidence/allen-omega-L694/L756/courier.log new file mode 100644 index 00000000..8402df49 --- /dev/null +++ b/evidence/allen-omega-L694/L756/courier.log @@ -0,0 +1,24 @@ +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 diff --git a/evidence/allen-omega-L694/L756/crc-mutant.log b/evidence/allen-omega-L694/L756/crc-mutant.log new file mode 100644 index 00000000..a0d90bd4 --- /dev/null +++ b/evidence/allen-omega-L694/L756/crc-mutant.log @@ -0,0 +1,23 @@ +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 1 +117 1 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 diff --git a/evidence/allen-omega-L694/L756/edges.log b/evidence/allen-omega-L694/L756/edges.log new file mode 100644 index 00000000..e8d0deea --- /dev/null +++ b/evidence/allen-omega-L694/L756/edges.log @@ -0,0 +1,352 @@ +1201 0 +1202 0 +1203 0 +1204 0 +1205 0 +1206 0 +1207 0 +1208 0 +1209 0 +1210 0 +1211 0 +1212 0 +1213 0 +1214 0 +1220 0 +1221 0 +1222 0 +1223 0 +1224 0 +1225 0 +1226 0 +1227 0 +1228 0 +1229 0 +1230 0 +1231 0 +1232 0 +1233 0 +1234 0 +1235 0 +1236 0 +1237 0 +1238 0 +1239 0 +1240 0 +1241 0 +1242 0 +1243 0 +1244 0 +1245 0 +1246 0 +1247 0 +1248 0 +1249 0 +1250 0 +1251 0 +1252 0 +1253 0 +1254 0 +1255 0 +1256 0 +1257 0 +1258 0 +1259 0 +1260 0 +1261 0 +1262 0 +1301 0 +1302 0 +1303 0 +1304 0 +1305 0 +1306 0 +1310 0 +1311 0 +1312 0 +1313 0 +1314 0 +1315 0 +1316 0 +1317 0 +1318 0 +1319 0 +1320 0 +1321 0 +1322 0 +1323 0 +1324 0 +1325 0 +1326 0 +1327 0 +1328 0 +1329 0 +1330 0 +1331 0 +1332 0 +1333 0 +1334 0 +1335 0 +1336 0 +1337 0 +1338 0 +1339 0 +1340 0 +1341 0 +1342 0 +1343 0 +1344 0 +1345 0 +1346 0 +1347 0 +1348 0 +1349 0 +1350 0 +1351 0 +1352 0 +1353 0 +1354 0 +1355 0 +1356 0 +1357 0 +1358 0 +1359 0 +1360 0 +1361 0 +1362 0 +1363 0 +1364 0 +1365 0 +1366 0 +1367 0 +1368 0 +1369 0 +1370 0 +1371 0 +1372 0 +1373 0 +1374 0 +1375 0 +1376 0 +1377 0 +1378 0 +1379 0 +1380 0 +1381 0 +1382 0 +1383 0 +1384 0 +1385 0 +1386 0 +1387 0 +1388 0 +1389 0 +1390 0 +1391 0 +1392 0 +1393 0 +1394 0 +1395 0 +1396 0 +1397 0 +1398 0 +1399 0 +1400 0 +1401 0 +1402 0 +1403 0 +1404 0 +1405 0 +1406 0 +1407 0 +1408 0 +1409 0 +1410 0 +1411 0 +1412 0 +1413 0 +1414 0 +1415 0 +1416 0 +1417 0 +1418 0 +1419 0 +1420 0 +1421 0 +1422 0 +1423 0 +1424 0 +1425 0 +1426 0 +1427 0 +1428 0 +1429 0 +1430 0 +1431 0 +1432 0 +1433 0 +1434 0 +1435 0 +1436 0 +1437 0 +1438 0 +1439 0 +1440 0 +1441 0 +1442 0 +1443 0 +1444 0 +1445 0 +1446 0 +1447 0 +1448 0 +1449 0 +1450 0 +1451 0 +1452 0 +1453 0 +1454 0 +1455 0 +1456 0 +1457 0 +1458 0 +1459 0 +1460 0 +1461 0 +1462 0 +1463 0 +1464 0 +1465 0 +1466 0 +1467 0 +1468 0 +1469 0 +1470 0 +1471 0 +1472 0 +1473 0 +1474 0 +1475 0 +1476 0 +1477 0 +1478 0 +1479 0 +1480 0 +1481 0 +1482 0 +1483 0 +1484 0 +1485 0 +1486 0 +1487 0 +1488 0 +1489 0 +1490 0 +1491 0 +1492 0 +1493 0 +1494 0 +1495 0 +1496 0 +1497 0 +1498 0 +1499 0 +1500 0 +1501 0 +1502 0 +1503 0 +1504 0 +1505 0 +1506 0 +1507 0 +1508 0 +1509 0 +1510 0 +1511 0 +1512 0 +1513 0 +1514 0 +1515 0 +1516 0 +1517 0 +1518 0 +1519 0 +1520 0 +1521 0 +1522 0 +1523 0 +1524 0 +1525 0 +1526 0 +1527 0 +1528 0 +1529 0 +1530 0 +1531 0 +1532 0 +1533 0 +1534 0 +1535 0 +1536 0 +1537 0 +1538 0 +1539 0 +1540 0 +1541 0 +1542 0 +1543 0 +1544 0 +1545 0 +1546 0 +1547 0 +1548 0 +1549 0 +1550 0 +1551 0 +1552 0 +1553 0 +1554 0 +1555 0 +1556 0 +1557 0 +1558 0 +1559 0 +1560 0 +1561 0 +1562 0 +1563 0 +1564 0 +1565 0 +1570 0 +1571 0 +1572 0 +1575 0 +1573 0 +1574 0 +1600 0 +1601 0 +1602 0 +1603 0 +1604 0 +1605 0 +1606 0 +1607 0 +1610 0 +1611 0 +1612 0 +1613 0 +1614 0 +1615 0 +1616 0 +1617 0 +1701 0 +1702 0 +1703 0 +1704 0 +1705 0 +1706 0 +1707 0 +1708 0 +1709 0 +1710 0 +1711 0 diff --git a/evidence/allen-omega-L694/L756/framecheck-mutant.log b/evidence/allen-omega-L694/L756/framecheck-mutant.log new file mode 100644 index 00000000..d5454577 --- /dev/null +++ b/evidence/allen-omega-L694/L756/framecheck-mutant.log @@ -0,0 +1,100 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 1 +7 1 +8 1 +9 1 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 diff --git a/evidence/allen-omega-L694/L756/full.exit b/evidence/allen-omega-L694/L756/full.exit new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/L756/full.exit @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/L756/full.log b/evidence/allen-omega-L694/L756/full.log new file mode 100644 index 00000000..1fd32bb3 --- /dev/null +++ b/evidence/allen-omega-L694/L756/full.log @@ -0,0 +1,46 @@ +runtime compile=0 native-exit=0 +code compile=0 native-exit=0 +courier compile=0 native-exit=0 +scheduler compile=0 native-exit=0 +application compile=0 native-exit=0 +provider-core compile=0 native-exit=0 +presentation compile=0 native-exit=0 +memory compile=0 native-exit=0 +context compile=0 native-exit=0 +intent compile=0 native-exit=0 +reply compile=0 native-exit=0 +view compile=0 native-exit=0 +scene compile=0 native-exit=0 +scene-input compile=0 native-exit=0 +paint compile=0 native-exit=0 +edges compile=0 native-exit=0 +fixture compile=0 native-exit=0 +golden compile=0 native-exit=0 +render compile=0 native-exit=0 +stdio native-exit=0 golden-cmp=0 +stdio overflow native-exit=65 no-later-command=PASS +provider malformed mode=1 exit=65 no-later-command=PASS +provider malformed mode=2 exit=65 no-later-command=PASS +provider malformed mode=3 exit=65 no-later-command=PASS +provider malformed mode=4 exit=65 no-later-command=PASS +provider malformed mode=5 exit=65 no-later-command=PASS +provider malformed mode=6 exit=65 no-later-command=PASS +provider native-exit=0 fragmented-pipe=0 output-verifier=0 +stale mutant compile=0 rejected-exit=3 +crc mutant compile=0 rejected-exit=2 +hash mutant compile=0 rejected-exit=2 +readback mutant compile=0 rejected-exit=7 +session mutant compile=0 rejected-exit=1 +keepalive mutant compile=0 rejected-exit=40 +ackstop mutant compile=0 rejected-exit=27 +pendingwire mutant compile=0 rejected-exit=1 +appcode mutant compile=0 rejected-exit=3 +thinking mutant compile=0 rejected-exit=6 +scenecap mutant compile=0 rejected-exit=3 +contextnote mutant compile=0 rejected-exit=5 +contextjob mutant compile=0 rejected-exit=36 +autosent mutant compile=0 rejected-exit=1 +framecheck mutant compile=0 rejected-exit=1 +staleview mutant compile=0 rejected-exit=1 +inputtail mutant compile=0 rejected-exit=1 +ALLEN_OMEGA_HOST: PASS; target=NOT_RUN; live=NOT_RUN diff --git a/evidence/allen-omega-L694/L756/green.exit b/evidence/allen-omega-L694/L756/green.exit new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/L756/green.exit @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/L756/green.log b/evidence/allen-omega-L694/L756/green.log new file mode 100644 index 00000000..d664fe1a --- /dev/null +++ b/evidence/allen-omega-L694/L756/green.log @@ -0,0 +1,65 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 diff --git a/evidence/allen-omega-L694/L756/green2.exit b/evidence/allen-omega-L694/L756/green2.exit new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/L756/green2.exit @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/L756/green2.log b/evidence/allen-omega-L694/L756/green2.log new file mode 100644 index 00000000..84fd2470 --- /dev/null +++ b/evidence/allen-omega-L694/L756/green2.log @@ -0,0 +1,75 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 diff --git a/evidence/allen-omega-L694/L756/hash-mutant.log b/evidence/allen-omega-L694/L756/hash-mutant.log new file mode 100644 index 00000000..c75cfefb --- /dev/null +++ b/evidence/allen-omega-L694/L756/hash-mutant.log @@ -0,0 +1,79 @@ +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 1 +310 1 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +362 0 +363 0 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 0 +361 0 diff --git a/evidence/allen-omega-L694/L756/independent-review/inventory.json b/evidence/allen-omega-L694/L756/independent-review/inventory.json new file mode 100644 index 00000000..33670e68 --- /dev/null +++ b/evidence/allen-omega-L694/L756/independent-review/inventory.json @@ -0,0 +1,23 @@ +{ + "parent-presentation.log": "c70283fce8aed93e379bc19bafb276f22205243190cb31fd3ce69305d5d6d1e4", + "parent-verification.json": "d06ab9c173583e8d4e2188572a9868dfbe63a7e1f8cf2c3955b8dfc5ad12da38", + "presentation-raw-baseline.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa", + "presentation-raw-baseline.log": "c43d43223e83f0d34b868be1fa08b0fa42386f72938a8f59e24811f84aad37e7", + "presentation-raw-builds.sha256": "ba65b36145c57d39a184d0e0860d25c63d68af724f615e49278f1e894fd02f52", + "presentation-raw-compiler.sha256": "41cfc578c1aa995e9b8ff0547c18acd2d9d2816680b57b0da1ba613b133d4cf4", + "presentation-raw-git.paths": "937afa12f2100e3238411dd137f39bbe440a9f1a757d409c7df1f301c92079b4", + "presentation-raw-independent.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa", + "presentation-raw-independent.log": "c70283fce8aed93e379bc19bafb276f22205243190cb31fd3ce69305d5d6d1e4", + "presentation-raw-inputs.sha256": "8b311896eb65a4b6e21cf4cbcb34cb0f12c6607659e1dd927dae071873262454", + "presentation-raw-membership.diff": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "presentation-raw-pins.txt": "f620e0ce2e30efb3aad74ea72692f513d4fb2089750d3cd8e587f8cab6f7f36b", + "presentation-raw-release.paths": "937afa12f2100e3238411dd137f39bbe440a9f1a757d409c7df1f301c92079b4", + "presentation-raw-report.sha256": "7031f47e4e4053ecaddbd93fb08c2549856e43d0aa3727130d9960a7b898c6f5", + "presentation-raw-test.elf.txt": "a743f4617cce0d3fb232ecb7550031547ac6a27a68e66aa13770b067e880713b", + "presentation-raw-unchanged-components.txt": "9489025413baa12b849ef9d4929418ce641e81ac6b54674a26fc7cd48a62cb8f", + "probes/core.om": "65db52e4ec165ae64b71b7a2c68c6263890ecf6fc9cc9f27db68e2374dcfcbf0", + "probes/presentation-independent-test.om": "f61bbfb08538a90a7581c557bd269d978c181f36d9baed20b3c489b284e52bf6", + "probes/presentation-independent.om": "ee622283ade68902f510791723276401659d8b71f8e9d9ac63c5feadb5a842d8", + "probes/presentation-test.om": "96bd651b8ba1f63ea982e41028a52c52940edd0037f28b953b6c7ba7363de683", + "report.md": "5b5c647c0a2e787078910173ef1cb7da47285a0cecf189e7b53f5464ed3bc1ee" +} diff --git a/evidence/allen-omega-L694/L756/independent-review/parent-presentation.log b/evidence/allen-omega-L694/L756/independent-review/parent-presentation.log new file mode 100644 index 00000000..038ad8e4 --- /dev/null +++ b/evidence/allen-omega-L694/L756/independent-review/parent-presentation.log @@ -0,0 +1,23 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 diff --git a/evidence/allen-omega-L694/L756/independent-review/parent-verification.json b/evidence/allen-omega-L694/L756/independent-review/parent-verification.json new file mode 100644 index 00000000..89a7a954 --- /dev/null +++ b/evidence/allen-omega-L694/L756/independent-review/parent-verification.json @@ -0,0 +1,34 @@ +{ + "source_closures": [ + { + "pin": "43eae848f0a44604b42378d9ea3170278b5f3f8f", + "files": 51, + "core_sha256": "f5984ce7290b7853446ca2bc2d192d76dfd13bd90dad2c97c5acfd5720f95ba5" + }, + { + "pin": "4c7888f65dca209a1e2b859ba695ae308657c03e", + "files": 55, + "core_sha256": "65db52e4ec165ae64b71b7a2c68c6263890ecf6fc9cc9f27db68e2374dcfcbf0" + } + ], + "provider_review_checks": { + "provider-core.log": 100, + "provider-normal.check.log": 292, + "provider-fragment.check.log": 292, + "provider-boundary-final.log": 26, + "provider-semantic-check.log": 38, + "provider-partial-write-check-final.log": 83, + "short-1.check.log": 5, + "short-2.check.log": 5, + "short-3.check.log": 5, + "short-4.check.log": 5, + "short-5.check.log": 5, + "short-6.check.log": 17 + }, + "presentation_review_checks": 98, + "parent_provider_sha256": "c9367d4cbc9261ebc0faaf3a99c2988ee36abda197670d868bd202a3bb19cccd", + "parent_presentation_sha256": "24285077f8ff55875bac7834cb711f28b116ee11b5dd055fdd12bbfb7756c8aa", + "parent_presentation_checks": 23, + "report_sha256": "5b5c647c0a2e787078910173ef1cb7da47285a0cecf189e7b53f5464ed3bc1ee", + "scope": "Host only; no correctness findings; original raw failures and scope limits retained." +} diff --git a/evidence/allen-omega-L694/L756/independent-review/presentation-raw-baseline.exit b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-baseline.exit new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-baseline.exit @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/L756/independent-review/presentation-raw-baseline.log b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-baseline.log new file mode 100644 index 00000000..84fd2470 --- /dev/null +++ b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-baseline.log @@ -0,0 +1,75 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 diff --git a/evidence/allen-omega-L694/L756/independent-review/presentation-raw-builds.sha256 b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-builds.sha256 new file mode 100644 index 00000000..abef6ce6 --- /dev/null +++ b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-builds.sha256 @@ -0,0 +1,2 @@ +749a510e3d8922cd7ef28a733b08f46687be36706585261e37f2a3cd6792ab40 /home/drakestapleton/handoffs/L753-review/presentation-build/presentation-test +24285077f8ff55875bac7834cb711f28b116ee11b5dd055fdd12bbfb7756c8aa /home/drakestapleton/handoffs/L753-review/presentation-build/presentation-independent-test diff --git a/evidence/allen-omega-L694/L756/independent-review/presentation-raw-compiler.sha256 b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-compiler.sha256 new file mode 100644 index 00000000..50e79ea9 --- /dev/null +++ b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-compiler.sha256 @@ -0,0 +1 @@ +191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9 /home/drakestapleton/handoffs/allen-omega-L694/omc diff --git a/evidence/allen-omega-L694/L756/independent-review/presentation-raw-git.paths b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-git.paths new file mode 100644 index 00000000..77755a9c --- /dev/null +++ b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-git.paths @@ -0,0 +1,55 @@ +native/omega/allen/application.om +native/omega/allen/base.om +native/omega/allen/build-one.sh +native/omega/allen/code.om +native/omega/allen/context.om +native/omega/allen/courier.om +native/omega/allen/gate.sh +native/omega/allen/golden.sh +native/omega/allen/intent.om +native/omega/allen/main.om +native/omega/allen/memory.om +native/omega/allen/paint.om +native/omega/allen/PRESENTATION.md +native/omega/allen/presentation.om +native/omega/allen/provider-core.om +native/omega/allen/PROVIDER.md +native/omega/allen/provider.om +native/omega/allen/README.md +native/omega/allen/reply.om +native/omega/allen/runtime.om +native/omega/allen/scene-input.om +native/omega/allen/scene.om +native/omega/allen/scheduler.om +native/omega/allen/tests/application.om +native/omega/allen/tests/check.om +native/omega/allen/tests/code.om +native/omega/allen/tests/context.om +native/omega/allen/tests/courier.om +native/omega/allen/tests/edges.om +native/omega/allen/tests/fixture.om +native/omega/allen/tests/golden.om +native/omega/allen/tests/intent.om +native/omega/allen/tests/memory.om +native/omega/allen/tests/paint.om +native/omega/allen/tests/presentation-mutants.om +native/omega/allen/tests/presentation.om +native/omega/allen/tests/probe.om +native/omega/allen/tests/provider-core.om +native/omega/allen/tests/provider-input.om +native/omega/allen/tests/provider-mutants.om +native/omega/allen/tests/provider-output.om +native/omega/allen/tests/provider-process.om +native/omega/allen/tests/render.om +native/omega/allen/tests/reply.om +native/omega/allen/tests/runtime.om +native/omega/allen/tests/scene-input.om +native/omega/allen/tests/scene.om +native/omega/allen/tests/scheduler.om +native/omega/allen/tests/stdio-overflow.om +native/omega/allen/tests/view.om +native/omega/allen/vendor/OMEGA-LICENSE +native/omega/allen/vendor/PROVENANCE.md +native/omega/allen/vendor/sha256-core.om +native/omega/allen/vendor/sha256.om +native/omega/allen/view.om diff --git a/evidence/allen-omega-L694/L756/independent-review/presentation-raw-independent.exit b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-independent.exit new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-independent.exit @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/L756/independent-review/presentation-raw-independent.log b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-independent.log new file mode 100644 index 00000000..038ad8e4 --- /dev/null +++ b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-independent.log @@ -0,0 +1,23 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 diff --git a/evidence/allen-omega-L694/L756/independent-review/presentation-raw-inputs.sha256 b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-inputs.sha256 new file mode 100644 index 00000000..2fda5321 --- /dev/null +++ b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-inputs.sha256 @@ -0,0 +1,21 @@ +184f4270c72c4eca6a7afdd28b70a608f2e237980b12c8a7bfc2c7d2c3e625b9 /home/drakestapleton/handoffs/L753-review/presentation-source/native/omega/allen/base.om +992ec4a4957271b442740598136887a5c610effcd8ae9fb9480a006a4f181097 /home/drakestapleton/handoffs/L753-review/presentation-source/native/omega/allen/vendor/sha256-core.om +5b01eae03204d08f6d207ef29f2ba09a1d9f249f1738f68f151214675a4ff2ed /home/drakestapleton/handoffs/L753-review/presentation-source/native/omega/allen/runtime.om +4d2235ac5d6b237695b1c3112f70ebdfa0cebafa2ec8e691e4be4de37a62199b /home/drakestapleton/handoffs/L753-review/presentation-source/native/omega/allen/code.om +76ee9cdeaac036905c76dfa29f42bf5a78d1259ad1656adfaa24916c3b93550d /home/drakestapleton/handoffs/L753-review/presentation-source/native/omega/allen/courier.om +615dff78462a715153b3d891b2cfe146c318d3a0a26ae1aaa642484f965c12df /home/drakestapleton/handoffs/L753-review/presentation-source/native/omega/allen/scheduler.om +068292abd04d3a61b063fc5380b22a56c4235a87915c219ebf3b37d16d7bc9c7 /home/drakestapleton/handoffs/L753-review/presentation-source/native/omega/allen/memory.om +06087bc573ebb876a0ed80f6025c592fb4b1d23335169c3da402824fd1482c35 /home/drakestapleton/handoffs/L753-review/presentation-source/native/omega/allen/intent.om +e50a7f673aaee92aba4a3aec303aa93b071121c09ad05d4ad1dcc2deb9706dcc /home/drakestapleton/handoffs/L753-review/presentation-source/native/omega/allen/reply.om +abbefd2f7dc48f2ac28b9526f5c2e5b369da4b7c5e84dde6e6a3cd20bd5687ac /home/drakestapleton/handoffs/L753-review/presentation-source/native/omega/allen/view.om +c8d4a437b41538cc1eeb62a2029c6993d41e5ef90cc7b26c8e1c92bc98ec57d3 /home/drakestapleton/handoffs/L753-review/presentation-source/native/omega/allen/scene.om +b4d7b6e6cd680d2ba1eec2978b0cbb81ffc63035b73f5c3726bdad97a7b6aa04 /home/drakestapleton/handoffs/L753-review/presentation-source/native/omega/allen/paint.om +56936108de0087499bb62a117a275f27b01d7bfb05eb8f6250f13ab8783e1095 /home/drakestapleton/handoffs/L753-review/presentation-source/native/omega/allen/application.om +c16d61dbcb81f7ef8196c937929a53e47de3de0015e5d663bcd8e49b3cb05002 /home/drakestapleton/handoffs/L753-review/presentation-source/native/omega/allen/scene-input.om +75e86e193346a5548e596c84fa7d65aaeefd69f9979a648e0bf53f0f97cd9eb4 /home/drakestapleton/handoffs/L753-review/presentation-source/native/omega/allen/context.om +330b31b81a60f3dc553b87316d2fa1c3df9106af5fe7975911ba00b8c356f626 /home/drakestapleton/handoffs/L753-review/presentation-source/native/omega/allen/provider-core.om +d3e3004fb587f75514c638b8b723c996303f664a74b653a6fc674f4600288d41 /home/drakestapleton/handoffs/L753-review/presentation-source/native/omega/allen/presentation.om +f085198549d1c235a97574ff6f6560ce82217611f4051fc3dbbc8286aab6d536 /home/drakestapleton/handoffs/L753-review/presentation-source/native/omega/allen/tests/check.om +b051af93057752c3d361e1aa5a4dc31bd0853e09d2d2a213d82a282f5709f641 /home/drakestapleton/handoffs/L753-review/presentation-source/native/omega/allen/tests/presentation.om +795ca28627a19f1088de0f23277e79cdac921ff88451c606c7b655ce0f2e8a5b /home/drakestapleton/handoffs/L753-review/presentation-source/native/omega/allen/build-one.sh +ee622283ade68902f510791723276401659d8b71f8e9d9ac63c5feadb5a842d8 /home/drakestapleton/handoffs/L753-review/presentation-build/presentation-independent.om diff --git a/evidence/allen-omega-L694/L756/independent-review/presentation-raw-membership.diff b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-membership.diff new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L756/independent-review/presentation-raw-pins.txt b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-pins.txt new file mode 100644 index 00000000..c1707f88 --- /dev/null +++ b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-pins.txt @@ -0,0 +1,2 @@ +pin=4c7888f65dca209a1e2b859ba695ae308657c03e +base=43eae848f0a44604b42378d9ea3170278b5f3f8f diff --git a/evidence/allen-omega-L694/L756/independent-review/presentation-raw-release.paths b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-release.paths new file mode 100644 index 00000000..77755a9c --- /dev/null +++ b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-release.paths @@ -0,0 +1,55 @@ +native/omega/allen/application.om +native/omega/allen/base.om +native/omega/allen/build-one.sh +native/omega/allen/code.om +native/omega/allen/context.om +native/omega/allen/courier.om +native/omega/allen/gate.sh +native/omega/allen/golden.sh +native/omega/allen/intent.om +native/omega/allen/main.om +native/omega/allen/memory.om +native/omega/allen/paint.om +native/omega/allen/PRESENTATION.md +native/omega/allen/presentation.om +native/omega/allen/provider-core.om +native/omega/allen/PROVIDER.md +native/omega/allen/provider.om +native/omega/allen/README.md +native/omega/allen/reply.om +native/omega/allen/runtime.om +native/omega/allen/scene-input.om +native/omega/allen/scene.om +native/omega/allen/scheduler.om +native/omega/allen/tests/application.om +native/omega/allen/tests/check.om +native/omega/allen/tests/code.om +native/omega/allen/tests/context.om +native/omega/allen/tests/courier.om +native/omega/allen/tests/edges.om +native/omega/allen/tests/fixture.om +native/omega/allen/tests/golden.om +native/omega/allen/tests/intent.om +native/omega/allen/tests/memory.om +native/omega/allen/tests/paint.om +native/omega/allen/tests/presentation-mutants.om +native/omega/allen/tests/presentation.om +native/omega/allen/tests/probe.om +native/omega/allen/tests/provider-core.om +native/omega/allen/tests/provider-input.om +native/omega/allen/tests/provider-mutants.om +native/omega/allen/tests/provider-output.om +native/omega/allen/tests/provider-process.om +native/omega/allen/tests/render.om +native/omega/allen/tests/reply.om +native/omega/allen/tests/runtime.om +native/omega/allen/tests/scene-input.om +native/omega/allen/tests/scene.om +native/omega/allen/tests/scheduler.om +native/omega/allen/tests/stdio-overflow.om +native/omega/allen/tests/view.om +native/omega/allen/vendor/OMEGA-LICENSE +native/omega/allen/vendor/PROVENANCE.md +native/omega/allen/vendor/sha256-core.om +native/omega/allen/vendor/sha256.om +native/omega/allen/view.om diff --git a/evidence/allen-omega-L694/L756/independent-review/presentation-raw-report.sha256 b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-report.sha256 new file mode 100644 index 00000000..b4759630 --- /dev/null +++ b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-report.sha256 @@ -0,0 +1 @@ +5b5c647c0a2e787078910173ef1cb7da47285a0cecf189e7b53f5464ed3bc1ee /home/drakestapleton/handoffs/L753-review/presentation-report.md diff --git a/evidence/allen-omega-L694/L756/independent-review/presentation-raw-test.elf.txt b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-test.elf.txt new file mode 100644 index 00000000..edfa8ba8 --- /dev/null +++ b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-test.elf.txt @@ -0,0 +1,30 @@ +ELF Header: + Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 + Class: ELF64 + Data: 2's complement, little endian + Version: 1 (current) + OS/ABI: UNIX - System V + ABI Version: 0 + Type: EXEC (Executable file) + Machine: AArch64 + Version: 0x1 + Entry point address: 0x4000b0 + Start of program headers: 64 (bytes into file) + Start of section headers: 0 (bytes into file) + Flags: 0x0 + Size of this header: 64 (bytes) + Size of program headers: 56 (bytes) + Number of program headers: 2 + Size of section headers: 0 (bytes) + Number of section headers: 0 + Section header string table index: 0 + +Program Headers: + Type Offset VirtAddr PhysAddr + FileSiz MemSiz Flags Align + LOAD 0x0000000000000000 0x0000000000400000 0x0000000000400000 + 0x00000000000163b4 0x00000000000163b4 R E 0x1000 + LOAD 0x0000000000000000 0x0000000010000000 0x0000000010000000 + 0x0000000000000000 0x00000000008aa550 RW 0x1000 + +There is no dynamic section in this file. diff --git a/evidence/allen-omega-L694/L756/independent-review/presentation-raw-unchanged-components.txt b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-unchanged-components.txt new file mode 100644 index 00000000..0898f52d --- /dev/null +++ b/evidence/allen-omega-L694/L756/independent-review/presentation-raw-unchanged-components.txt @@ -0,0 +1,9 @@ +provider-core.om f76cc2b90b2873e6ca2fc69bdcdb2c18a0db642f +provider.om afa9bfc5ee8a9aea618bd487f75c19f7bd0c81ad +application.om 734efeeb803de5e962a8f33e1df54286ea4a30a8 +scene.om 376fd36150c85bd2e9774e8e7a1ef7204911457d +view.om c221d15800df5edebba013ea50d8d57354898a6d +code.om 059c85c946b1423c67d236ed5fd00b87378e3986 +scheduler.om a36dda950acb551e347be4af19223bbae92229cb +context.om 401d4185ee2e13a614c0da788e8b8b64a013fb30 +memory.om 08342ab6636b54dc9870cdd51d0d56266ecf98ae diff --git a/evidence/allen-omega-L694/L756/independent-review/probes/core.om b/evidence/allen-omega-L694/L756/independent-review/probes/core.om new file mode 100644 index 00000000..f1bfd2b1 --- /dev/null +++ b/evidence/allen-omega-L694/L756/independent-review/probes/core.om @@ -0,0 +1,3816 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +note Stable application presentation; see PRESENTATION.md for scope and ownership. +global Ds ulong 8 +global Dt ulong 64 +global Dtext uchar 2304 +global Dsay ulong 1 +global Dm ulong 3 +global Dcode uchar 32768 +global Dstart ulong 4096 +global Dlen ulong 4096 +global Dline ulong 4096 +global Dview ulong 3 +global Din uchar 8192 +fn dscene to bool +n = get Inlen 0 +for i ulong 8192 +put Din i get In i +end +for i ulong get R 8 +put In i get Answer i +end +put Inlen 0 get R 8 +ok = scdecode +for i ulong 8192 +put In i get Din i +end +put Inlen 0 n +if not ok +ret false +end +for i ulong 8 +put Ds i get Sc i +end +for i ulong 64 +put Dt i get Things i +end +for i ulong 2304 +put Dtext i 0 +end +for i ulong get Sc 4 +put Dtext i get Stext i +end +put Dsay 0 get Sw 3 +put Dm 0 1 +ret true +end +fn dcode to bool +if or le get R 2 1 ne get R 1 0 +ret false +end +if or eq get R 6 0 ne get C 0 get R 0 +ret false +end +if not rows 80 4096 +ret false +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong get C 2 +put Dcode i get Code i +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong get View 0 +put Dstart i get Rowst i +put Dlen i get Rowlen i +put Dline i get Rowline i +end +put Dview 0 get View 0 +put Dview 1 0 +put Dview 2 get C 2 +put Dm 1 1 +ret true +end +fn dpresent to bool +if or eq get A 0 0 ne get A 2 1 +ret false +end +if or gt get R 8 159 gt get Inlen 0 8192 +ret false +end +shown = dscene +coded = dcode +if or shown coded +put Dm 2 get R 0 +ret true +end +ret false +end +fn dask now ulong to bool +if not appask now +ret false +end +b = dpresent +ret true +end +fn drecv now ulong to bool +if not appreceive now +ret false +end +b = dpresent +ret true +end +fn dreset to void +appreset +for i ulong 8 +put Ds i 0 +end +for i ulong 64 +put Dt i 0 +end +for i ulong 2304 +put Dtext i 0 +end +put Dsay 0 0 +for i ulong 3 +put Dm i 0 +put Dview i 0 +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong 8192 +put Din i 0 +end +end diff --git a/evidence/allen-omega-L694/L756/independent-review/probes/presentation-independent-test.om b/evidence/allen-omega-L694/L756/independent-review/probes/presentation-independent-test.om new file mode 100644 index 00000000..1989fa31 --- /dev/null +++ b/evidence/allen-omega-L694/L756/independent-review/probes/presentation-independent-test.om @@ -0,0 +1,3940 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +note Stable application presentation; see PRESENTATION.md for scope and ownership. +global Ds ulong 8 +global Dt ulong 64 +global Dtext uchar 2304 +global Dsay ulong 1 +global Dm ulong 3 +global Dcode uchar 32768 +global Dstart ulong 4096 +global Dlen ulong 4096 +global Dline ulong 4096 +global Dview ulong 3 +global Din uchar 8192 +fn dscene to bool +n = get Inlen 0 +for i ulong 8192 +put Din i get In i +end +for i ulong get R 8 +put In i get Answer i +end +put Inlen 0 get R 8 +ok = scdecode +for i ulong 8192 +put In i get Din i +end +put Inlen 0 n +if not ok +ret false +end +for i ulong 8 +put Ds i get Sc i +end +for i ulong 64 +put Dt i get Things i +end +for i ulong 2304 +put Dtext i 0 +end +for i ulong get Sc 4 +put Dtext i get Stext i +end +put Dsay 0 get Sw 3 +put Dm 0 1 +ret true +end +fn dcode to bool +if or le get R 2 1 ne get R 1 0 +ret false +end +if or eq get R 6 0 ne get C 0 get R 0 +ret false +end +if not rows 80 4096 +ret false +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong get C 2 +put Dcode i get Code i +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong get View 0 +put Dstart i get Rowst i +put Dlen i get Rowlen i +put Dline i get Rowline i +end +put Dview 0 get View 0 +put Dview 1 0 +put Dview 2 get C 2 +put Dm 1 1 +ret true +end +fn dpresent to bool +if or eq get A 0 0 ne get A 2 1 +ret false +end +if or gt get R 8 159 gt get Inlen 0 8192 +ret false +end +shown = dscene +coded = dcode +if or shown coded +put Dm 2 get R 0 +ret true +end +ret false +end +fn dask now ulong to bool +if not appask now +ret false +end +b = dpresent +ret true +end +fn drecv now ulong to bool +if not appreceive now +ret false +end +b = dpresent +ret true +end +fn dreset to void +appreset +for i ulong 8 +put Ds i 0 +end +for i ulong 64 +put Dt i 0 +end +for i ulong 2304 +put Dtext i 0 +end +put Dsay 0 0 +for i ulong 3 +put Dm i 0 +put Dview i 0 +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong 8192 +put Din i 0 +end +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +fn ptest ok bool to void +check ok add get Checks 0 1 +end +fn main to int +dreset +for i ulong 2304 +put Dtext i 81 +end +for i ulong 32768 +put Dcode i 90 +end +for i ulong 4096 +put Dstart i 1 +put Dlen i 2 +put Dline i 3 +end +for i ulong 8192 +put Din i 65 +put In i 66 +end +put Dm 0 1 +put Dm 1 1 +put Dm 2 42 +put Dsay 0 81 +put Dview 0 1 +put Dview 1 2 +put Dview 2 3 +put Ds 0 9 +put Dt 0 8 +put Inlen 0 1 +put A 0 1 +put A 2 0 +put R 8 0 +ptest not dpresent +ptest eq get Dm 2 42 +ptest eq get Dtext 0 81 +ptest eq get Dcode 0 90 +put A 2 1 +put R 8 160 +ptest not dpresent +ptest eq get Dtext 0 81 +ptest eq get Dcode 0 90 +put R 8 0 +ptest not dpresent +ptest eq get Dm 0 1 +ptest eq get Dm 1 1 +ptest eq get Dm 2 42 +ptest eq get Dsay 0 81 +dreset +ptest eq get Dm 0 0 +ptest eq get Dm 1 0 +ptest eq get Dm 2 0 +ptest eq get Dsay 0 0 +same = true +for i ulong 3 +if ne get Dview i 0 +same = false +end +end +ptest same +same = true +for i ulong 8 +if ne get Ds i 0 +same = false +end +end +ptest same +same = true +for i ulong 64 +if ne get Dt i 0 +same = false +end +end +ptest same +same = true +for i ulong 2304 +if ne get Dtext i 0 +same = false +end +end +ptest same +same = true +for i ulong 32768 +if ne get Dcode i 0 +same = false +end +end +ptest same +same = true +for i ulong 4096 +if ne or or get Dstart i get Dlen i get Dline i 0 +same = false +end +end +ptest same +same = true +for i ulong 8192 +if ne get Din i 0 +same = false +end +end +ptest same +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L756/independent-review/probes/presentation-independent.om b/evidence/allen-omega-L694/L756/independent-review/probes/presentation-independent.om new file mode 100644 index 00000000..72084f7d --- /dev/null +++ b/evidence/allen-omega-L694/L756/independent-review/probes/presentation-independent.om @@ -0,0 +1,107 @@ +fn ptest ok bool to void +check ok add get Checks 0 1 +end +fn main to int +dreset +for i ulong 2304 +put Dtext i 81 +end +for i ulong 32768 +put Dcode i 90 +end +for i ulong 4096 +put Dstart i 1 +put Dlen i 2 +put Dline i 3 +end +for i ulong 8192 +put Din i 65 +put In i 66 +end +put Dm 0 1 +put Dm 1 1 +put Dm 2 42 +put Dsay 0 81 +put Dview 0 1 +put Dview 1 2 +put Dview 2 3 +put Ds 0 9 +put Dt 0 8 +put Inlen 0 1 +put A 0 1 +put A 2 0 +put R 8 0 +ptest not dpresent +ptest eq get Dm 2 42 +ptest eq get Dtext 0 81 +ptest eq get Dcode 0 90 +put A 2 1 +put R 8 160 +ptest not dpresent +ptest eq get Dtext 0 81 +ptest eq get Dcode 0 90 +put R 8 0 +ptest not dpresent +ptest eq get Dm 0 1 +ptest eq get Dm 1 1 +ptest eq get Dm 2 42 +ptest eq get Dsay 0 81 +dreset +ptest eq get Dm 0 0 +ptest eq get Dm 1 0 +ptest eq get Dm 2 0 +ptest eq get Dsay 0 0 +same = true +for i ulong 3 +if ne get Dview i 0 +same = false +end +end +ptest same +same = true +for i ulong 8 +if ne get Ds i 0 +same = false +end +end +ptest same +same = true +for i ulong 64 +if ne get Dt i 0 +same = false +end +end +ptest same +same = true +for i ulong 2304 +if ne get Dtext i 0 +same = false +end +end +ptest same +same = true +for i ulong 32768 +if ne get Dcode i 0 +same = false +end +end +ptest same +same = true +for i ulong 4096 +if ne or or get Dstart i get Dlen i get Dline i 0 +same = false +end +end +ptest same +same = true +for i ulong 8192 +if ne get Din i 0 +same = false +end +end +ptest same +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L756/independent-review/probes/presentation-test.om b/evidence/allen-omega-L694/L756/independent-review/probes/presentation-test.om new file mode 100644 index 00000000..c8c700af --- /dev/null +++ b/evidence/allen-omega-L694/L756/independent-review/probes/presentation-test.om @@ -0,0 +1,4071 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +note Stable application presentation; see PRESENTATION.md for scope and ownership. +global Ds ulong 8 +global Dt ulong 64 +global Dtext uchar 2304 +global Dsay ulong 1 +global Dm ulong 3 +global Dcode uchar 32768 +global Dstart ulong 4096 +global Dlen ulong 4096 +global Dline ulong 4096 +global Dview ulong 3 +global Din uchar 8192 +fn dscene to bool +n = get Inlen 0 +for i ulong 8192 +put Din i get In i +end +for i ulong get R 8 +put In i get Answer i +end +put Inlen 0 get R 8 +ok = scdecode +for i ulong 8192 +put In i get Din i +end +put Inlen 0 n +if not ok +ret false +end +for i ulong 8 +put Ds i get Sc i +end +for i ulong 64 +put Dt i get Things i +end +for i ulong 2304 +put Dtext i 0 +end +for i ulong get Sc 4 +put Dtext i get Stext i +end +put Dsay 0 get Sw 3 +put Dm 0 1 +ret true +end +fn dcode to bool +if or le get R 2 1 ne get R 1 0 +ret false +end +if or eq get R 6 0 ne get C 0 get R 0 +ret false +end +if not rows 80 4096 +ret false +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong get C 2 +put Dcode i get Code i +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong get View 0 +put Dstart i get Rowst i +put Dlen i get Rowlen i +put Dline i get Rowline i +end +put Dview 0 get View 0 +put Dview 1 0 +put Dview 2 get C 2 +put Dm 1 1 +ret true +end +fn dpresent to bool +if or eq get A 0 0 ne get A 2 1 +ret false +end +if or gt get R 8 159 gt get Inlen 0 8192 +ret false +end +shown = dscene +coded = dcode +if or shown coded +put Dm 2 get R 0 +ret true +end +ret false +end +fn dask now ulong to bool +if not appask now +ret false +end +b = dpresent +ret true +end +fn drecv now ulong to bool +if not appreceive now +ret false +end +b = dpresent +ret true +end +fn dreset to void +appreset +for i ulong 8 +put Ds i 0 +end +for i ulong 64 +put Dt i 0 +end +for i ulong 2304 +put Dtext i 0 +end +put Dsay 0 0 +for i ulong 3 +put Dm i 0 +put Dview i 0 +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong 8192 +put Din i 0 +end +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +text Prompt1 "hello" +text Leak "LEAK" +text Scene1 "SAY 1 1/1 note left: Heading | Body" +text Hidden1 "private" +text Badscene "number: nope" +text Prompt2 "write a calculator" +text Code2 "CODE 2 1/1 2 d8932aac text hi" +text Done2 "SAY 2 1/1 Done." +global Saved uchar 8192 +global Keep ulong 2 +global Before uchar 8192 +global Wire uchar 8192 +fn test ok bool to void +put Keep 0 get Outlen 0 +put Keep 1 get Err 0 +for i ulong get Outlen 0 +put Saved i get Outb i +end +check ok add get Checks 0 1 +for i ulong get Keep 0 +put Outb i get Saved i +end +put Outlen 0 get Keep 0 +put Err 0 get Keep 1 +end +fn inbound part ulong to void +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Before i get Outb i +end +b = packet 2 get Q 1 part 0 0 +size = get Outlen 0 +for i ulong size +put In i get Outb i +end +put Inlen 0 size +for i ulong n +put Outb i get Before i +end +put Outlen 0 n +put Err 0 e +end +fn main to int +test not dpresent +test appinit 77 0 +put Inlen 0 len Prompt1 +for i ulong len Prompt1 +put In i get Prompt1 i +end +test dask 1 +test eq get R 0 1 +test eq get Dm 0 0 +test apppoll 1 true +n = get Outlen 0 +for i ulong n +put Wire i get Outb i +end +for i ulong len Scene1 +put In i get Scene1 i +end +put Inlen 0 len Scene1 +inbound 1 +size = get Inlen 0 +for i ulong size +put Before i get In i +end +test drecv 2 +test eq get A 2 1 +test eq get Dm 0 1 +test eq get Dm 2 1 +test eq get Ds 3 1 +test eq get Dt 0 1 +test eq get Dt 1 1 +test eq get Dtext get Dt 7 72 +test eq get Dtext get Dt 8 66 +test eq get Outlen 0 n +same = true +for i ulong n +if ne get Outb i get Wire i +same = false +end +end +test same +test eq get T 10 5 +note appreceive replaces In with its payload; only dpresent must preserve that. +size = get Inlen 0 +for i ulong size +put Before i get In i +end +test dpresent +test eq get Inlen 0 size +same = true +for i ulong size +if ne get Before i get In i +same = false +end +end +test same +note Even bytes outside current Inlen survive decoder scratch expansion. +for i ulong 8192 +put In i 165 +put Before i 165 +end +put Inlen 0 1 +test dpresent +test eq get Inlen 0 1 +same = true +for i ulong 8192 +if ne get In i get Before i +same = false +end +end +test same +put Inlen 0 8193 +test not dpresent +put Inlen 0 1 +note Hidden or invalid scene text cannot erase the last admitted presentation. +for i ulong len Hidden1 +put Answer i get Hidden1 i +end +put R 8 len Hidden1 +test not dpresent +test eq get Ds 3 1 +test eq get Dtext get Dt 7 72 +for i ulong len Badscene +put Answer i get Badscene i +end +put R 8 len Badscene +test not dpresent +test eq get Ds 3 1 +put A 2 0 +test not dpresent +put A 2 1 +put R 8 160 +test not dpresent +put R 8 0 +test not dpresent +note Refused receive cannot publish a stale event1. +for i ulong len Leak +put Answer i get Leak i +end +put R 8 len Leak +put Inlen 0 1 +put In 0 88 +test not drecv 2 +test eq get Ds 3 1 +test appsent 2 true +test apppoll 2 true +test appsent 2 true +put Inlen 0 len Prompt2 +for i ulong len Prompt2 +put In i get Prompt2 i +end +test dask 3 +test eq get R 0 2 +test eq get Ds 2 1 +test eq get Dtext get Dsay 0 73 +for i ulong len Code2 +put In i get Code2 i +end +put Inlen 0 len Code2 +inbound 1 +test drecv 4 +test eq get Dm 1 0 +test apppoll 4 true +test appsent 4 true +for i ulong len Done2 +put In i get Done2 i +end +put Inlen 0 len Done2 +inbound 2 +test drecv 5 +test eq get Dm 1 1 +test eq get Dm 2 2 +test eq get Dview 0 1 +test eq get Dview 1 0 +test eq get Dview 2 2 +test eq get Dstart 0 0 +test eq get Dlen 0 2 +test eq get Dline 0 1 +test eq get Dcode 0 104 +test eq get Dcode 1 105 +test eq get Dtext get Dsay 0 68 +note Code completion does not require a nonempty closing sentence. +put R 8 0 +test dpresent +test eq get Dm 1 1 +test eq get Dcode 0 104 +put Code 0 88 +test not dpresent +test eq get Dcode 0 104 +test eq get Dlen 0 2 +put Code 0 104 +note Later assembly may reuse Code; the displayed snapshot cannot alias it. +codebeg 3 +put Code 0 88 +test eq get Dcode 0 104 +put A 2 0 +test not dpresent +test eq get Dm 1 1 +put Dtext 2303 88 +put Dcode 32767 88 +put Dstart 4095 88 +put Dlen 4095 88 +put Dline 4095 88 +dreset +test eq get Dm 0 0 +test eq get Dm 1 0 +test eq get Dview 0 0 +test eq get R 0 2 +test eq get Q 1 2 +same = true +for i ulong 2304 +if ne get Dtext i 0 +same = false +end +end +test same +same = true +for i ulong 32768 +if ne get Dcode i 0 +same = false +end +end +test same +same = true +for i ulong 4096 +if ne or or get Dstart i get Dlen i get Dline i 0 +same = false +end +end +test same +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L756/independent-review/report.md b/evidence/allen-omega-L694/L756/independent-review/report.md new file mode 100644 index 00000000..ade803ac --- /dev/null +++ b/evidence/allen-omega-L694/L756/independent-review/report.md @@ -0,0 +1,27 @@ +# L753 additive presentation review — exact 4c7888f + +**Verdict:** No correctness finding in the presentation-wrapper/snapshot addition at `4c7888f65dca209a1e2b859ba695ae308657c03e`. This report is separate from the original exact-`43eae848` provider report. It reviews the additive Omega wrapper and its small gate/docs integration; it is not renderer, device, or live-transport qualification. + +## Exact pin and source closure + +- Exact pin: `4c7888f65dca209a1e2b859ba695ae308657c03e`; base: `43eae848f0a44604b42378d9ea3170278b5f3f8f`. +- Exported with `git archive` to `~/handoffs/L753-review/presentation-source/`. The L756 manifest has 55 `native/omega/allen` paths, exact membership with the pin's tracked paths; each recorded hash matches `git show :`. +- Verified unchanged Git blob identities between the two pins for `provider-core.om`, `provider.om`, `application.om`, `scene.om`, `view.om`, `code.om`, `scheduler.om`, `context.om`, and `memory.om`; identities are retained in `presentation-raw-unchanged-components.txt`. The production change is limited to `PRESENTATION.md`, README/gate additions, `presentation.om`, and its two seeded-Omega tests/mutant builder. +- Pinned compiler SHA-256 remains `191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9`. `presentation-test` is a nonempty static AArch64 ELF EXEC and its SHA-256 `749a510e3d8922cd7ef28a733b08f46687be36706585261e37f2a3cd6792ab40` matches the L756 source summary's presentation binary identity. + +## Findings + +None. `dask`/`drecv` preserve the application admission result and project only after success; `dpresent` checks the accepted event before reading Answer/R/A. The scene path snapshots/restores all `In` bytes and `Inlen` around decoder scratch use; invalid or hidden scenes do not replace the prior scene. Completed code and row layout are copied into separate bounded snapshots, so later `Code` assembly cannot alias the displayed completion. `dreset` clears the retained presentation arrays and metadata while preserving the underlying application reset-counter contract. The provider entry intentionally does not call these wrappers. + +## Focused independent replay + +- Rebuilt the exact-pinned presentation module and committed Omega integration test from the archived source with `build-one.sh`; **75 assertions, exit 0**. This reproduced the exact binary hash recorded by L756. +- Added a separate handwritten Omega probe for stale/non-event publication refusal, invalid/empty projection preserving retained snapshots, and full retained-buffer reset; **23 assertions, exit 0**. +- Total for this additive scope: **98 passing assertions**. No L756 full gate or 17-mutant set was rerun; I inspected its exact-pin summary/README receipts (2289 total assertions, 17 compiled-rejected mutants) and confined independent execution to the presentation addition. +- Input hashes are in `presentation-raw-inputs.sha256`; executable hashes in `presentation-raw-builds.sha256`; ELF evidence in `presentation-raw-test.elf.txt`; assertion logs/statuses in `presentation-raw-baseline.log`, `presentation-raw-baseline.exit`, `presentation-raw-independent.log`, and `presentation-raw-independent.exit`. The Omega source for the new probe is `presentation-build/presentation-independent.om`. + +## Limits + +- These tests exercise the native application-to-presentation state binding only. They do not render pixels, use a display device, prove multiline scene transport, exercise a live model/provider, or qualify iMac/device behavior. +- L756’s own scope says the provider stream remains unchanged and does not call the wrappers; this review makes no claim that production callers have integrated or deployed them. +- The original provider review remains at `~/handoffs/L753-review/report.md` with its own exact-`43eae848` scope and receipts. No production files were modified and no ledger item was closed. diff --git a/evidence/allen-omega-L694/L756/inputtail-mutant.log b/evidence/allen-omega-L694/L756/inputtail-mutant.log new file mode 100644 index 00000000..c0415908 --- /dev/null +++ b/evidence/allen-omega-L694/L756/inputtail-mutant.log @@ -0,0 +1,75 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 1 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 diff --git a/evidence/allen-omega-L694/L756/intent.log b/evidence/allen-omega-L694/L756/intent.log new file mode 100644 index 00000000..5371bd36 --- /dev/null +++ b/evidence/allen-omega-L694/L756/intent.log @@ -0,0 +1,8 @@ +501 0 +502 0 +503 0 +504 0 +505 0 +506 0 +507 0 +508 0 diff --git a/evidence/allen-omega-L694/L756/inventory.json b/evidence/allen-omega-L694/L756/inventory.json new file mode 100644 index 00000000..c1ceaa25 --- /dev/null +++ b/evidence/allen-omega-L694/L756/inventory.json @@ -0,0 +1,73 @@ +{ + "README.md": "3af85f455088feee54893867df2061923d2b85872c90b4281c8ce268112fffb6", + "ackstop-mutant.log": "e35f80780a1c1769657287485e65ca25ab222d99277482c91900418d6dc6d433", + "appcode-mutant.log": "087522069b49d76999d8a495fccbff79cad4ff1fdf1d3ebf1e15855d6c959dc1", + "application.log": "799a91676cc7a8b0f4d027392ad8dda0e26af0501906ad906ae1ec8b1703d30a", + "autosent-mutant.log": "fd09242df722583c7e04568d177eed33aeec3b4fbc67f8d1cba666941a81bf08", + "binaries.sha256": "ea7e21652f6f405049a8b29d0bfaf4d80ace81e7d6e1ee9b699adfe1d4f08a0a", + "code.log": "f4d91fae8c90949b5538689d148384c72984c34d8f84507b499cbb75349ec390", + "context.log": "a93a138b2ffb8a544174d9bc55e3e5e8b7d0f2531f4aff76030eba22e7c7b5e0", + "contextjob-mutant.log": "4f32375d7357e7ebd07106f23fada35d235ad7756a9aba91f6a556fae4d39c3b", + "contextnote-mutant.log": "528e41cd827af033d9f5391f011aba3c9e348051a57916c0c5d52c9e263f87a5", + "courier.log": "466116a0daf08d362ded3aab678a6213671cc17e82ead4bd6fdc5dcedf1674f1", + "crc-mutant.log": "d640ebbfc3be10156ce28e7972bd9931390e4a2c18f90099997e4bd94d941835", + "edges.log": "c3c33b435c05aebcb2c86e76121ca0681bcc58c52bc1388b5a8b47258c5603ed", + "framecheck-mutant.log": "80857ef43f4767086a5154d915825e2d9ab8e1dacf7382cd9cec20a6c9e945eb", + "full.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa", + "full.log": "316629efd55843b4facbe993fef0930bf14a0ad1fbf7da992d6bd19369abeded", + "green.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa", + "green.log": "f2a7a54115f2652ea4547486f56911b780a44157dceac220fa01ada10071d0b0", + "green2.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa", + "green2.log": "c43d43223e83f0d34b868be1fa08b0fa42386f72938a8f59e24811f84aad37e7", + "hash-mutant.log": "e2900d31ceb87ff95fb84cac73a1e6aa3a0100eebaada0432ec50c2471cd437e", + "inputtail-mutant.log": "48170607e958bb62a28b6a05bf184a3fcf16b5a0ec76bed8b7fa2bcc0b9a9d67", + "intent.log": "920955281e985095ba5d24b01370dcb7fc022559df06892bfc120a9fc6a04345", + "keepalive-mutant.log": "9cf7f699f4c0a01694b4d3d557857d95fa76bdf5d7d2d58571aef3b9e66da10e", + "long.log": "b37fc9e675de395d9cba4c2e74ae7ea210e617927691c9f1df4896ae1bafe508", + "memory.log": "d8ad7727ab1536ed00ab2a63f0a056e4e4cc237571077c36573952a4c49c9a15", + "paint.log": "ab43be8b6b42efc70663a0e14d0b44aec7c0766bbb961af2da77d2737f78a81a", + "pendingwire-mutant.log": "6a48c141724f07b9adf2a4da28802544ab29d2d3f42fe1eacb3ef45df2d96657", + "presentation.log": "c43d43223e83f0d34b868be1fa08b0fa42386f72938a8f59e24811f84aad37e7", + "provider-bad-1.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c", + "provider-bad-1.receipt": "4a4a5cc6008f0286443686c10c17919e7e3a3e2258a6b97bf06311c9afe0dfe4", + "provider-bad-2.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c", + "provider-bad-2.receipt": "437701d7771dcdcc130e256587a9251dbeabef08feb3d518d93f7db29b32619b", + "provider-bad-3.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c", + "provider-bad-3.receipt": "cf271c014ed96ffcad97c0ddde9a784deae63b48ab54ead38a601896a2cdfa05", + "provider-bad-4.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c", + "provider-bad-4.receipt": "3be14d5117cfd9923743dc772ac727cb30372228ca81879e3cac708dc9700d9a", + "provider-bad-5.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c", + "provider-bad-5.receipt": "311ce7da405cd8858718b28b45415028dedec82003dcb862d1b5ceea26c84646", + "provider-bad-6.log": "a0cc795fae1ca892318f47133f6c48e1c8bb6aad118ff7f2b00c8e8967393435", + "provider-bad-6.receipt": "26e7d22e42e36c12f4341bf1e1838f7fa84402571f3127fb91208ac45a05f64b", + "provider-consumer.log": "d8b9c61c09b396c654162f89688f72787756206bfcc70276d6c2682c3e7710f5", + "provider-consumer.receipt": "fb092a176e79462f135ff6f1aea3e2171eada31ad629d8c498104e43b244dabb", + "provider-core.log": "fbfe365c7485671f3c8e0ccf480be062034b65360b2005530c258e1577aaec04", + "provider-fragment.log": "49c437a2551e71a10bc26bc969f55103611991adea98696503cbdb8e686d1ba3", + "provider-process.log": "d8b9c61c09b396c654162f89688f72787756206bfcc70276d6c2682c3e7710f5", + "provider-process.receipt": "fb092a176e79462f135ff6f1aea3e2171eada31ad629d8c498104e43b244dabb", + "provider-producer.log": "d8b9c61c09b396c654162f89688f72787756206bfcc70276d6c2682c3e7710f5", + "provider-producer.receipt": "b710cb935724406c7cf4e459857b58c47f6026696cc11727da2815675bfec4d9", + "provider-stream.log": "49c437a2551e71a10bc26bc969f55103611991adea98696503cbdb8e686d1ba3", + "readback-mutant.log": "c841304340c8e11f4412f33a05d63a76dfc6329270c33f30a4d5fb38c9339c61", + "red.exit": "4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865", + "red.log": "77315e876d465fff4e3328337c194f4bb6622dc187248f55366a72a1b8c4960f", + "red.om": "66faf4500c325c0e5509ef205838c01d202f222f37dbae3b8a465fba12058b8b", + "red2.exit": "4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865", + "red2.log": "6921c98a35fc5835daf3b8fcb54490b1874985a280d2b089bc82cf48c987d0bc", + "red2.om": "9a5159c3f7b7bab69b66e54da2e9fcec4a7a4df0350d7d67eef97c4026fbc85e", + "reply.log": "32d6f801fcebf933a573005fdb8d16376c56b01c34b1004101b0c0f047216162", + "runtime.log": "3113eae822a3529bfeb10a00da4130799a2e951a77ce4d468a7e94ff5a312c51", + "scene-input.log": "613312ef2e6ad6eb62d19f9a161a65dbefd867af59a260d4dd82adef18ff88c9", + "scene.log": "bec37a817909cb5af22c3d82c962698ab0ddaf8a2c16debe86a84ea2a0889bc8", + "scenecap-mutant.log": "aaecc0a85ed361c2a5f6823a85f76ea5c8c60e3bef3d88ef225175ca7c3c090d", + "scheduler.log": "b73f09405c612284cb7eecacb51fbabe60f5f7c6ec11f504cbb76a1e4e83f948", + "session-mutant.log": "b6320567e748c4f1ab264c07c76e22f7091d6bf77c004aae67ecef4d8115e8f2", + "short.log": "b8ed8e2db46290298415a96dbb9f64580f5ff79f631cdcf3b0257f3fb836f8a2", + "source.sha256": "e526a6e9693b501237f22e38fc626f1492f868bf79fe73c8645299f6ebebb7e3", + "stale-mutant.log": "59a77d4cd8683beb2a101425071eafef48c9afba89ac8b6e10edb8ed1098b42b", + "staleview-mutant.log": "0968ca91bbecca4bf9f6dda44d115d3a162170b23ce21fa798a32a9617cd425b", + "summary.json": "1e4d6ad6014bc880c49d6e5bccaf76b3b04db09c294536a25cca9b56c5ca713e", + "thinking-mutant.log": "908c76c450a2ae6643694cc1f41e2a868792bcc3e20e96c317de6fa764d7f474", + "view.log": "2d117e033fea3f325a11c5cd70be5a181eb4d7d6b08e45b5fd73447d4159550e" +} diff --git a/evidence/allen-omega-L694/L756/keepalive-mutant.log b/evidence/allen-omega-L694/L756/keepalive-mutant.log new file mode 100644 index 00000000..2e3415df --- /dev/null +++ b/evidence/allen-omega-L694/L756/keepalive-mutant.log @@ -0,0 +1,213 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 1 +19 1 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 1 +54 1 +55 1 +56 1 +57 0 +58 0 +59 1 +60 0 +61 0 +62 0 +63 0 +64 0 +65 1 +66 0 +67 0 +68 0 +69 1 +70 1 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 1 +170 0 +171 1 +172 1 +173 0 +174 1 +175 0 +176 0 +177 0 +178 1 +179 1 +180 1 +181 1 +182 1 +183 1 +184 1 +185 1 +186 1 +187 1 +188 1 +189 1 +190 1 +191 1 +192 1 +193 1 +194 1 +195 1 +196 1 +197 1 +198 0 +199 1 +200 0 +201 0 +202 1 +203 1 +204 1 +205 0 +206 1 +207 1 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 diff --git a/evidence/allen-omega-L694/L756/long.log b/evidence/allen-omega-L694/L756/long.log new file mode 100644 index 00000000..0a060bc8 --- /dev/null +++ b/evidence/allen-omega-L694/L756/long.log @@ -0,0 +1,292 @@ +401 0 +410 0 +411 0 +412 0 +413 0 +414 0 +415 0 +416 0 +417 0 +418 0 +419 0 +420 0 +421 0 +422 0 +423 0 +424 0 +425 0 +426 0 +427 0 +428 0 +429 0 +430 0 +431 0 +432 0 +433 0 +434 0 +435 0 +436 0 +437 0 +438 0 +439 0 +440 0 +441 0 +442 0 +443 0 +444 0 +445 0 +446 0 +447 0 +448 0 +449 0 +450 0 +451 0 +452 0 +453 0 +454 0 +455 0 +456 0 +457 0 +458 0 +459 0 +460 0 +461 0 +462 0 +463 0 +464 0 +465 0 +466 0 +467 0 +468 0 +469 0 +470 0 +471 0 +472 0 +473 0 +474 0 +475 0 +476 0 +477 0 +478 0 +479 0 +480 0 +481 0 +482 0 +483 0 +484 0 +485 0 +486 0 +487 0 +488 0 +489 0 +490 0 +491 0 +492 0 +493 0 +494 0 +495 0 +496 0 +497 0 +498 0 +499 0 +500 0 +501 0 +502 0 +503 0 +504 0 +505 0 +506 0 +507 0 +508 0 +509 0 +510 0 +511 0 +512 0 +513 0 +514 0 +515 0 +516 0 +517 0 +518 0 +519 0 +520 0 +521 0 +522 0 +523 0 +524 0 +525 0 +526 0 +527 0 +528 0 +529 0 +530 0 +531 0 +532 0 +533 0 +534 0 +535 0 +536 0 +537 0 +538 0 +539 0 +540 0 +541 0 +542 0 +543 0 +544 0 +545 0 +546 0 +547 0 +548 0 +549 0 +550 0 +402 0 +403 0 +404 0 +405 0 +406 0 +700 0 +701 0 +702 0 +703 0 +704 0 +705 0 +706 0 +707 0 +708 0 +709 0 +710 0 +711 0 +712 0 +713 0 +714 0 +715 0 +716 0 +717 0 +718 0 +719 0 +720 0 +721 0 +722 0 +723 0 +724 0 +725 0 +726 0 +727 0 +728 0 +729 0 +730 0 +731 0 +732 0 +733 0 +734 0 +735 0 +736 0 +737 0 +738 0 +739 0 +740 0 +741 0 +742 0 +743 0 +744 0 +745 0 +746 0 +747 0 +748 0 +749 0 +750 0 +751 0 +752 0 +753 0 +754 0 +755 0 +756 0 +757 0 +758 0 +759 0 +760 0 +761 0 +762 0 +763 0 +764 0 +765 0 +766 0 +767 0 +768 0 +769 0 +770 0 +771 0 +772 0 +773 0 +774 0 +775 0 +776 0 +777 0 +778 0 +779 0 +780 0 +781 0 +782 0 +783 0 +784 0 +785 0 +786 0 +787 0 +788 0 +789 0 +790 0 +791 0 +792 0 +793 0 +794 0 +795 0 +796 0 +797 0 +798 0 +799 0 +800 0 +801 0 +802 0 +803 0 +804 0 +805 0 +806 0 +807 0 +808 0 +809 0 +810 0 +811 0 +812 0 +813 0 +814 0 +815 0 +816 0 +817 0 +818 0 +819 0 +820 0 +821 0 +822 0 +823 0 +824 0 +825 0 +826 0 +827 0 +828 0 +829 0 +830 0 +831 0 +832 0 +833 0 +834 0 +835 0 +836 0 +837 0 +838 0 +839 0 +840 0 +841 0 +407 0 +408 0 +409 0 diff --git a/evidence/allen-omega-L694/L756/memory.log b/evidence/allen-omega-L694/L756/memory.log new file mode 100644 index 00000000..5928102e --- /dev/null +++ b/evidence/allen-omega-L694/L756/memory.log @@ -0,0 +1,79 @@ +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 0 +310 0 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +362 0 +363 0 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 0 +361 0 diff --git a/evidence/allen-omega-L694/L756/paint.log b/evidence/allen-omega-L694/L756/paint.log new file mode 100644 index 00000000..281a5bd2 --- /dev/null +++ b/evidence/allen-omega-L694/L756/paint.log @@ -0,0 +1,11 @@ +1101 0 +1102 0 +1103 0 +1104 0 +1105 0 +1106 0 +1107 0 +1108 0 +1109 0 +1110 0 +1111 0 diff --git a/evidence/allen-omega-L694/L756/pendingwire-mutant.log b/evidence/allen-omega-L694/L756/pendingwire-mutant.log new file mode 100644 index 00000000..48fb2008 --- /dev/null +++ b/evidence/allen-omega-L694/L756/pendingwire-mutant.log @@ -0,0 +1,182 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 1 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 diff --git a/evidence/allen-omega-L694/L756/presentation.log b/evidence/allen-omega-L694/L756/presentation.log new file mode 100644 index 00000000..84fd2470 --- /dev/null +++ b/evidence/allen-omega-L694/L756/presentation.log @@ -0,0 +1,75 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 diff --git a/evidence/allen-omega-L694/L756/provider-bad-1.log b/evidence/allen-omega-L694/L756/provider-bad-1.log new file mode 100644 index 00000000..7da8e511 --- /dev/null +++ b/evidence/allen-omega-L694/L756/provider-bad-1.log @@ -0,0 +1,5 @@ +1 0 +2 0 +3 0 +4 0 +5 0 diff --git a/evidence/allen-omega-L694/L756/provider-bad-1.receipt b/evidence/allen-omega-L694/L756/provider-bad-1.receipt new file mode 100644 index 00000000..2b29860a --- /dev/null +++ b/evidence/allen-omega-L694/L756/provider-bad-1.receipt @@ -0,0 +1,4 @@ +1 +65 +0 +0 diff --git a/evidence/allen-omega-L694/L756/provider-bad-2.log b/evidence/allen-omega-L694/L756/provider-bad-2.log new file mode 100644 index 00000000..7da8e511 --- /dev/null +++ b/evidence/allen-omega-L694/L756/provider-bad-2.log @@ -0,0 +1,5 @@ +1 0 +2 0 +3 0 +4 0 +5 0 diff --git a/evidence/allen-omega-L694/L756/provider-bad-2.receipt b/evidence/allen-omega-L694/L756/provider-bad-2.receipt new file mode 100644 index 00000000..9ba12cca --- /dev/null +++ b/evidence/allen-omega-L694/L756/provider-bad-2.receipt @@ -0,0 +1,4 @@ +2 +65 +0 +0 diff --git a/evidence/allen-omega-L694/L756/provider-bad-3.log b/evidence/allen-omega-L694/L756/provider-bad-3.log new file mode 100644 index 00000000..7da8e511 --- /dev/null +++ b/evidence/allen-omega-L694/L756/provider-bad-3.log @@ -0,0 +1,5 @@ +1 0 +2 0 +3 0 +4 0 +5 0 diff --git a/evidence/allen-omega-L694/L756/provider-bad-3.receipt b/evidence/allen-omega-L694/L756/provider-bad-3.receipt new file mode 100644 index 00000000..199cc204 --- /dev/null +++ b/evidence/allen-omega-L694/L756/provider-bad-3.receipt @@ -0,0 +1,4 @@ +3 +65 +0 +0 diff --git a/evidence/allen-omega-L694/L756/provider-bad-4.log b/evidence/allen-omega-L694/L756/provider-bad-4.log new file mode 100644 index 00000000..7da8e511 --- /dev/null +++ b/evidence/allen-omega-L694/L756/provider-bad-4.log @@ -0,0 +1,5 @@ +1 0 +2 0 +3 0 +4 0 +5 0 diff --git a/evidence/allen-omega-L694/L756/provider-bad-4.receipt b/evidence/allen-omega-L694/L756/provider-bad-4.receipt new file mode 100644 index 00000000..26a81c4a --- /dev/null +++ b/evidence/allen-omega-L694/L756/provider-bad-4.receipt @@ -0,0 +1,4 @@ +4 +65 +0 +0 diff --git a/evidence/allen-omega-L694/L756/provider-bad-5.log b/evidence/allen-omega-L694/L756/provider-bad-5.log new file mode 100644 index 00000000..7da8e511 --- /dev/null +++ b/evidence/allen-omega-L694/L756/provider-bad-5.log @@ -0,0 +1,5 @@ +1 0 +2 0 +3 0 +4 0 +5 0 diff --git a/evidence/allen-omega-L694/L756/provider-bad-5.receipt b/evidence/allen-omega-L694/L756/provider-bad-5.receipt new file mode 100644 index 00000000..d79f5995 --- /dev/null +++ b/evidence/allen-omega-L694/L756/provider-bad-5.receipt @@ -0,0 +1,4 @@ +5 +65 +0 +0 diff --git a/evidence/allen-omega-L694/L756/provider-bad-6.log b/evidence/allen-omega-L694/L756/provider-bad-6.log new file mode 100644 index 00000000..3f9cc45d --- /dev/null +++ b/evidence/allen-omega-L694/L756/provider-bad-6.log @@ -0,0 +1,17 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 diff --git a/evidence/allen-omega-L694/L756/provider-bad-6.receipt b/evidence/allen-omega-L694/L756/provider-bad-6.receipt new file mode 100644 index 00000000..d0b7cd17 Binary files /dev/null and b/evidence/allen-omega-L694/L756/provider-bad-6.receipt differ diff --git a/evidence/allen-omega-L694/L756/provider-consumer.log b/evidence/allen-omega-L694/L756/provider-consumer.log new file mode 100644 index 00000000..9c0592e2 --- /dev/null +++ b/evidence/allen-omega-L694/L756/provider-consumer.log @@ -0,0 +1,3 @@ +1 0 +2 0 +3 0 diff --git a/evidence/allen-omega-L694/L756/provider-consumer.receipt b/evidence/allen-omega-L694/L756/provider-consumer.receipt new file mode 100644 index 00000000..31d93b9d Binary files /dev/null and b/evidence/allen-omega-L694/L756/provider-consumer.receipt differ diff --git a/evidence/allen-omega-L694/L756/provider-core.log b/evidence/allen-omega-L694/L756/provider-core.log new file mode 100644 index 00000000..88d1b135 --- /dev/null +++ b/evidence/allen-omega-L694/L756/provider-core.log @@ -0,0 +1,100 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 diff --git a/evidence/allen-omega-L694/L756/provider-fragment.log b/evidence/allen-omega-L694/L756/provider-fragment.log new file mode 100644 index 00000000..d91084d1 --- /dev/null +++ b/evidence/allen-omega-L694/L756/provider-fragment.log @@ -0,0 +1,292 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 +183 0 +184 0 +185 0 +186 0 +187 0 +188 0 +189 0 +190 0 +191 0 +192 0 +193 0 +194 0 +195 0 +196 0 +197 0 +198 0 +199 0 +200 0 +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 +225 0 +226 0 +227 0 +228 0 +229 0 +230 0 +231 0 +232 0 +233 0 +234 0 +235 0 +236 0 +237 0 +238 0 +239 0 +240 0 +241 0 +242 0 +243 0 +244 0 +245 0 +246 0 +247 0 +248 0 +249 0 +250 0 +251 0 +252 0 +253 0 +254 0 +255 0 +256 0 +257 0 +258 0 +259 0 +260 0 +261 0 +262 0 +263 0 +264 0 +265 0 +266 0 +267 0 +268 0 +269 0 +270 0 +271 0 +272 0 +273 0 +274 0 +275 0 +276 0 +277 0 +278 0 +279 0 +280 0 +281 0 +282 0 +283 0 +284 0 +285 0 +286 0 +287 0 +288 0 +289 0 +290 0 +291 0 +292 0 diff --git a/evidence/allen-omega-L694/L756/provider-process.log b/evidence/allen-omega-L694/L756/provider-process.log new file mode 100644 index 00000000..9c0592e2 --- /dev/null +++ b/evidence/allen-omega-L694/L756/provider-process.log @@ -0,0 +1,3 @@ +1 0 +2 0 +3 0 diff --git a/evidence/allen-omega-L694/L756/provider-process.receipt b/evidence/allen-omega-L694/L756/provider-process.receipt new file mode 100644 index 00000000..31d93b9d Binary files /dev/null and b/evidence/allen-omega-L694/L756/provider-process.receipt differ diff --git a/evidence/allen-omega-L694/L756/provider-producer.log b/evidence/allen-omega-L694/L756/provider-producer.log new file mode 100644 index 00000000..9c0592e2 --- /dev/null +++ b/evidence/allen-omega-L694/L756/provider-producer.log @@ -0,0 +1,3 @@ +1 0 +2 0 +3 0 diff --git a/evidence/allen-omega-L694/L756/provider-producer.receipt b/evidence/allen-omega-L694/L756/provider-producer.receipt new file mode 100644 index 00000000..0967800c --- /dev/null +++ b/evidence/allen-omega-L694/L756/provider-producer.receipt @@ -0,0 +1,4 @@ +7 +0 +0 +0 diff --git a/evidence/allen-omega-L694/L756/provider-stream.log b/evidence/allen-omega-L694/L756/provider-stream.log new file mode 100644 index 00000000..d91084d1 --- /dev/null +++ b/evidence/allen-omega-L694/L756/provider-stream.log @@ -0,0 +1,292 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 +183 0 +184 0 +185 0 +186 0 +187 0 +188 0 +189 0 +190 0 +191 0 +192 0 +193 0 +194 0 +195 0 +196 0 +197 0 +198 0 +199 0 +200 0 +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 +225 0 +226 0 +227 0 +228 0 +229 0 +230 0 +231 0 +232 0 +233 0 +234 0 +235 0 +236 0 +237 0 +238 0 +239 0 +240 0 +241 0 +242 0 +243 0 +244 0 +245 0 +246 0 +247 0 +248 0 +249 0 +250 0 +251 0 +252 0 +253 0 +254 0 +255 0 +256 0 +257 0 +258 0 +259 0 +260 0 +261 0 +262 0 +263 0 +264 0 +265 0 +266 0 +267 0 +268 0 +269 0 +270 0 +271 0 +272 0 +273 0 +274 0 +275 0 +276 0 +277 0 +278 0 +279 0 +280 0 +281 0 +282 0 +283 0 +284 0 +285 0 +286 0 +287 0 +288 0 +289 0 +290 0 +291 0 +292 0 diff --git a/evidence/allen-omega-L694/L756/readback-mutant.log b/evidence/allen-omega-L694/L756/readback-mutant.log new file mode 100644 index 00000000..268002ad --- /dev/null +++ b/evidence/allen-omega-L694/L756/readback-mutant.log @@ -0,0 +1,79 @@ +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 0 +310 0 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 1 +339 1 +340 0 +341 0 +342 0 +343 0 +344 1 +345 0 +346 0 +347 0 +348 0 +349 1 +350 1 +351 0 +352 0 +362 0 +363 0 +353 1 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 1 +361 0 diff --git a/evidence/allen-omega-L694/L756/red.exit b/evidence/allen-omega-L694/L756/red.exit new file mode 100644 index 00000000..d00491fd --- /dev/null +++ b/evidence/allen-omega-L694/L756/red.exit @@ -0,0 +1 @@ +1 diff --git a/evidence/allen-omega-L694/L756/red.log b/evidence/allen-omega-L694/L756/red.log new file mode 100644 index 00000000..7b4863e4 --- /dev/null +++ b/evidence/allen-omega-L694/L756/red.log @@ -0,0 +1,65 @@ +1 0 +2 0 +3 1 +4 1 +5 0 +6 0 +7 1 +8 1 +9 1 +10 1 +11 1 +12 1 +13 1 +14 1 +15 1 +16 0 +17 0 +18 0 +19 1 +20 0 +21 0 +22 0 +23 1 +24 1 +25 0 +26 1 +27 0 +28 0 +29 0 +30 0 +31 1 +32 0 +33 1 +34 1 +35 1 +36 1 +37 1 +38 1 +39 1 +40 0 +41 1 +42 1 +43 1 +44 1 +45 1 +46 1 +47 0 +48 1 +49 0 +50 1 +51 1 +52 1 +53 1 +54 1 +55 1 +56 0 +57 1 +58 0 +59 0 +60 0 +61 1 +62 1 +63 1 +64 1 +65 1 diff --git a/evidence/allen-omega-L694/L756/red.om b/evidence/allen-omega-L694/L756/red.om new file mode 100644 index 00000000..d47cdd71 --- /dev/null +++ b/evidence/allen-omega-L694/L756/red.om @@ -0,0 +1,3927 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +global Ds ulong 8 +global Dt ulong 64 +global Dtext uchar 2304 +global Dsay ulong 1 +global Dm ulong 3 +global Dcode uchar 32768 +global Dstart ulong 4096 +global Dlen ulong 4096 +global Dline ulong 4096 +global Dview ulong 3 +global Din uchar 8192 +fn dpresent to bool +ret false +end +fn dask now ulong to bool +ret false +end +fn drecv now ulong to bool +ret false +end +fn dreset to void +ret +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +text Prompt1 "hello" +text Scene1 "SAY 1 1/1 note left: Heading | Body" +text Hidden1 "private" +text Badscene "number: nope" +text Prompt2 "write a calculator" +text Code2 "CODE 2 1/1 2 d8932aac text hi" +text Done2 "SAY 2 1/1 Done." +global Saved uchar 8192 +global Keep ulong 2 +global Before uchar 8192 +global Wire uchar 8192 +fn test ok bool to void +put Keep 0 get Outlen 0 +put Keep 1 get Err 0 +for i ulong get Outlen 0 +put Saved i get Outb i +end +check ok add get Checks 0 1 +for i ulong get Keep 0 +put Outb i get Saved i +end +put Outlen 0 get Keep 0 +put Err 0 get Keep 1 +end +fn inbound part ulong to void +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Before i get Outb i +end +b = packet 2 get Q 1 part 0 0 +size = get Outlen 0 +for i ulong size +put In i get Outb i +end +put Inlen 0 size +for i ulong n +put Outb i get Before i +end +put Outlen 0 n +put Err 0 e +end +fn main to int +test not dpresent +test appinit 77 0 +put Inlen 0 len Prompt1 +for i ulong len Prompt1 +put In i get Prompt1 i +end +test dask 1 +test eq get R 0 1 +test eq get Dm 0 0 +test apppoll 1 true +n = get Outlen 0 +for i ulong n +put Wire i get Outb i +end +for i ulong len Scene1 +put In i get Scene1 i +end +put Inlen 0 len Scene1 +inbound 1 +size = get Inlen 0 +for i ulong size +put Before i get In i +end +test drecv 2 +test eq get A 2 1 +test eq get Dm 0 1 +test eq get Dm 2 1 +test eq get Ds 3 1 +test eq get Dt 0 1 +test eq get Dt 1 1 +test eq get Dtext get Dt 7 72 +test eq get Dtext get Dt 8 66 +test eq get Outlen 0 n +same = true +for i ulong n +if ne get Outb i get Wire i +same = false +end +end +test same +test eq get T 10 5 +note appreceive replaces In with its payload; only dpresent must preserve that. +size = get Inlen 0 +for i ulong size +put Before i get In i +end +test dpresent +test eq get Inlen 0 size +same = true +for i ulong size +if ne get Before i get In i +same = false +end +end +test same +note Hidden or invalid scene text cannot erase the last admitted presentation. +for i ulong len Hidden1 +put Answer i get Hidden1 i +end +put R 8 len Hidden1 +test not dpresent +test eq get Ds 3 1 +test eq get Dtext get Dt 7 72 +for i ulong len Badscene +put Answer i get Badscene i +end +put R 8 len Badscene +test not dpresent +test eq get Ds 3 1 +put A 2 0 +test not dpresent +put A 2 1 +put R 8 160 +test not dpresent +put R 8 0 +test not dpresent +note Refused receive cannot publish a stale event1. +put Inlen 0 1 +put In 0 88 +test not drecv 2 +test eq get Ds 3 1 +test appsent 2 true +test apppoll 2 true +test appsent 2 true +put Inlen 0 len Prompt2 +for i ulong len Prompt2 +put In i get Prompt2 i +end +test dask 3 +test eq get R 0 2 +test eq get Ds 2 1 +test eq get Dtext get Dsay 0 73 +for i ulong len Code2 +put In i get Code2 i +end +put Inlen 0 len Code2 +inbound 1 +test drecv 4 +test eq get Dm 1 0 +test apppoll 4 true +test appsent 4 true +for i ulong len Done2 +put In i get Done2 i +end +put Inlen 0 len Done2 +inbound 2 +test drecv 5 +test eq get Dm 1 1 +test eq get Dm 2 2 +test eq get Dview 0 1 +test eq get Dview 1 0 +test eq get Dview 2 2 +test eq get Dstart 0 0 +test eq get Dlen 0 2 +test eq get Dline 0 1 +test eq get Dcode 0 104 +test eq get Dcode 1 105 +test eq get Dtext get Dsay 0 68 +note Later assembly may reuse Code; the displayed snapshot cannot alias it. +codebeg 3 +put Code 0 88 +test eq get Dcode 0 104 +put A 2 0 +test not dpresent +test eq get Dm 1 1 +put Dtext 2303 88 +put Dcode 32767 88 +put Dstart 4095 88 +put Dlen 4095 88 +put Dline 4095 88 +dreset +test eq get Dm 0 0 +test eq get Dm 1 0 +test eq get Dview 0 0 +test eq get R 0 2 +test eq get Q 1 2 +same = true +for i ulong 2304 +if ne get Dtext i 0 +same = false +end +end +test same +same = true +for i ulong 32768 +if ne get Dcode i 0 +same = false +end +end +test same +same = true +for i ulong 4096 +if ne or or get Dstart i get Dlen i get Dline i 0 +same = false +end +end +test same +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L756/red2.exit b/evidence/allen-omega-L694/L756/red2.exit new file mode 100644 index 00000000..d00491fd --- /dev/null +++ b/evidence/allen-omega-L694/L756/red2.exit @@ -0,0 +1 @@ +1 diff --git a/evidence/allen-omega-L694/L756/red2.log b/evidence/allen-omega-L694/L756/red2.log new file mode 100644 index 00000000..c6cb8075 --- /dev/null +++ b/evidence/allen-omega-L694/L756/red2.log @@ -0,0 +1,75 @@ +1 0 +2 0 +3 1 +4 1 +5 0 +6 0 +7 1 +8 1 +9 1 +10 1 +11 1 +12 1 +13 1 +14 1 +15 1 +16 0 +17 0 +18 0 +19 1 +20 0 +21 0 +22 1 +23 0 +24 0 +25 0 +26 0 +27 1 +28 1 +29 0 +30 1 +31 0 +32 0 +33 0 +34 0 +35 1 +36 0 +37 1 +38 1 +39 1 +40 1 +41 1 +42 1 +43 1 +44 0 +45 1 +46 1 +47 1 +48 1 +49 1 +50 1 +51 0 +52 1 +53 0 +54 1 +55 1 +56 1 +57 1 +58 1 +59 1 +60 1 +61 1 +62 0 +63 1 +64 1 +65 1 +66 0 +67 1 +68 0 +69 0 +70 0 +71 1 +72 1 +73 1 +74 1 +75 1 diff --git a/evidence/allen-omega-L694/L756/red2.om b/evidence/allen-omega-L694/L756/red2.om new file mode 100644 index 00000000..8da83552 --- /dev/null +++ b/evidence/allen-omega-L694/L756/red2.om @@ -0,0 +1,3960 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +global Ds ulong 8 +global Dt ulong 64 +global Dtext uchar 2304 +global Dsay ulong 1 +global Dm ulong 3 +global Dcode uchar 32768 +global Dstart ulong 4096 +global Dlen ulong 4096 +global Dline ulong 4096 +global Dview ulong 3 +global Din uchar 8192 +fn dpresent to bool +ret false +end +fn dask now ulong to bool +ret false +end +fn drecv now ulong to bool +ret false +end +fn dreset to void +ret +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +text Prompt1 "hello" +text Leak "LEAK" +text Scene1 "SAY 1 1/1 note left: Heading | Body" +text Hidden1 "private" +text Badscene "number: nope" +text Prompt2 "write a calculator" +text Code2 "CODE 2 1/1 2 d8932aac text hi" +text Done2 "SAY 2 1/1 Done." +global Saved uchar 8192 +global Keep ulong 2 +global Before uchar 8192 +global Wire uchar 8192 +fn test ok bool to void +put Keep 0 get Outlen 0 +put Keep 1 get Err 0 +for i ulong get Outlen 0 +put Saved i get Outb i +end +check ok add get Checks 0 1 +for i ulong get Keep 0 +put Outb i get Saved i +end +put Outlen 0 get Keep 0 +put Err 0 get Keep 1 +end +fn inbound part ulong to void +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Before i get Outb i +end +b = packet 2 get Q 1 part 0 0 +size = get Outlen 0 +for i ulong size +put In i get Outb i +end +put Inlen 0 size +for i ulong n +put Outb i get Before i +end +put Outlen 0 n +put Err 0 e +end +fn main to int +test not dpresent +test appinit 77 0 +put Inlen 0 len Prompt1 +for i ulong len Prompt1 +put In i get Prompt1 i +end +test dask 1 +test eq get R 0 1 +test eq get Dm 0 0 +test apppoll 1 true +n = get Outlen 0 +for i ulong n +put Wire i get Outb i +end +for i ulong len Scene1 +put In i get Scene1 i +end +put Inlen 0 len Scene1 +inbound 1 +size = get Inlen 0 +for i ulong size +put Before i get In i +end +test drecv 2 +test eq get A 2 1 +test eq get Dm 0 1 +test eq get Dm 2 1 +test eq get Ds 3 1 +test eq get Dt 0 1 +test eq get Dt 1 1 +test eq get Dtext get Dt 7 72 +test eq get Dtext get Dt 8 66 +test eq get Outlen 0 n +same = true +for i ulong n +if ne get Outb i get Wire i +same = false +end +end +test same +test eq get T 10 5 +note appreceive replaces In with its payload; only dpresent must preserve that. +size = get Inlen 0 +for i ulong size +put Before i get In i +end +test dpresent +test eq get Inlen 0 size +same = true +for i ulong size +if ne get Before i get In i +same = false +end +end +test same +note Even bytes outside current Inlen survive decoder scratch expansion. +for i ulong 8192 +put In i 165 +put Before i 165 +end +put Inlen 0 1 +test dpresent +test eq get Inlen 0 1 +same = true +for i ulong 8192 +if ne get In i get Before i +same = false +end +end +test same +put Inlen 0 8193 +test not dpresent +put Inlen 0 1 +note Hidden or invalid scene text cannot erase the last admitted presentation. +for i ulong len Hidden1 +put Answer i get Hidden1 i +end +put R 8 len Hidden1 +test not dpresent +test eq get Ds 3 1 +test eq get Dtext get Dt 7 72 +for i ulong len Badscene +put Answer i get Badscene i +end +put R 8 len Badscene +test not dpresent +test eq get Ds 3 1 +put A 2 0 +test not dpresent +put A 2 1 +put R 8 160 +test not dpresent +put R 8 0 +test not dpresent +note Refused receive cannot publish a stale event1. +for i ulong len Leak +put Answer i get Leak i +end +put R 8 len Leak +put Inlen 0 1 +put In 0 88 +test not drecv 2 +test eq get Ds 3 1 +test appsent 2 true +test apppoll 2 true +test appsent 2 true +put Inlen 0 len Prompt2 +for i ulong len Prompt2 +put In i get Prompt2 i +end +test dask 3 +test eq get R 0 2 +test eq get Ds 2 1 +test eq get Dtext get Dsay 0 73 +for i ulong len Code2 +put In i get Code2 i +end +put Inlen 0 len Code2 +inbound 1 +test drecv 4 +test eq get Dm 1 0 +test apppoll 4 true +test appsent 4 true +for i ulong len Done2 +put In i get Done2 i +end +put Inlen 0 len Done2 +inbound 2 +test drecv 5 +test eq get Dm 1 1 +test eq get Dm 2 2 +test eq get Dview 0 1 +test eq get Dview 1 0 +test eq get Dview 2 2 +test eq get Dstart 0 0 +test eq get Dlen 0 2 +test eq get Dline 0 1 +test eq get Dcode 0 104 +test eq get Dcode 1 105 +test eq get Dtext get Dsay 0 68 +note Code completion does not require a nonempty closing sentence. +put R 8 0 +test dpresent +test eq get Dm 1 1 +test eq get Dcode 0 104 +put Code 0 88 +test not dpresent +test eq get Dcode 0 104 +test eq get Dlen 0 2 +put Code 0 104 +note Later assembly may reuse Code; the displayed snapshot cannot alias it. +codebeg 3 +put Code 0 88 +test eq get Dcode 0 104 +put A 2 0 +test not dpresent +test eq get Dm 1 1 +put Dtext 2303 88 +put Dcode 32767 88 +put Dstart 4095 88 +put Dlen 4095 88 +put Dline 4095 88 +dreset +test eq get Dm 0 0 +test eq get Dm 1 0 +test eq get Dview 0 0 +test eq get R 0 2 +test eq get Q 1 2 +same = true +for i ulong 2304 +if ne get Dtext i 0 +same = false +end +end +test same +same = true +for i ulong 32768 +if ne get Dcode i 0 +same = false +end +end +test same +same = true +for i ulong 4096 +if ne or or get Dstart i get Dlen i get Dline i 0 +same = false +end +end +test same +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L756/reply.log b/evidence/allen-omega-L694/L756/reply.log new file mode 100644 index 00000000..d11a72ad --- /dev/null +++ b/evidence/allen-omega-L694/L756/reply.log @@ -0,0 +1,15 @@ +801 0 +802 0 +803 0 +804 0 +805 0 +806 0 +807 0 +808 0 +809 0 +810 0 +811 0 +812 0 +813 0 +814 0 +815 0 diff --git a/evidence/allen-omega-L694/L756/runtime.log b/evidence/allen-omega-L694/L756/runtime.log new file mode 100644 index 00000000..5168e6f3 --- /dev/null +++ b/evidence/allen-omega-L694/L756/runtime.log @@ -0,0 +1,28 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 diff --git a/evidence/allen-omega-L694/L756/scene-input.log b/evidence/allen-omega-L694/L756/scene-input.log new file mode 100644 index 00000000..edd8e122 --- /dev/null +++ b/evidence/allen-omega-L694/L756/scene-input.log @@ -0,0 +1,63 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 diff --git a/evidence/allen-omega-L694/L756/scene.log b/evidence/allen-omega-L694/L756/scene.log new file mode 100644 index 00000000..44a4b2b1 --- /dev/null +++ b/evidence/allen-omega-L694/L756/scene.log @@ -0,0 +1,14 @@ +1001 0 +1002 0 +1003 0 +1004 0 +1005 0 +1006 0 +1007 0 +1008 0 +1009 0 +1010 0 +1011 0 +1012 0 +1013 0 +1014 0 diff --git a/evidence/allen-omega-L694/L756/scenecap-mutant.log b/evidence/allen-omega-L694/L756/scenecap-mutant.log new file mode 100644 index 00000000..502843ec --- /dev/null +++ b/evidence/allen-omega-L694/L756/scenecap-mutant.log @@ -0,0 +1,63 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 1 +60 0 +61 0 +62 1 +63 1 diff --git a/evidence/allen-omega-L694/L756/scheduler.log b/evidence/allen-omega-L694/L756/scheduler.log new file mode 100644 index 00000000..1d8ffd12 --- /dev/null +++ b/evidence/allen-omega-L694/L756/scheduler.log @@ -0,0 +1,213 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 +183 0 +184 0 +185 0 +186 0 +187 0 +188 0 +189 0 +190 0 +191 0 +192 0 +193 0 +194 0 +195 0 +196 0 +197 0 +198 0 +199 0 +200 0 +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 diff --git a/evidence/allen-omega-L694/L756/session-mutant.log b/evidence/allen-omega-L694/L756/session-mutant.log new file mode 100644 index 00000000..9ce7ef78 --- /dev/null +++ b/evidence/allen-omega-L694/L756/session-mutant.log @@ -0,0 +1,24 @@ +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 1 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 diff --git a/evidence/allen-omega-L694/L756/short.log b/evidence/allen-omega-L694/L756/short.log new file mode 100644 index 00000000..a9da2dc8 --- /dev/null +++ b/evidence/allen-omega-L694/L756/short.log @@ -0,0 +1,20 @@ +401 0 +410 0 +411 0 +412 0 +413 0 +414 0 +402 0 +403 0 +404 0 +405 0 +406 0 +700 0 +701 0 +702 0 +703 0 +704 0 +705 0 +407 0 +408 0 +409 0 diff --git a/evidence/allen-omega-L694/L756/source.sha256 b/evidence/allen-omega-L694/L756/source.sha256 new file mode 100644 index 00000000..5b5bc9f7 --- /dev/null +++ b/evidence/allen-omega-L694/L756/source.sha256 @@ -0,0 +1,55 @@ +56936108de0087499bb62a117a275f27b01d7bfb05eb8f6250f13ab8783e1095 native/omega/allen/application.om +184f4270c72c4eca6a7afdd28b70a608f2e237980b12c8a7bfc2c7d2c3e625b9 native/omega/allen/base.om +795ca28627a19f1088de0f23277e79cdac921ff88451c606c7b655ce0f2e8a5b native/omega/allen/build-one.sh +4d2235ac5d6b237695b1c3112f70ebdfa0cebafa2ec8e691e4be4de37a62199b native/omega/allen/code.om +75e86e193346a5548e596c84fa7d65aaeefd69f9979a648e0bf53f0f97cd9eb4 native/omega/allen/context.om +76ee9cdeaac036905c76dfa29f42bf5a78d1259ad1656adfaa24916c3b93550d native/omega/allen/courier.om +cd39998b357096c5e628c40e6ffc53cb3674d78b6307e1e9a0b901ebaabd292f native/omega/allen/gate.sh +9d71a653870eeef678f95df04db9c38aedaadd06e7c74bf3e5d9fde6e28f82f8 native/omega/allen/golden.sh +06087bc573ebb876a0ed80f6025c592fb4b1d23335169c3da402824fd1482c35 native/omega/allen/intent.om +4bc37c95d553364c5d2925d8ff9e8a53b1a61974513e6f492f77b7ebb05bbda4 native/omega/allen/main.om +068292abd04d3a61b063fc5380b22a56c4235a87915c219ebf3b37d16d7bc9c7 native/omega/allen/memory.om +b4d7b6e6cd680d2ba1eec2978b0cbb81ffc63035b73f5c3726bdad97a7b6aa04 native/omega/allen/paint.om +6afdb75311c0fbc5293034ac3ba315c231439c694750f6d8c3a1996cd34abff3 native/omega/allen/PRESENTATION.md +d3e3004fb587f75514c638b8b723c996303f664a74b653a6fc674f4600288d41 native/omega/allen/presentation.om +330b31b81a60f3dc553b87316d2fa1c3df9106af5fe7975911ba00b8c356f626 native/omega/allen/provider-core.om +258b9c1f6a7447540c9a8b8cbf2176165ab3e5d80e9528e0b06c37ea745490c1 native/omega/allen/PROVIDER.md +ef0d5dcc14b68bf4ee24468db703fd7dc98ffd982e045c719d42a78e442546ba native/omega/allen/provider.om +068a3b978c1e79a6ded18696d6fb034f52b90e16a676ce180a8cd260d4c66a2f native/omega/allen/README.md +e50a7f673aaee92aba4a3aec303aa93b071121c09ad05d4ad1dcc2deb9706dcc native/omega/allen/reply.om +5b01eae03204d08f6d207ef29f2ba09a1d9f249f1738f68f151214675a4ff2ed native/omega/allen/runtime.om +c16d61dbcb81f7ef8196c937929a53e47de3de0015e5d663bcd8e49b3cb05002 native/omega/allen/scene-input.om +c8d4a437b41538cc1eeb62a2029c6993d41e5ef90cc7b26c8e1c92bc98ec57d3 native/omega/allen/scene.om +615dff78462a715153b3d891b2cfe146c318d3a0a26ae1aaa642484f965c12df native/omega/allen/scheduler.om +f4e6bb5571a0700febdecfc6209ae1c088eab50a82bce4d8a10179408e3abb5f native/omega/allen/tests/application.om +f085198549d1c235a97574ff6f6560ce82217611f4051fc3dbbc8286aab6d536 native/omega/allen/tests/check.om +b76438a85257bd95768115047be286c107e3723628a16a0541870732d0849a42 native/omega/allen/tests/code.om +c61bb0ca8f70114e6fd180e9f9a48ec4d2f927152269c11bfc9df55dc13bc1bc native/omega/allen/tests/context.om +98105e1c30626f54da07940fe0415637730b7e112ea39ba2aae1f2d648993373 native/omega/allen/tests/courier.om +f524aab74657dc2e9e4330bf42bc05ef01ce3e8f08a05c80371be0c0a33764d3 native/omega/allen/tests/edges.om +a2e8bcde92d522216a4fa99559dd3bcba096aea86127364587dadcc2bfb585af native/omega/allen/tests/fixture.om +c9ef2bee7cbd1c072c6045d62c55f3bdd938901e91792cee72ea57fb8f25a198 native/omega/allen/tests/golden.om +8ba742d85ea510586f3cf86661bc0f28c5d99b59981c2d3fb220705efad24564 native/omega/allen/tests/intent.om +861d9af698b021056cceb6c00ae3458558db415963fe832d3fca7da55731cf7b native/omega/allen/tests/memory.om +13e4db7436165783c6aad48497ffe89fa6e5ba3de928e66a766c29e1e817fcf5 native/omega/allen/tests/paint.om +a36e1168fb5b19f5d1b444c6e0d171a6b55a0ffd7e1920438304afd0415d09ba native/omega/allen/tests/presentation-mutants.om +b051af93057752c3d361e1aa5a4dc31bd0853e09d2d2a213d82a282f5709f641 native/omega/allen/tests/presentation.om +e6d232d92d74d88423cebbbbfc6e403ea9b865b80c909e1d23087001d905035a native/omega/allen/tests/probe.om +4b942849652c81ee775b6089e2696c059de934d7fd0ff2a81ae380b2b39ffbfe native/omega/allen/tests/provider-core.om +b98923bd7df278ed0cd8a46c90d90fda296e27c8d60afdd4848ed86dba8221cc native/omega/allen/tests/provider-input.om +37480ca89922dea787a7acb72835a0109b3549461791e7499789ed25932b397c native/omega/allen/tests/provider-mutants.om +d1b1338b2cabe207c1cd9a4bd92b11f51502c29af4b754e2b39fac06d80b28ed native/omega/allen/tests/provider-output.om +8616252944ac2f2903427a6cbf165137087addf3eff169f05f6801d38dac0962 native/omega/allen/tests/provider-process.om +8fbc8a0517900efd771a994686356416a0fea5e20cfd9bc26c787850398113df native/omega/allen/tests/render.om +094a5e833bae7dfd3b013e3f015f143e9d7bd3efe9b9c896a7f58b09e1ec14b8 native/omega/allen/tests/reply.om +bab9b0e853aa4b62918353a5d1625a3171deebfb639e599fe9751b5a61a3df62 native/omega/allen/tests/runtime.om +c5847b4ea0c7df81691fadf9af2f258ad02d3fa588a400448f6d34d7819570b4 native/omega/allen/tests/scene-input.om +b9c84d9a58658589137764fe60209d8320550dd8ed99fa6026df65ba48737e4f native/omega/allen/tests/scene.om +bf984fa9cf63ddb569147afc2a028ccdafdbeae2067125cf35d658e5d00f4c94 native/omega/allen/tests/scheduler.om +521fff50f312b64801017b1349d9a31dac6eac50eb989d93d2dbac4e100f5007 native/omega/allen/tests/stdio-overflow.om +89aee5326b428147ea6da9aa739b6679e214ed114ae5f41d3b70299cf864092c native/omega/allen/tests/view.om +0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0 native/omega/allen/vendor/OMEGA-LICENSE +b234738e8ce81b3d67586deb41fdaab4543169d4b69e86fd3dc28a08432ab5fc native/omega/allen/vendor/PROVENANCE.md +992ec4a4957271b442740598136887a5c610effcd8ae9fb9480a006a4f181097 native/omega/allen/vendor/sha256-core.om +0781cdcec18570a57afbe3be4a6717dd2d1fa4c887b49a3e4cb542b594f8a041 native/omega/allen/vendor/sha256.om +abbefd2f7dc48f2ac28b9526f5c2e5b369da4b7c5e84dde6e6a3cd20bd5687ac native/omega/allen/view.om diff --git a/evidence/allen-omega-L694/L756/stale-mutant.log b/evidence/allen-omega-L694/L756/stale-mutant.log new file mode 100644 index 00000000..ac2e3d09 --- /dev/null +++ b/evidence/allen-omega-L694/L756/stale-mutant.log @@ -0,0 +1,28 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 1 +7 1 +8 1 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 diff --git a/evidence/allen-omega-L694/L756/staleview-mutant.log b/evidence/allen-omega-L694/L756/staleview-mutant.log new file mode 100644 index 00000000..c0c96c65 --- /dev/null +++ b/evidence/allen-omega-L694/L756/staleview-mutant.log @@ -0,0 +1,75 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 1 +35 1 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 diff --git a/evidence/allen-omega-L694/L756/summary.json b/evidence/allen-omega-L694/L756/summary.json new file mode 100644 index 00000000..887a8640 --- /dev/null +++ b/evidence/allen-omega-L694/L756/summary.json @@ -0,0 +1,57 @@ +{ + "base": "43eae848f0a44604b42378d9ea3170278b5f3f8f", + "checks": { + "runtime": 28, + "code": 23, + "courier": 24, + "scheduler": 213, + "application": 182, + "provider-core": 100, + "memory": 79, + "context": 142, + "intent": 8, + "reply": 15, + "view": 13, + "scene": 14, + "scene-input": 63, + "paint": 11, + "edges": 352, + "short": 20, + "long": 292, + "provider-stream": 292, + "provider-fragment": 292, + "provider-process": 3, + "provider-consumer": 3, + "provider-producer": 3, + "provider-bad-1": 5, + "provider-bad-2": 5, + "provider-bad-3": 5, + "provider-bad-4": 5, + "provider-bad-5": 5, + "provider-bad-6": 17, + "presentation": 75 + }, + "total_checks": 2289, + "compiled_rejected_mutants": { + "inputtail-mutant": 1, + "session-mutant": 1, + "appcode-mutant": 3, + "contextjob-mutant": 36, + "readback-mutant": 7, + "staleview-mutant": 2, + "hash-mutant": 2, + "contextnote-mutant": 5, + "autosent-mutant": 8, + "thinking-mutant": 6, + "pendingwire-mutant": 1, + "scenecap-mutant": 3, + "crc-mutant": 2, + "ackstop-mutant": 27, + "stale-mutant": 3, + "framecheck-mutant": 4, + "keepalive-mutant": 40 + }, + "presentation_binary_sha256": "749a510e3d8922cd7ef28a733b08f46687be36706585261e37f2a3cd6792ab40", + "compiler_sha256": "191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9", + "scope": "Host application-to-scene/code snapshots; raw provider entry unchanged; pixel renderer/display/live/hardware NOT_RUN" +} diff --git a/evidence/allen-omega-L694/L756/thinking-mutant.log b/evidence/allen-omega-L694/L756/thinking-mutant.log new file mode 100644 index 00000000..74b41a12 --- /dev/null +++ b/evidence/allen-omega-L694/L756/thinking-mutant.log @@ -0,0 +1,63 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 1 +15 1 +16 0 +17 0 +18 0 +19 1 +20 1 +21 1 +22 1 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 diff --git a/evidence/allen-omega-L694/L756/view.log b/evidence/allen-omega-L694/L756/view.log new file mode 100644 index 00000000..8b194f11 --- /dev/null +++ b/evidence/allen-omega-L694/L756/view.log @@ -0,0 +1,13 @@ +901 0 +902 0 +903 0 +904 0 +905 0 +906 0 +907 0 +908 0 +909 0 +910 0 +911 0 +912 0 +913 0 diff --git a/evidence/allen-omega-L694/L758/README.md b/evidence/allen-omega-L694/L758/README.md new file mode 100644 index 00000000..c5c94d9f --- /dev/null +++ b/evidence/allen-omega-L694/L758/README.md @@ -0,0 +1,31 @@ +# L758 handwritten native Allen font + +font.om implements integer geometry, segment generation and antialiased masks in +seeded Omega. font-data.om retains the existing95 printable ASCII designs and91 +sine samples; the collector checked exact declarative transcription. No compiler, +translator or foreign runtime constructs or executes the Omega font. + +The native combined gate passed. summary.json counts actual test rows and compiled +behavioral mutant failures.294 native glyph records, including3 size/weight pairs +and unsupported-byte fallback cases, match436341 frozen external-oracle bytes. +The oracle was the unmodified legacy allen_font.c compiled into a separate host +shared library only for reference collection. Its source hash, command and output +hash are in oracle.json; collection script is retained as external reference text. +The native gate consumes those frozen bytes, not C/Python font execution. + +Reproduce: `quiet-build native/omega/allen/gate.sh /absolute/fresh/private/output`. +This builds font-output and font-render with the pinned seed. The final native +specimen was visually inspected: all printable characters recognizable and no +obvious clipping. PNG is lossless format conversion of the actual Omega PPM; +there is no generated imagery, font substitution or invented star field. + +Preserved development failures: weight parameter collided with existing weight +function; register-budget expressions were split into helpers without loosening +assertions. The initial oracle stream stopped after its64-byte space record with +exit105: negative long->ulong conversion is checked, not a bitcast. Output encoding +now explicitly forms two-complement fields via complement of magnitude-minus-one. +The old stream/source are retained as native-font.bin and output.om; corrected +native output matches the frozen oracle exactly. RED4/RED5 are meaningful stub +failures, separate from compiler setup errors. New tests use fixed nonzero failure +status. This does not implement scene layout, animation, framebuffer drivers, +live model/device interfaces or physical iMac execution. Font review is pending. diff --git a/evidence/allen-omega-L694/L758/ackstop-mutant.log b/evidence/allen-omega-L694/L758/ackstop-mutant.log new file mode 100644 index 00000000..5d0598cb --- /dev/null +++ b/evidence/allen-omega-L694/L758/ackstop-mutant.log @@ -0,0 +1,213 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 1 +65 1 +66 0 +67 0 +68 0 +69 1 +70 1 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 1 +165 0 +166 0 +167 0 +168 0 +169 1 +170 0 +171 1 +172 1 +173 0 +174 1 +175 0 +176 0 +177 0 +178 1 +179 0 +180 1 +181 0 +182 1 +183 0 +184 1 +185 0 +186 1 +187 0 +188 1 +189 0 +190 1 +191 0 +192 1 +193 0 +194 1 +195 1 +196 1 +197 1 +198 0 +199 1 +200 0 +201 0 +202 1 +203 1 +204 1 +205 0 +206 1 +207 1 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 diff --git a/evidence/allen-omega-L694/L758/appcode-mutant.log b/evidence/allen-omega-L694/L758/appcode-mutant.log new file mode 100644 index 00000000..c9c50601 --- /dev/null +++ b/evidence/allen-omega-L694/L758/appcode-mutant.log @@ -0,0 +1,182 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 1 +76 1 +77 1 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 diff --git a/evidence/allen-omega-L694/L758/application.log b/evidence/allen-omega-L694/L758/application.log new file mode 100644 index 00000000..2e8a428d --- /dev/null +++ b/evidence/allen-omega-L694/L758/application.log @@ -0,0 +1,182 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 diff --git a/evidence/allen-omega-L694/L758/autosent-mutant.log b/evidence/allen-omega-L694/L758/autosent-mutant.log new file mode 100644 index 00000000..2aed7f8a --- /dev/null +++ b/evidence/allen-omega-L694/L758/autosent-mutant.log @@ -0,0 +1,100 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 1 +48 0 +49 0 +50 1 +51 1 +52 0 +53 1 +54 0 +55 1 +56 0 +57 0 +58 0 +59 1 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 1 +70 0 +71 0 +72 0 +73 0 +74 1 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 diff --git a/evidence/allen-omega-L694/L758/binaries.sha256 b/evidence/allen-omega-L694/L758/binaries.sha256 new file mode 100644 index 00000000..41244974 --- /dev/null +++ b/evidence/allen-omega-L694/L758/binaries.sha256 @@ -0,0 +1,50 @@ +7329673aba95f27f3461a39a44a40ac08b1323c359a4e7c2ee37edb3c2fab80d /home/drakestapleton/handoffs/allen-omega-L694/L758/full/provider-core +2a098c5dd21eb61aa1d90928db1513e38b5c7fa6fcb0aa0b56e4d21d784c0228 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/scheduler +878c8f24c1fadc7e24e0cf80552a05636afe46561c619744e77abed4b06e7f10 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/readback-mutant +f6f332f8578a9b586dd33d21d64096e5240b5bfb7bfd1a8a56eeb3a73e33257e /home/drakestapleton/handoffs/allen-omega-L694/L758/full/font-render +10ffbc3d3a5790c520b98a4439e8be8dd2a025fca7399ab40cae795a3234448c /home/drakestapleton/handoffs/allen-omega-L694/L758/full/view +dfb84d98ad2d5ac9e001cddaaeec549bc89407410eb47895a659dd3bceca139d /home/drakestapleton/handoffs/allen-omega-L694/L758/full/contextnote-mutant +71043853f991d69e84e32edefb3063a1276e7c7c4517ca712f8bdf0aa03c9eac /home/drakestapleton/handoffs/allen-omega-L694/L758/full/font +bca049b7bd4c09752c3c024908154e48f7deb6c9b1341204491c67bcf223c622 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/allen +837b3ea1d2cf1494d924802c461ade7e323156cd509bd6215250cd39e87d7415 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/reply +881b4d359aa2e24c2d26b6acc2c3c8f7ce75dc11943138ea0a51489014e12d0e /home/drakestapleton/handoffs/allen-omega-L694/L758/full/thinking-mutant +6030b378595b43558ef3a4e0c00f3fe8a73776172c5f65f450c858bfae58dc21 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/inputtail-mutant +a3959f13a3fea28a6f5dbe9555c7d80bdc3e0245cf0dcb298bb4404b28c657f2 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/ackstop-mutant +8140c7533f9aaa5d4832260c7aee7249303ac5f82102f0f01a42bb2fd6615876 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/hash-mutant +df4e5cdc23d2153b3ebb65d1830e7f472b191bb1f88ee357e02f022d9090884e /home/drakestapleton/handoffs/allen-omega-L694/L758/full/golden +0efc3f7805910f6cfa3710a5def58d37bc93c9eff20e670e60ca569c556096d3 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/session-mutant +ad752b259a96dbad15c0c40bbac38c2c30d555ed1d4940cb688a04ad0699bbe8 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/scene-input +c6cecd5fcd2ffd79da7319116cc92e4ab3d09cb511c3a3e9db15b60a6d495bde /home/drakestapleton/handoffs/allen-omega-L694/L758/full/intent +9134b9f6e337374d7ea78c2fe0585cae2e9a4d6a415b3fd84289d4fdbce68611 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/provider-input +34c901cfb34adcbba1212045f9209a5fb3f385b9011c116be8bf8be9ed173f41 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/font-mutants +1aa9709b2c362b714671c11aa4c3e266129d93cd0ab10513cf1797c14e2c5cf4 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/fixture +c0ce92c97f1ebb29e7505057c3adb3dac817a1929d2a460576b76a2964586bb4 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/provider +32ce3036c67adc963120c2050f9303d55d4418a6a2aedb2916104a4a7ac97290 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/context +f24f15cdb086fae0fa03edd76830844421a75c1b7153e6dad9c7fd384e6e09a9 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/staleview-mutant +4502b918d86d4f143b5055092a1a761bfa416b8c621bd2ae31e989984ae30779 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/runtime +0380c6c510bb299a9163c0d87d0a5e139190535ff3fa91f56218b6213cc8af35 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/code +52ffd81fe79089c4e03accba53621f9f90c52d6ae2be6e33fdd0f09e42c07642 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/provider-mutants +e77f29c8d8f37d7bef65e01bd63587395f9aef75f4f3afde4d4fca8f423dc299 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/edges +a389d7dd2f8de1f6d69d888c3ddec7e0fa293ed8eec0504b43d35d2ca79e2463 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/presentation-mutants +684eafb9429e7535130762bda579d408a11a0d0a97c6aedaebde20a191ed048d /home/drakestapleton/handoffs/allen-omega-L694/L758/full/appcode-mutant +c1b9e8fc825891855f0c0e6ab88456279f944fa92a0a0d273316db80fb3eb24c /home/drakestapleton/handoffs/allen-omega-L694/L758/full/render +63faf7ed9384ca227c0528f95301b79f52e3858583fc19e4bf03cb79de23aaff /home/drakestapleton/handoffs/allen-omega-L694/L758/full/stale-mutant +64dd677c0e22e2a28e76ce4e96d78444eb494f1807307d3608aa18a914c3650f /home/drakestapleton/handoffs/allen-omega-L694/L758/full/courier +f5f191eb6dec5ae630451fa6e74c4e708812073b5910cd3e648c0dba0f2d18f8 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/scene +0ebbaf039756ad1b1bb065ac6c4ef33bc1f3864dcb529154153536006e51e978 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/presentation +60b944dc113979199146253103407910bd1b1ea49d3906eb2fc657041ac587c5 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/pendingwire-mutant +31cf1b10ed7d15b848954abf55253287d769937efe21c38f81defa9488027697 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/font-output +7cd0be2c811ee6a0596401f35d65e3658d2175c642742523e8104430d4f2a08e /home/drakestapleton/handoffs/allen-omega-L694/L758/full/framecheck-mutant +295e36a5fc5c21f1e62b21ae5538a9482e26f86633b20e0842314ea7f33e9ac6 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/scenecap-mutant +8482fb8686b5e55a338f3cc07d806924fe2d3ff4c1566e6730b713b57b06bd2a /home/drakestapleton/handoffs/allen-omega-L694/L758/full/fontroot-mutant +60b9826dd3e7ef145cb015be7a49bec6e38313da8c03f885262b465e46d11742 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/contextjob-mutant +2cdcf74961aa2a14f5a7a2669e28e2d94f390d24ac1bd1656360d28b59a42774 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/paint +fc8b69c140c01f3b48e2be32910fb315a1a9926a6e2573e9fdf4ad7a395c888c /home/drakestapleton/handoffs/allen-omega-L694/L758/full/crc-mutant +0e19c774b4ba42b5fab9917ccb8175ad088a1c84d5505d7f50d989f498376bdd /home/drakestapleton/handoffs/allen-omega-L694/L758/full/autosent-mutant +79a01c55d9ee840c537c965f92d6f104600af4316ae91a7e5b9eada656ca4800 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/provider-output +71f99242bcad6ede239b240602470fcf3d5da3267eb47a1ad522241958222367 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/stdio-overflow-input +9dd95114e84ef9ceaa7489d28768767344ee359e6e586f9c03daa2b920fe07b1 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/keepalive-mutant +ade800d8f3924094ee95cd864ba4081aa27d89a808a10066e4d9a8e0c87ad2ad /home/drakestapleton/handoffs/allen-omega-L694/L758/full/provider-process +17bfe1c52a607b17b96485dafdbcdaa7155ba2c179c47d7fb46fd980abd95805 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/memory +5546806fbfdce3c49a76b8737a0b8d32902c56a18af6bee18cf7a2d225b8393f /home/drakestapleton/handoffs/allen-omega-L694/L758/full/fontalpha-mutant +9d3d40bd0db31b9fc246e32c4c9c0472207548306921c177a2be3a73fe3c3fd6 /home/drakestapleton/handoffs/allen-omega-L694/L758/full/application diff --git a/evidence/allen-omega-L694/L758/code.log b/evidence/allen-omega-L694/L758/code.log new file mode 100644 index 00000000..e7e197b7 --- /dev/null +++ b/evidence/allen-omega-L694/L758/code.log @@ -0,0 +1,23 @@ +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 diff --git a/evidence/allen-omega-L694/L758/context.log b/evidence/allen-omega-L694/L758/context.log new file mode 100644 index 00000000..df62cddb --- /dev/null +++ b/evidence/allen-omega-L694/L758/context.log @@ -0,0 +1,142 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 diff --git a/evidence/allen-omega-L694/L758/contextjob-mutant.log b/evidence/allen-omega-L694/L758/contextjob-mutant.log new file mode 100644 index 00000000..3432d4b2 --- /dev/null +++ b/evidence/allen-omega-L694/L758/contextjob-mutant.log @@ -0,0 +1,142 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 1 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 1 +72 1 +73 1 +74 1 +75 1 +76 1 +77 0 +78 0 +79 1 +80 1 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 1 +88 1 +89 0 +90 1 +91 0 +92 1 +93 0 +94 1 +95 0 +96 1 +97 0 +98 1 +99 0 +100 1 +101 0 +102 1 +103 0 +104 1 +105 0 +106 1 +107 0 +108 1 +109 1 +110 1 +111 1 +112 1 +113 1 +114 1 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 1 +123 0 +124 1 +125 0 +126 1 +127 0 +128 1 +129 0 +130 1 +131 0 +132 1 +133 0 +134 1 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 1 +142 1 diff --git a/evidence/allen-omega-L694/L758/contextnote-mutant.log b/evidence/allen-omega-L694/L758/contextnote-mutant.log new file mode 100644 index 00000000..b5c08759 --- /dev/null +++ b/evidence/allen-omega-L694/L758/contextnote-mutant.log @@ -0,0 +1,142 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 1 +38 1 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 1 +47 0 +48 1 +49 0 +50 0 +51 0 +52 0 +53 0 +54 1 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 diff --git a/evidence/allen-omega-L694/L758/courier.log b/evidence/allen-omega-L694/L758/courier.log new file mode 100644 index 00000000..8402df49 --- /dev/null +++ b/evidence/allen-omega-L694/L758/courier.log @@ -0,0 +1,24 @@ +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 diff --git a/evidence/allen-omega-L694/L758/crc-mutant.log b/evidence/allen-omega-L694/L758/crc-mutant.log new file mode 100644 index 00000000..a0d90bd4 --- /dev/null +++ b/evidence/allen-omega-L694/L758/crc-mutant.log @@ -0,0 +1,23 @@ +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 1 +117 1 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 diff --git a/evidence/allen-omega-L694/L758/edges.log b/evidence/allen-omega-L694/L758/edges.log new file mode 100644 index 00000000..e8d0deea --- /dev/null +++ b/evidence/allen-omega-L694/L758/edges.log @@ -0,0 +1,352 @@ +1201 0 +1202 0 +1203 0 +1204 0 +1205 0 +1206 0 +1207 0 +1208 0 +1209 0 +1210 0 +1211 0 +1212 0 +1213 0 +1214 0 +1220 0 +1221 0 +1222 0 +1223 0 +1224 0 +1225 0 +1226 0 +1227 0 +1228 0 +1229 0 +1230 0 +1231 0 +1232 0 +1233 0 +1234 0 +1235 0 +1236 0 +1237 0 +1238 0 +1239 0 +1240 0 +1241 0 +1242 0 +1243 0 +1244 0 +1245 0 +1246 0 +1247 0 +1248 0 +1249 0 +1250 0 +1251 0 +1252 0 +1253 0 +1254 0 +1255 0 +1256 0 +1257 0 +1258 0 +1259 0 +1260 0 +1261 0 +1262 0 +1301 0 +1302 0 +1303 0 +1304 0 +1305 0 +1306 0 +1310 0 +1311 0 +1312 0 +1313 0 +1314 0 +1315 0 +1316 0 +1317 0 +1318 0 +1319 0 +1320 0 +1321 0 +1322 0 +1323 0 +1324 0 +1325 0 +1326 0 +1327 0 +1328 0 +1329 0 +1330 0 +1331 0 +1332 0 +1333 0 +1334 0 +1335 0 +1336 0 +1337 0 +1338 0 +1339 0 +1340 0 +1341 0 +1342 0 +1343 0 +1344 0 +1345 0 +1346 0 +1347 0 +1348 0 +1349 0 +1350 0 +1351 0 +1352 0 +1353 0 +1354 0 +1355 0 +1356 0 +1357 0 +1358 0 +1359 0 +1360 0 +1361 0 +1362 0 +1363 0 +1364 0 +1365 0 +1366 0 +1367 0 +1368 0 +1369 0 +1370 0 +1371 0 +1372 0 +1373 0 +1374 0 +1375 0 +1376 0 +1377 0 +1378 0 +1379 0 +1380 0 +1381 0 +1382 0 +1383 0 +1384 0 +1385 0 +1386 0 +1387 0 +1388 0 +1389 0 +1390 0 +1391 0 +1392 0 +1393 0 +1394 0 +1395 0 +1396 0 +1397 0 +1398 0 +1399 0 +1400 0 +1401 0 +1402 0 +1403 0 +1404 0 +1405 0 +1406 0 +1407 0 +1408 0 +1409 0 +1410 0 +1411 0 +1412 0 +1413 0 +1414 0 +1415 0 +1416 0 +1417 0 +1418 0 +1419 0 +1420 0 +1421 0 +1422 0 +1423 0 +1424 0 +1425 0 +1426 0 +1427 0 +1428 0 +1429 0 +1430 0 +1431 0 +1432 0 +1433 0 +1434 0 +1435 0 +1436 0 +1437 0 +1438 0 +1439 0 +1440 0 +1441 0 +1442 0 +1443 0 +1444 0 +1445 0 +1446 0 +1447 0 +1448 0 +1449 0 +1450 0 +1451 0 +1452 0 +1453 0 +1454 0 +1455 0 +1456 0 +1457 0 +1458 0 +1459 0 +1460 0 +1461 0 +1462 0 +1463 0 +1464 0 +1465 0 +1466 0 +1467 0 +1468 0 +1469 0 +1470 0 +1471 0 +1472 0 +1473 0 +1474 0 +1475 0 +1476 0 +1477 0 +1478 0 +1479 0 +1480 0 +1481 0 +1482 0 +1483 0 +1484 0 +1485 0 +1486 0 +1487 0 +1488 0 +1489 0 +1490 0 +1491 0 +1492 0 +1493 0 +1494 0 +1495 0 +1496 0 +1497 0 +1498 0 +1499 0 +1500 0 +1501 0 +1502 0 +1503 0 +1504 0 +1505 0 +1506 0 +1507 0 +1508 0 +1509 0 +1510 0 +1511 0 +1512 0 +1513 0 +1514 0 +1515 0 +1516 0 +1517 0 +1518 0 +1519 0 +1520 0 +1521 0 +1522 0 +1523 0 +1524 0 +1525 0 +1526 0 +1527 0 +1528 0 +1529 0 +1530 0 +1531 0 +1532 0 +1533 0 +1534 0 +1535 0 +1536 0 +1537 0 +1538 0 +1539 0 +1540 0 +1541 0 +1542 0 +1543 0 +1544 0 +1545 0 +1546 0 +1547 0 +1548 0 +1549 0 +1550 0 +1551 0 +1552 0 +1553 0 +1554 0 +1555 0 +1556 0 +1557 0 +1558 0 +1559 0 +1560 0 +1561 0 +1562 0 +1563 0 +1564 0 +1565 0 +1570 0 +1571 0 +1572 0 +1575 0 +1573 0 +1574 0 +1600 0 +1601 0 +1602 0 +1603 0 +1604 0 +1605 0 +1606 0 +1607 0 +1610 0 +1611 0 +1612 0 +1613 0 +1614 0 +1615 0 +1616 0 +1617 0 +1701 0 +1702 0 +1703 0 +1704 0 +1705 0 +1706 0 +1707 0 +1708 0 +1709 0 +1710 0 +1711 0 diff --git a/evidence/allen-omega-L694/L758/font-specimen.png b/evidence/allen-omega-L694/L758/font-specimen.png new file mode 100644 index 00000000..e66b4aca Binary files /dev/null and b/evidence/allen-omega-L694/L758/font-specimen.png differ diff --git a/evidence/allen-omega-L694/L758/font-specimen.ppm b/evidence/allen-omega-L694/L758/font-specimen.ppm new file mode 100644 index 00000000..537204de --- /dev/null +++ b/evidence/allen-omega-L694/L758/font-specimen.ppm @@ -0,0 +1,31 @@ +P6 +768 384 +255 +?BL½À̽ÀÌ?BL½ÀÌìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞ7:Dor}7:Dacnacn‰Œ—ÏÒÞ‰Œ—‰Œ—ÏÒÞ‰Œ—‰Œ—ÏÒÞ‰Œ—47A{~‰ÏÒÞìðüìðüÏÒÞ}€‹35?‰Œ—ÏÒÞ‰Œ—7:Dìðüìðüìðü.0;”—¢ìðüìðü•˜£?BL½À̽ÀÌ?BLNP[ìðüìðüìðüNP[NP[ìðüìðüìðüNP[NP[ìðüìðüìðüNP[')3¢¥°ìðüìðüìðüìðüìðüìðüìðüìðü £®)+5&QT_QT_'%'2[^i%'2FHS[^iFHSNP[ìðüìðüìðüNP[¿ÃÏìðüìðüìðü[^iÏÒÞìðüìðüìðübep½ÀÌìðüìðü½ÀÌ[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iMOZâåñìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüàäðNP[x{†ìðüìðüìðüìðüx{†&(3âæòìðüâæò%'2nq|ßãïìðüìðüìðüÞâînq|[^iìðüìðüìðü[^iz}ˆìðüìðüìðüÛßë(}�Œìðüìðüìðüàäð!<>Iìðüìðüìðü½ÀÌ[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i?BL½À̽ÀÌ?BL‰Œ—ÏÒÞ‰Œ—ADNìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüCEPsv�ìðüìðüìðüìðüìðüìðüsv�•˜£ìðüìðüìðü[^i�”Ÿìðüìðüìðüìðüìðüìðüìðü�”Ÿ[^iìðüìðüìðü[^i'æêöìðüìðüìðüSV`±´Àìðüìðüìðü€ƒŽ‰Œ—ÏÒÞ‰Œ—’•¡ìðüìðüìðühkv[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i½ÀÌìðüìðü½ÀÌNP[ìðüìðüìðüNP[ ÅÈÔìðüìðüìðüìðüuxƒÏÒÞìðüìðüÏÒÞvy„ìðüìðüìðüìðüÇÊÖ #&0ìðüìðüìðüìðüìðüìðüìðüìðü#&0<>Iìðüìðüìðüìðü%'2ilvìðüìðüìðüìðüìðüìðüìðüìðüìðüilv[^iìðüìðüìðü[^i}€‹ìðüìðüìðüœŸ«69CìðüìðüìðüéíùNP[ìðüìðüìðüNP[çë÷ìðüìðüèìø[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iÝáíìðüìðüÅÈÔknyìðüìðüìðüRU`nq|ìðüìðüìðüØÛç46@ÏÒÞìðüìðüÏÒÞ58BÙÝéìðüìðüìðüWYdvy„ìðüìðüìðü¢¦±¢¦±ìðüìðüìðüvy„¬°»ìðüìðüìðü€ƒŽ áåðìðüìðüìðü¦©µ_bl§ª¶ìðüìðüìðüßãï [^iìðüìðüìðü[^iÏÒÞìðüìðüìðü02=—š¥ìðüìðüìðücfq[^iìðüìðüìðü[^igjuìðüìðüìðü’•¡[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iìðüìðüìðü«¯º…ˆ“ìðüìðüìðü9;FÈÌØìðüìðüìðüNP[ÏÒÞìðüìðüÏÒÞLNYìðüìðüìðü;=H®²½ìðüìðüìðü*,6*-7ìðüìðüìðü­±¼RU`ìðüìðüìðüÙÜèbdoìðüìðüìðü«®¹«®¹ìðüìðüìðüacn[^iìðüìðüìðü[^iJMWìðüìðüìðüª­¹>AKìðüìðüìðüµ¹Ä‰Œ—ÏÒÞ��›%'2[^iìðüìðüìðü[^i%'2��›ÏÒÞ‰Œ—½ÀÌìðüìðüìðü=?I[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i+.8ìðüìðüìðü’•¡ž¡­ìðüìðüìðü!++.8ìðüìðüìðü±´ÀÏÒÞìðüìðüÏÒÞY\g•˜£XZeÊÎÚìðüìðüÖÚå×ÛæìðüìðüÉÍÙÃÇÒìðüìðüìðüjlwž¡­ìðüìðüìðü?BLADNìðüìðüìðüž¡­[^iìðüìðüìðü[^iˆ‹—ìðüìðüìðüXZeÃÇÒìðüìðüìðü%NP[ìðüìðüìðüìðü��›[^iìðüìðüìðü[^i��›ìðüìðüìðüìðüNP[<>Iìðüìðüìðü½ÀÌ[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iEGRìðüìðüìðüx{†·»ÆìðüìðüëïûJMWìðüìðüìðütw‚ÏÒÞìðüìðüÏÒÞÉÍÙìðüìðü×ÛæÖÚåìðüìðüÊÎÚilvìðüìðüìðüÃÇÒÂÆÑìðüìðüãçóäèôìðüìðüÁÅÐ[^iìðüìðüìðü[^iÅÈÔìðüìðüìðüƒ†‘ìðüìðüìðüUXbNP[ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüNP[’•¡ìðüìðüìðühkv[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i^akìðüìðüìðü_blÐÔàìðüìðüÑÕáWYdìðüìðüìðüacnÏÒÞìðüìðüÏÒÞ­±¼ìðüìðüìðü*-7*,6ìðüìðüìðü®²½ÙÜèìðüìðüìðüSV`ÌÐÛìðüìðüÒÖâÒÖâìðüìðüÌÐÛ[^iìðüìðüìðü[^i(ìðüìðüìðüµ¹ÄFITìðüìðüìðü��›‰Œ—ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü‰Œ—çë÷ìðüìðüèìø[^iìðüìðüìðü[^i%'2âæòìðüâæò%'2%'2âæòìðüâæò%'2x{†ìðüìðüìðüFHSêîúìðüìðü¸¼ÇOR]ìðüìðüìðüwz…ÏÒÞìðüìðüÏÒÞvy„ìðüìðüìðü¢¦±¢¦±ìðüìðüìðüvy„‚�ìðüìðüìðü¬°»¿ÃÏìðüìðüãçóâæòìðüìðü¿ÃÏ%'2âæòìðüâæò%'2CEPìðüìðüìðüƒ†‘ìðüìðüìðü´¸Ä%'2��›ìðüìðüìðüìðüìðüìðüìðüìðüìðü��›%'2%'2[^i%'2gjuìðüìðüìðü’•¡[^iìðüìðüìðü[^i%'2[^i%'2%'2[^i%'2‘• ìðüìðüìðü,/9!+ìðüìðüìðüŸ¢®%'2ìðüìðüìðü³¶ÂÏÒÞìðüìðüÏÒÞ#&0ìðüìðüìðüìðüìðüìðüìðüìðü#&0&(3ìðüìðüìðüìðü<>Išž©ìðüìðüìðü@CM?BLìðüìðüìðü›Ÿª%'2[^i%'2ilvìðüìðüìðü[^iÍÑÜìðüìðüÛßë%'2��›ìðüìðüìðüìðüìðüìðüìðüìðüìðü��›%'2%'2âæòìðüâæò%'2½ÀÌìðüìðüìðü=?I[^iìðüìðüìðü[^i?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞìðüìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞìðüìðüìðüÏÒÞÏÒÞÏÒÞ‰Œ—ÇÊÖìðüìðüìðüILVÏÒÞìðüìðüÏÒÞsv�ìðüìðüìðüìðüìðüìðüsv�•˜£ìðüìðüìðü–™¤`bmìðüìðüìðütv� ±´Àìðüìðüìðüacn�“žìðüìðüìðü46@¦©µìðüìðüìðü(‰Œ—ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü‰Œ—[^iìðüìðüìðü[^i<>Iìðüìðüìðü½ÀÌ[^iìðüìðüìðü[^i½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüNP[tv�ìðüìðüìðüØÛç8:EÏÒÞìðüìðüÏÒÞx{†ìðüìðüìðüìðüx{†<>Iìðüìðüìðüìðü&(3ÑÕáìðüìðü;=H ­±¼ìðüìðüìðüÜà좦±ìðüìðüìðü$‹Ž™ìðüìðüìðü02=NP[ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüNP[[^iìðüìðüìðü[^i’•¡ìðüìðüìðühkv[^iìðüìðüìðü[^i½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüNP[ËÏÚìðüìðüìðüìðütw‚ÏÒÞìðüìðüÏÒÞ'QT_QT_&¬°»ìðüìðüìðü€ƒŽ%'2âæòìðüâæò24>ª­¹ìðüìðüìðüìðüknyµ¹Äìðüìðüëïûx{†ìðüìðüìðüCEPNP[ìðüìðüìðüìðü��›[^iìðüìðüìðü[^i��›ìðüìðüìðüìðüNP[[^iìðüìðüìðü[^içë÷ìðüìðüèìø[^iìðüìðüìðü[^i?BL½ÀÌÏÒÞÏÒÞÏÒÞìðüìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞìðüìðüìðüÏÒÞÏÒÞÏÒÞ‰Œ—=@JìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞ}€‹35?RU`ìðüìðüìðüÙÜè[^iìðüìðüìðüÅÈÔìðüìðüìðüìðütv�ÇÊÖìðüìðüØÛçehsìðüìðüìðüSV`‰Œ—ÏÒÞ��›%'2[^iìðüìðüìðü[^i%'2��›ÏÒÞ‰Œ—[^iìðüìðüìðü[^igjuìðüìðüìðü’•¡[^iìðüìðüìðü[^i+.8ìðüìðüìðü’•¡ž¡­ìðüìðüìðü!+HKUãçóìðüìðüìðüìðüìðüìðüìðüìðüìðü¢¥°)+5ÃÇÒìðüìðüìðüjlw%'2äèôìðüìðüìðüìðüìðüìðüvy„%'2[^i%'2ÇË×ìðüìðüÖÚåbepìðüìðüìðüTWa[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i½ÀÌìðüìðüìðü=?I[^iìðüìðüìðü[^iEGRìðüìðüìðüx{†·»Æìðüìðüëïû')3£§²ìðüìðüìðüìðüìðüìðüìðüìðüìðüâåñILVilvìðüìðüìðüÃÇÒRU`ìðüìðüìðüìðüìðüz}ˆ%'2âæòìðüâæò%'2ÈÌØìðüìðüÕÙåbdoìðüìðüìðüUXbNP[ìðüìðüìðüNP[[^iìðüìðüìðü[^i<>Iìðüìðüìðü½ÀÌ[^iìðüìðüìðü[^i^akìðüìðüìðü_blÐÔàìðüìðüÑÕá46@{~‰ÏÒÞìðüìðüìðüìðüìðüìðüìðüìðü>AKÙÜèìðüìðüìðüSV`œŸ«ìðüìðüìðüìðüìðübep‰Œ—ìðüìðüìðü[^iÇÊÖìðüìðüÙÜèfitìðüìðüìðüTWa‰Œ—ÏÒÞ‰Œ—?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞìðüìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BL’•¡ìðüìðüìðühkv[^iìðüìðüìðü[^ix{†ìðüìðüìðüFHSêîúìðüìðü¸¼ÇÏÒÞìðüìðüÏÒÞsv�êîúìðüìðüìðüÉÍÙ‚�ìðüìðüìðü¬°»&QT_QT_'™œ§ìðüìðüìðüìðüìðüìðüìðüBDO)ìðüìðüìðüìðü%'2µ¹Äìðüìðüìðüwz…ìðüìðüìðüBDO½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌNP[[^i[^i[^i[^i[^i[^i[^i[^i[^i[^i[^i%'2çë÷ìðüìðüèìø[^iìðüìðüìðü[^i‘• ìðüìðüìðü,/9!+ìðüìðüìðüŸ¢®ÏÒÞìðüìðüÏÒÞ8:EÙÜèìðüìðüìðüsv�&(3ìðüìðüìðüìðü<>Ix{†ìðüìðüìðüìðüx{†–™¤ìðüìðüìðüìðü´·ÃìðüìðüìðüÕÙå!$.�„�ìðüìðüìðü‘• ¤¨³ìðüìðüìðü"‰Œ—ìðüìðüìðü13>½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½À̉Œ—ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüâæò%'2gjuìðüìðüìðü’•¡[^iìðüìðüìðü[^i‰Œ—ÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞìðüìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞìðüìðüìðüÏÒÞÏÒÞ½ÀÌ?BLÏÒÞìðüìðüÏÒÞKNXìðüìðüìðüÇËו˜£ìðüìðüìðü–™¤sv�ìðüìðüìðüìðüìðüìðüsv�’•¡ìðüìðüìðüìðüˆ‹—!$.ÔØäìðüìðüìðü´·Ã!åéõìðüìðüìðü-0:Ž‘œìðüìðüìðü58B§ª¶ìðüìðüìðü(?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞìðüìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BLÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü[^i½ÀÌìðüìðüìðü=?I[^iìðüìðüìðü[^iNP[ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞ³¶Âìðüìðüìðü$&1<>Iìðüìðüìðüìðü&(3#&0ìðüìðüìðüìðüìðüìðüìðüìðü#&0NP[ìðüìðüìðüìðü‹Ž™BDOìðüìðüìðüìðü“–¢ìðüìðüìðü™�¨ilvìðüìðüìðüZ]hÍÑÜìðüìðüÛßë[^iìðüìðüìðü[^i‰Œ—ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüâæò%'2<>Iìðüìðüìðü½ÀÌNP[ìðüìðüìðüNP[NP[ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞwz…ìðüìðüìðüNP[¬°»ìðüìðüìðü€ƒŽvy„ìðüìðüìðü¢¦±¢¦±ìðüìðüìðüvy„NP[ìðüìðüìðü�’�bepìðüìðüìðüìðüìðüìðüìðü58BDFQìðüìðüìðü€ƒŽìðüìðüìðüµ¹Ä[^iìðüìðüìðü[^iNP[[^i[^i[^i[^i[^i[^i[^i[^i[^i[^i[^i%'2’•¡ìðüìðüìðühkv‰Œ—ÏÒÞ‰Œ—‰Œ—ÏÒÞÏÒÞÏÒÞÏÒÞìðüìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞìðüìðüìðüÏÒÞÏÒÞ½ÀÌ?BLÏÒÞìðüìðüÏÒÞacnìðüìðüìðüXZeRU`ìðüìðüìðüÙÜ讲½ìðüìðüìðü*,6*-7ìðüìðüìðü­±¼[^iìðüìðüìðü\_jƒ†‘ìðüìðüìðüìðüìðü¢¥° *ìðüìðüìðü¶ºÅFITìðüìðüìðü�’�[^iìðüìðüìðü[^içë÷ìðüìðüèìø+.8ìðüìðüìðü’•¡ž¡­ìðüìðüìðü!+ÏÒÞìðüìðüÏÒÞsv�ìðüìðüìðüJMWÃÇÒìðüìðüìðüjlwÊÎÚìðüìðüÖÚå×ÛæìðüìðüÉÍÙNP[ìðüìðüìðüloz£§²ìðüìðüìðüìðü=@JÄÇÓìðüìðüìðü€ƒŽìðüìðüìðüTWa[^iìðüìðüìðü[^igjuìðüìðüìðü’•¡EGRìðüìðüìðüx{†·»ÆìðüìðüëïûXZe•˜£Y\gÏÒÞìðüìðüÏÒÞ¯³¾ìðüìðüìðü*,6ilvìðüìðüìðüÃÇÒÉÍÙìðüìðü×ÛæÖÚåìðüìðüÊÎÚ/1<ìðüìðüìðüœŸ«ilvìðüìðüìðüìðüÅÈÔ‰Œ—ìðüìðüìðüY\gÆÉÕìðüìðüìðü&[^iìðüìðüìðü[^i½ÀÌìðüìðüìðü=?I^akìðüìðüìðü_blÐÔàìðüìðüÑÕá;=HìðüìðüìðüNP[ÏÒÞìðüìðüÏÒÞLNYìðüìðüìðüËÏÚÙÜèìðüìðüìðüSV`­±¼ìðüìðüìðü*-7*,6ìðüìðüìðü®²½Üàììðüìðüêîú'ÍÑÜìðüìðüìðüìðüìðü£§²GJTìðüìðüìðü©¬¸=@Jìðüìðüìðü´·Ã[^iìðüìðüìðü[^i<>Iìðüìðüìðü½ÀÌx{†ìðüìðüìðüFHSêîúìðüìðü¸¼ÇWYdìðüìðüìðüØÛç46@ÏÒÞìðüìðüÏÒÞ58BÙÝéìðüìðüìðümp{‚�ìðüìðüìðü¬°»vy„ìðüìðüìðü¢¦±¢¦±ìðüìðüìðüvy„“–¢ìðüìðüìðü”—¢`bmìðüìðüìðüìðüìðüìðüìðüƒ†‘ÐÔàìðüìðüìðü24>™œ§ìðüìðüìðücfq%'2âæòìðüâæò%'2%'2[^i%'2’•¡ìðüìðüìðühkv‘• ìðüìðüìðü,/9!+ìðüìðüìðüŸ¢® ÅÈÔìðüìðüìðüìðüuxƒÏÒÞìðüìðüÏÒÞvy„ìðüìðüìðüìðüÇÊÖ %'2ìðüìðüìðüìðü<>I#&0ìðüìðüìðüìðüìðüìðüìðüìðü#&002=ìðüìðüìðüìðü�”Ÿ'(ÄÇÓìðüìðüìðüsv�ìðüìðüìðüìðübep‚�ìðüìðüìðü›Ÿª46@ìðüìðüìðüéíù %'2[^i%'2%'2âæòìðüâæò%'2çë÷ìðüìðüèìø‰Œ—ÏÒÞ‰Œ—«®¹ìðüìðüìðü8:Eìðüìðüìðü†‰”ADNìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüCEP[^iìðüìðüìðü–™¤sv�ìðüìðüìðüìðüìðüìðüsv�}�ŒìðüìðüìðüìðüìðüÔØäìðüìðüìðüìðüº½É“–¢ìðüìðüìðüìðüBDO%æêöìðüìðüìðüVXc´¸Äìðüìðüìðü‚�jlwìðüìðüìðü[^i‰Œ—ÏÒÞ‰Œ—gjuìðüìðüìðü’•¡NP[ìðüìðüìðüNP[ÄÇÓìðüìðüÞâîQT_ìðüìðüìðüknyMOZâåñìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüàäðNP[%'2âæòìðüâæò&(3x{†ìðüìðüìðüìðüx{†œŸ«ìðüìðüìðüìðüìðüìðüìðüìðüìðüWYd´·Ãìðüìðüìðü½ÀÌ}�ŒìðüìðüìðüÛßë(}�Œìðüìðüìðüãçó#¢¥°ìðüìðüìðü24>NP[ìðüìðüìðüNP[½ÀÌìðüìðüìðü=?INP[ìðüìðüìðüNP[½ÀÌìðüìðü½ÀÌNP[ìðüìðüìðüNP[')3¢¥°ìðüìðüìðüìðüìðüìðüìðüìðü £®)+5%'2[^i%'2'QT_QT_&ƒ†‘ìðüìðüìðüìðüìðüìðüìðü‡‹–!$.ÔØäìðüìðü½À̽ÀÌìðüìðüìðü[^iÏÒÞìðüìðüìðü_blÙÜèìðüìðüÙÝéNP[ìðüìðüìðüNP[½ÀÌìðüìðü½À̉Œ—ÏÒÞ‰Œ—?BL½À̽ÀÌ?BL‰Œ—ÏÒÞ‰Œ—47A{~‰ÏÒÞìðüìðüÏÒÞ}€‹35?/1<‚…�½ÀÌËÏÚ·»Æ„‡’47A?BL½À̽ÀÌ?BL7:Dìðüìðüìðü.0;”—¢ìðüìðü•˜£13>ìðüìðüìðü¢¥°‰Œ—ÏÒÞ‰Œ—?BL½À̽ÀÌ?BLÏÒÞìðüìðüÏÒÞ7:Dor}7:Dacnacnjlwìðüìðüìðükmx½ÀÌìðüìðü½ÀÌ¢¥°ìðüìðüìðü24>?BL½À̽ÀÌ?BLÏÒÞìðüìðüÙÝ鉌—ìðüìðü‰Œ—NP[NP[ wz…®²½ÏÒÞ¯³¾wz… BDO½À̽ÀÌ?BLKNXŽ‘œ¾ÂÎÊÎÚº½É“–¢JMW Y\g˜›¦ÂÆÑÇË×¾ÂΛŸªY\g +?BL½À̽ÀÌ?BL?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BL?BL½À̽ÀÌ?BL?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BL13>‚…�º½ÉÏÒÞº½Éƒ†‘13>OQ\�’�»¾ÊÏÒÞ¼¿Ë�“žOQ\ + X[f˜›¦ÂÆÑÉÍÙ¾ÁÍœŸ«Y\g +VXcãçóìðüìðüìðüìðüìðüãçóVXcfitìðüìðüìðü½ÀÌ;=H½ÀÌìðüìðüìðüìðüìðüìðüìðüµ¹ÄADNilvØÛçìðüìðüìðüìðüìðüìðüìðüÖÚåilvÇË×ìðüìðü½À̽ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌÇË×ìðüìðü½À̽ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌ„‡’ìðüìðüìðüìðüìðüìðüìðü„‡’;=H¹½Èìðüìðüìðüìðüìðüìðüìðü¹½È<>IgjuÙÜèìðüìðüìðüìðüìðüìðüìðüÖÚåilvehsìðüìðüìðüìðüìðüìðüìðüìðüìðüehsŠ�˜ìðüìðüìðüìðüÏÒÞ[^iìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüacn—š¥ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüœŸ«‚…�ìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌ€ƒŽìðüìðüìðü½À̽ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌ� ¬ìðüìðüìðüìðüìðüìðüìðüìðüìðü� ¬]`kìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü]`k™œ§ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü›ŸªEGRìðüìðüìðüìðüìðüÔØäìðüìðüìðüìðüìðüEGR!+¯³¾ìðüìðüìðüìðüìðüÏÒÞNP[ìðüìðüìðüìðüìðüìðüÕÙåëïûìðüìðüìðüìðüìðüOR]˜›¦ìðüìðüìðüìðüìðüèìøÖÚåèìøìðüìðüìðüìðüìðü›Ÿª=?IìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BL:Iìðüìðüìðüèìø![^iìðüìðüìðü¬°»«®¹ìðüìðüìðüX[f/1<ìðüìðüìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ(*4ëïûìðüìðüìðü]`k†‰”ìðüìðüìðüehsÜàììðüìðüêîú''êîúìðüìðüÛßëëïûìðüìðüìðü;=H;=Hìðüìðüìðüêîú^akìðüìðüìðü­±¼«®¹ìðüìðüìðüX[fOR]ìðüìðüìðü±´À±´ÀìðüìðüìðüOR]NP[ìðüìðüìðüìðüÓ×ãCEPÏÒÞìðüìðüÏÒÞ\_jìðüìðüìðü’•¡•˜£ìðüìðüìðüXZeTWaìðüìðüìðüEGRDFQìðüìðüìðüœŸ«¬°»ìðüìðüìðüÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ¤¨³ìðüìðüìðü¤¨³ÑÕáìðüìðüìðü%/1<ìðüìðüìðüœŸ«� ¬ìðüìðüìðü.0;\_jìðüìðüìðü“–¢“–¢ìðüìðüìðü[^i˜›¦ìðüìðüìðüFHSDFQìðüìðüìðü›Ÿª”—¢ìðüìðüìðüVXcWYdìðüìðüìðü“–¢NP[ìðüìðüìðü¯³¾!+ÏÒÞìðüìðüÏÒÞSV`ìðüìðüìðü@CMEGRìðüìðüìðü‘• ƒ†‘ÀÄÏwz…çë÷ìðüìðü½ÀÌfitìðüìðüìðüãçóÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ]`kìðüìðüìðüëïû(*4EGRìðüìðüìðü§ª¶NP[ìðüìðüìðülozmp{ìðüìðüìðüMOZ�“žìðüìðüìðüCEPDFQìðüìðüìðü�’�­±¼ìðüìðüâæòêîúìðüìðü¼¿ËØÛçìðüìðüåéõ  +åéõìðüìðü×Ûæ‰Œ—ÏÒÞ‰Œ—ÏÒÞìðüìðüÏÒÞ€ƒŽ½ÀÌtw‚ ìðüìðüìðüµ¹ÄÓ×ãìðüìðüÊÎÚ!$.âæòìðüìðüìðügjuÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ#ÙÜèìðüìðüìðünq|�”Ÿìðüìðüìðü[^i[^iìðüìðüìðü]`k]`kìðüìðüìðü[^iº½Éìðüìðüìðü ìðüìðüìðü¹½ÈOQ\½À̽ÀÌ?BL?BL½À̽ÀÌOQ\JMWÝáíìðüsv�Ó×ãìðüìðüÊÎÚ+.8ìðüìðüìðü¢¥°¢¦±ìðüìðüìðü+.8ÏÒÞìðüìðüÏÒÞ×ÛæìðüìðüÇÊÖèìøìðüìðüÂÆÑž¡­ìðüìðüìðü¬°»ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ’•¡ìðüìðüìðü¶ºÅÝáíìðüìðüèìøMOZìðüìðüìðümp{lozìðüìðüìðüNP[ÉÍÙìðüìðüØÛçÙÜèìðüìðüÈÌØ')3ž¡­ìðüìðüìðü½À̽ÀÌìðüìðüìðüž¡­')3èìøìðüìðüÂÆÑ[^iìðüìðüìðüps~qtìðüìðüìðüZ]hÏÒÞìðüìðüÏÒÞÔØäìðüìðüÌÐÛGJTìðüìðüìðü™œ§X[fìðüìðüìðüìðü/1<ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞKNXìðüìðüìðüìðü:AK€ƒŽìðüìðüìðüìðüìðüìðüìðüìðü¹½È<>IèìøìðüìðüÞâî“–¢ìðüìðüìðü“–¢“–¢ìðüìðüìðü“–¢�’�ìðüìðüìðüDFQCEPìðüìðüìðü�“žNP[ìðüìðüìðüNP[NP[ìðüìðüìðüNP[')3ž¡­ìðüìðüìðüìðüìðüìðüuxƒuxƒìðüìðüìðüìðüìðüìðüž¡­')3…ˆ“ìðüìðüìðüÙÜè + ¸¼Çìðüìðüëïûìðüìðüìðü¸¼ÇÏÒÞìðüìðüÏÒÞ”—¢ìðüìðüìðüZ]hFIT®²½ìðüìðüìðüìðügjuKNXìðüìðüìðüìðü=?IÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðübdo]`kìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü]`kZ]hìðüìðüìðü‘• 02=ìðüìðüìðüìðü�”Ÿ''�”Ÿìðüìðüìðüìðü02=[^iìðüìðüìðü“–¢(*4âæòìðüìðüìðü\_jNP[ìðüìðüìðüNP[NP[ìðüìðüìðüNP[uxƒìðüìðüìðüìðüìðüìðü� ¬')3')3� ¬ìðüìðüìðüìðüìðüìðüuxƒFIT®²½ìðüìðüìðüìðügjuÂÆÑìðüìðüÜàìÝáíìðüìðüÁÅÐÏÒÞìðüìðüÏÒÞ8:Eìðüìðüìðüæêö‰Œ—ÑÕáåéõìðüìðüìðüìðüìðü™œ§ÇË×ìðüìðüìðüƒ†‘ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðüÓ×ãéíùìðüìðüìðüìðüìðüSV`QT_ìðüìðüìðüìðüìðüìðüÑÕáëïûìðüìðüìðüìðüìðüQT_§ª¶ìðüìðüìðüEGR‚�ìðüìðüìðüìðüìðüÑÕáìðüìðüìðüìðüìðü‚�êîúìðüìðüìðü;=H¤¨³ìðüìðüìðüëïû‰Œ—ÏÒÞ‰Œ—‰Œ—ÏÒÞ‰Œ—OQ\ÆÉÕìðüìðüìðüìðüìðüÅÈÔNP[?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BLNP[ÅÈÔìðüìðüìðüìðüìðüÆÉÕOQ\‰Œ—ÑÕáåéõìðüìðüìðüìðüìðü™œ§ËÏÚìðüìðüÓ×ãÔØäìðüìðüÊÎÚÏÒÞìðüìðüÏÒÞ!#-ÐÓßìðüìðüìðüˆ‹—NP[ìðüìðüìðüìðüìðüìðüìðü˜›¦‚…�ìðüìðüìðüÈÌØÏÒÞìðüìðüÏÒÞ‰Œ—ìðüìðüÙÜè`bm  ^ak×ÛæìðüìðüìðüØÛç"'ØÛçìðüìðüìðüÙÝé`bm  `bmÙÜèìðüìðüìðü×Ûæ'%ìðüìðüìðüÒÖâ� ¬ìðüìðüìðüìðüìðüìðüìðüìðüìðü� ¬…ˆ“ìðüìðüìðüÇË×"%/]`kìðüìðüìðüìðü†‰”')3ž¡­ìðüìðüìðüìðüìðüìðüuxƒ½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌuxƒìðüìðüìðüìðüìðüìðüž¡­')3NP[ìðüìðüìðüìðüìðüìðüìðü˜›¦ÊÎÚìðüìðüÔØäÓ×ãìðüìðüËÏÚÏÒÞìðüìðüÏÒÞ + ¸¼ÇìðüìðüìðüÛßë NP[ìðüìðüìðüìðüìðüìðüìðü—š¥=?IìðüìðüìðüìðüKNXÏÒÞìðüìðüÏÒÞ\_jtv�(!$.ÉÍÙìðüìðüìðü†Š•†‰”ìðüìðüìðüìðü]`k"%/ÇË×ìðüìðüìðü…ˆ“ehsìðüìðüìðü†‰”—š¥ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü—š¥'×ÛæìðüìðüìðüÙÜè`bm  `bmÙÝéìðüìðüìðüØÛç'uxƒìðüìðüìðüìðüìðüìðü� ¬')3½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌ')3� ¬ìðüìðüìðüìðüìðüìðüuxƒ[^iìðüìðüìðüìðüìðüÙÝédgrÁÅÐìðüìðüÝáíÜàììðüìðüÂÆÑÏÒÞìðüìðüÏÒÞ¢¦±ìðüìðüìðüìðüILV‰Œ—ÐÓßäèôìðüìðüìðüìðüìðü—š¥º½Éìðüìðüìðü�”ŸÏÒÞìðüìðüÏÒÞ;=Hìðüìðüìðüçë÷!ëïûìðüìðüìðü¤¨³;=Hìðüìðüìðüêîú±´Àìðüìðüìðü:I¹½Èìðüìðüìðüìðüìðüìðüìðüìðü€ƒŽ½ÀÌìðüìðüìðüìðüìðüuxƒuxƒìðüìðüìðüìðüìðü½ÀÌ[^iìðüìðüìðü[^i€ƒŽìðüìðüìðüADN@CMìðüìðüìðü�„�ÏÒÞìðüìðüÏÒÞ^akìðüìðüìðüìðüŽ‘œ®²½ìðüìðüìðüY\g¬°»ìðüìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞ‰Œ— ìðüìðüìðüµ¹Äº½Éìðüìðüìðü ìðüìðüìðü¹½È¼¿Ëìðüìðüìðü/1<^akìðüìðüìðü®²½®²½ìðüìðüìðü^akOQ\�“ž¼¿ËÏÒÞìðüìðüìðüÇË×?BLÅÈÔìðüìðüìðüìðüìðüÆÉÕOQ\OQ\ÆÉÕìðüìðüìðüìðüìðüÅÈÔ?BL[^iìðüìðüìðü[^iZ]hìðüìðüìðüqtps~ìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞGJTìðüìðüìðüìðü¤¨³ILVìðüìðüìðü—š¥NP[ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüNP[×ÛæìðüìðüÇÊÖÉÍÙìðüìðüØÛçÙÜèìðüìðüÈÌØ.0;ìðüìðüìðü½À̘›¦ìðüìðüìðüFITGJTìðüìðüìðü—š¥:ßãïìðüìðüìðü»¾Ê çë÷ìðüìðüÁÅÐNP[ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüNP[ÔØäìðüìðüÌÐÛÈÌØìðüìðüÙÜèØÛçìðüìðüÉÍÙ{~‰ìðüìðüìðüqt¾ÂÎìðüìðüäèôåéõìðüìðü¾ÁͶºÅìðüìðüìðü’•¡')3� ¬ìðüìðüìðüìðüìðüìðüuxƒ‰Œ—ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü‰Œ—uxƒìðüìðüìðüìðüìðüìðü� ¬')3NP[ìðüìðüìðüNP[×Ûæìðüìðüåéõ + åéõìðüìðüØÛçÏÒÞìðüìðüÏÒÞ'ÈÌØìðüìðüìðüÑÕá#&0ÔØäìðüìðüÊÎÚ‰Œ—ÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞ‰Œ—€ƒŽ½ÀÌtw‚ ìðüìðüìðüµ¹Ä¹½Èìðüìðüìðü ìðüìðüìðüº½ÉÇË×ìðüìðüìðü$&1ÏÒÞìðüìðüÐÔàÐÔàìðüìðüÏÒÞnq|ìðüìðüìðüÙÜè#NP[ÅÈÔìðüìðüìðüìðüìðüÆÉÕOQ\ÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞOQ\ÆÉÕìðüìðüìðüìðüìðüÅÈÔNP[‰Œ—ÏÒÞ‰Œ—“–¢ìðüìðüìðüWYdVXcìðüìðüìðü”—¢ÏÒÞìðüìðüÏÒÞ²µÁìðüìðüìðüéíù:NP[ìðüìðüìðüNP[VXcãçóìðüìðüìðüìðüìðüãçóVXc½ÀÌìðüìðü½À̽ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌkmx×ÛæìðüìðüìðüìðüìðüìðüìðüÖÚåkmx½ÀÌìðüìðü½ÀÌ<>I¹½Èìðüìðüìðüìðüìðüìðüìðü¶ºÅ=?I<>I¹½Èìðüìðüìðüìðüìðüìðüìðü¹½È;=HNP[ìðüìðüìðüOR]ehsÚÞêìðüìðüìðüìðüìðüìðüìðüÚÞêdgr½ÀÌìðüìðüÇË×NP[ìðüìðüìðüNP[ÙÜèìðüìðüÙÝéNP[ìðüìðüìðüNP[ wz…¯³¾ÏÒÞ®²½wz… ?BL½À̽ÀÌ?BL?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BL + X[f™�¨ÀÄÏÇË׿ÃÏ™œ§XZe + ?BL½À̽ÀÌ?BLGJT�”Ÿ¾ÂÎÈÌØ»¾Ê’•¡GJTOQ\�“ž¼¿ËÏÒÞ»¾Ê�’�OQ\‰Œ—ÏÒÞ‰Œ—^ak˜›¦¾ÂÎÏÒÞ¾ÁÍ—š¥^ak?BL½À̽ÀÌ?BL‰Œ—ÏÒÞ‰Œ—13>ìðüìðüìðü¢¥°‰Œ—ÏÒÞ‰Œ—jlwìðüìðüìðükmx¢¥°ìðüìðüìðü24>ÏÒÞìðüìðüÙÝ鉌—ìðüìðü‰Œ—NP[NP[?BL½À̽ÀÌ?BL?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÆÉÕ£§²acn +SV`›Ÿª·»ÆÏÒÞ¸¼Ç›ŸªSV` ?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÆÉÕ®²½‹Ž™ILV?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BL?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BL SV`›Ÿª¸¼ÇÏÒÞ·»Æ›ŸªSV` +?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL‰Œ—ÏÒÞ‰Œ—?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL‰Œ—ÏÒÞ‰Œ—?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BLHKUŠ�˜­±¼ÆÉÕÆÉÕ®²½‹Ž™ILV½ÀÌìðüìðü½À̽ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÇË×>AKehsÛßëìðüìðüìðüìðüìðüìðüìðüÜàìehs½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÙÜènq|½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½À̽ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌehsÜàììðüìðüìðüìðüìðüìðüìðüÛßëehs½ÀÌìðüìðü½À̽ÀÌìðüìðü½ÀÌNP[ìðüìðüìðüNP[½ÀÌìðüìðü½À̽ÀÌìðüìðü½À̇‹–ìðüìðüìðüNP[½ÀÌìðüìðü½À̽ÀÌìðüìðüÄÇÓÄÇÓìðüìðü½À̽ÀÌìðüìðüÅÈÔ½ÀÌìðüìðü½ÀÌnq|ÙÜèìðüìðüìðüìðüìðüìðüìðüìðüÙÜènq|"%/ìðüìðüìðüìðü!$.ÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüILV¨«·ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü¨«·ÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÅÈÔ8:EÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½Ą̀«·ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü¨«·ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞy|‡ìðüìðüìðüìðüNP[ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüìðümp{mp{ìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüuxƒÏÒÞìðüìðüÏÒÞ8:EÅÈÔìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÅÈÔ8:E!^akž¡­¸¼ÇÏÒÞ¹½È £®]`k%dgrìðüìðüìðüìðücfqÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÜàììðüìðüìðüìðüÞâî ",(¾ÁÍìðüìðüìðüìðüìðüìðüÑÕáëïûìðüìðüìðüìðüìðü¾ÁÍ'ÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÜàììðüìðüìðüìðüìðüìðüìðü]`kÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BLÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BL'¾ÁÍìðüìðüìðüìðüìðüëïûÑÕáìðüìðüìðüìðüìðüìðü¾ÁÍ(ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞkmxìðüìðüìðüìðü•˜£ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüìðüàäð#$àäðìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüìðü')3ÏÒÞìðüìðüÏÒÞ]`kìðüìðüìðüìðüìðüìðüìðüÝáíÜàììðüìðüìðüìðüìðüìðüìðü]`k ~�Œìðüìðüìðüìðüìðüìðüìðüìðüêîú}�Œ¦©µìðüìðüìðüìðü¦©µÏÒÞìðüìðüÏÒÞOR]ÖÚåìðüìðüìðü—𥬰»ìðüìðüìðüìðü®²½KNX JMW®²½ìðüìðüìðüìðü¬°»ÏÒÞìðüìðüÏÒÞSV`ª­¹ìðüìðüìðüìðüìðüSV`ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ¬°»ìðüìðüìðüìðü®²½JMW KNX®²½ìðüìðüìðüìðü¬°»ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ\_jìðüìðüìðüìðü£§²ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüŠ�˜Š�˜ìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüìðü� ¬ÏÒÞìðüìðüÏÒÞSV`ìðüìðüìðüìðüìðüª­¹SV`SV`ª­¹ìðüìðüìðüìðüìðüSV`9;FÌÐÛìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÉÍÙ9;F éíùìðüìðüìðüìðüéíù ÏÒÞìðüìðüÏÒÞ69Cìðüìðüìðüìðü%'2†Š•ìðüìðüìðüìðüru€ru€ìðüìðüìðüìðü†Š•ÏÒÞìðüìðüÏÒÞOR]Ûßëìðüìðüìðüìðü47AÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ†Š•ìðüìðüìðüìðüru€ru€ìðüìðüìðüìðü†Š•ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞOQ\ìðüìðüìðüìðü²µÁ ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðü47A47AìðüìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðüNP[ÏÒÞìðüìðüÏÒÞ47AìðüìðüìðüìðüÛßëOR]OR]Ûßëìðüìðüìðüìðü47AKNXìðüìðüìðüìðüìðüìðüëïûÑÕáéíùìðüìðüìðüìðüìðüìðüILVOQ\ìðüìðüìðüìðüìðüìðüNP[ÏÒÞìðüìðüÏÒÞ‚…�ìðüìðüìðünq|7:Dìðüìðüìðüìðüjlwkmxìðüìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞ$&1ÊÎÚìðüìðüìðü¶ºÅÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ7:Dìðüìðüìðüìðükmxjlwìðüìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ@CMëïûìðüìðüìðüÀÄÏ"ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðü¦©µ§ª¶ìðüìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðüÅÈÔÏÒÞìðüìðüÏÒÞ·»ÆìðüìðüìðüÊÎÚ$&1$&1ÊÎÚìðüìðüìðü¶ºÅ7:Dãçóìðüìðüìðüìðü—š¥@CM@CM™œ§ìðüìðüìðüìðüäèô:ÜàììðüìðüìðüÎÑÝ$&1ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüàäðìðüìðüìðüQT_QT_ìðüìðüìðüàäðìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞìðüìðüìðüuxƒÏÒÞìðüìðüÏÒÞps~ìðüìðüìðüÞâî,/9,/9Þâîìðüìðüìðüps~ÂÆÑìðüìðüìðüÝáíKNXMOZÛßëìðüìðüìðü¿ÃÏÒÖâìðüìðüéíùéíùìðüìðüÒÖâÏÒÞìðüìðüÏÒÞàäðìðüìðüÁÅÐ24>ìðüìðüìðüÜàì":ÏÒÞìðüìðüÏÒÞ\_jìðüìðüìðüÕÙåÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ24>ìðüìðüìðüÜàì#:ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ#&0ÎÑÝìðüìðüìðüÜàì24>ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞìðüìðüìðüÄÇÓÄÇÓìðüìðüìðüÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞìðüìðüìðüìðü')3ÏÒÞìðüìðüÏÒÞ ÖÚåìðüìðüìðü\_j\_jìðüìðüìðüÕÙå}€‹ìðüìðüìðüãçó58B8:Eâæòìðüìðüìðü‚�8:Eìðüìðüìðü¦©µ¦©µìðüìðüìðü7:DÏÒÞìðüìðüÏÒÞÐÔàìðüìðüÏÒÞ��›ìðüìðüìðüuxƒÏÒÞìðüìðüÏÒÞª­¹ìðüìðüìðükmxÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ��›ìðüìðüìðüuxƒÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ"ÀÄÏìðüìðüìðüëïû@CMÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÄÇÓìðüìðüìðümp{mp{ìðüìðüìðüÄÇÓÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞž¡­ìðüìðüìðü� ¬ÏÒÞìðüìðüÏÒÞkmxìðüìðüìðü©¬¸ª­¹ìðüìðüìðükmx%ëïûìðüìðüìðüQT_SV`ìðüìðüìðüéíù%{~‰ìðüìðüìðücfqdgrìðüìðüìðüz}ˆÏÒÞìðüìðüÏÒÞßãïìðüìðüÂÆÑÐÔàìðüìðüìðü&ÏÒÞìðüìðüÏÒÞDFQìðüìðüìðü´·ÃÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÐÓßìðüìðüìðü'ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ ²µÁìðüìðüìðüìðüOQ\ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞQT_ìðüìðüìðüàäð#$àäðìðüìðüìðüQT_ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ')3ìðüìðüìðüìðüNP[ÏÒÞìðüìðüÏÒÞ´·ÃìðüìðüìðüDFQDFQìðüìðüìðü´·Ãx{†ìðüìðüìðü–™¤•˜£ìðüìðüìðü{~‰½ÀÌìðüìðüìðü!$."%/ìðüìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞ/1<ìðüìðüìðü £®35?ìðüìðüìðüª­¹ÏÒÞìðüìðüÏÒÞÆÉÕìðüìðüìðü ",ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ35?ìðüìðüìðüª­¹ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ£§²ìðüìðüìðüìðü]`kÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ§ª¶ìðüìðüìðüŠ�˜Š�˜ìðüìðüìðü¦©µÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞuxƒìðüìðüìðüÅÈÔÏÒÞìðüìðüÏÒÞ!#-ìðüìðüìðüÆÉÕÆÉÕìðüìðüìðü ",ÉÍÙìðüìðüìðü46@ + sv�·»ÆÏÒÞ·»Æsv�?BL½À̽ÀÌ?BL35?ìðüìðüìðüÈÌØ"%/ìðüìðüìðü½À̽ÀÌìðüìðüìðü!$.ÏÒÞìðüìðüÏÒÞ‚…�ìðüìðüìðünq|cfqìðüìðüìðüilvÏÒÞìðüìðüÏÒÞ}�ŒìðüìðüìðüUXbÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞcfqìðüìðüìðüjlwÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ•˜£ìðüìðüìðüìðükmxÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ47Aìðüìðüìðüìðü47A47Aìðüìðüìðüìðü47AÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÆÉÕìðüìðüìðüuxƒÏÒÞìðüìðüÏÒÞVXcìðüìðüìðü}€‹}�ŒìðüìðüìðüUXb13>ìðüìðüìðü¯³¾=?IÏÒÞìðüìðüìðüìðüìðüÏÒÞìðüìðü½À̰³¿ìðüìðüìðü46@dgrìðüìðüìðüz}ˆ{~‰ìðüìðüìðücfqÏÒÞìðüìðüÏÒÞ69Cìðüìðüìðüìðü%'2Š�˜ìðüìðüìðü:IìðüìðüìðüìðüHKUHKUìðüìðüìðüìðüÏÒÞ ìðüìðüìðü´·ÃOQ\ìðüìðüìðü�“ž�”ŸìðüìðüìðüNP[ÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü„‡’ÉÍÙìðüìðüÖÚåÏÒÞìðüìðüÏÒÞØÛçìðüìðüÈÌØÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌÈÌØìðüìðü×ÛæNP[ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðüìðü£§²ìðüìðüìðüÉÍÙ ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÄÇÓìðüìðüìðümp{mp{ìðüìðüìðüÄÇÓÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞuxƒìðüìðüìðüÅÈÔÏÒÞìðüìðüÏÒÞÉÍÙìðüìðü×ÛæØÛçìðüìðüÈÌØÀÄÏìðüìðüßãï�„�ìðüìðüìðüor}ps~ìðüìðüìðüÏÒÞÞâîìðüìðüÂÆÑ�”ŸìðüìðüìðüNP[OQ\ìðüìðüìðü�“žÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü� ¬ÈÌØìðüìðü×ÛæÏÒÞìðüìðüÏÒÞ×ÛæìðüìðüÉÍÙÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌÉÍÙìðüìðüÖÚåNP[ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÈÌØÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðü²µÁ ÊÎÚìðüìðüìðü‰Œ—ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞQT_ìðüìðüìðüàäð#$àäðìðüìðüìðüQT_ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÆÉÕìðüìðüìðüuxƒÏÒÞìðüìðüÏÒÞÈÌØìðüìðüØÛç×ÛæìðüìðüÉÍÙÌÐÛìðüìðüÓ×ã±´Àìðüìðüìðü((ìðüìðüìðüÏÒÞÐÓßìðüìðüÏÒÞÒÖâìðüìðüéíù  éíùìðüìðüÒÖâÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÐÔàìðüìðüìðüìðüìðü‚�¼¿ËìðüìðüãçóÏÒÞìðüìðüÏÒÞåéõìðüìðü»¾ÊÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BLÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BL½ÀÌìðüìðüâæò‰Œ—ÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞãçóìðüìðü¼¿ËÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüÀÄÏ"ILVìðüìðüìðüìðüHKUÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ§ª¶ìðüìðüìðüŠ�˜Š�˜ìðüìðüìðü¦©µÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞOQ\ìðüìðüìðüìðü')3ÏÒÞìðüìðüÏÒÞº½Éìðüìðüæêöåéõìðüìðü»¾ÊÂÆÑìðüìðüÞâîÉÍÙìðüìðü×ÛæØÛçìðüìðüÏÒÞ‰Œ—ìðüìðü‰Œ—8:Eìðüìðüìðü¦©µ[^i[^i[^i[^i[^i[^i¦©µìðüìðüìðü7:DÏÒÞìðüìðüÏÒÞ'�”Ÿìðüìðüìðüìðü02=¯³¾ìðüìðüìðü ÏÒÞìðüìðüÏÒÞ(ìðüìðüìðü«¯ºÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ¯³¾ìðüìðüìðü ìðüìðüìðü¯³¾ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüìðüÎÑÝ$&1‰Œ—ìðüìðüìðüÉÍÙ ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ47Aìðüìðüìðüìðüìðüìðüìðüìðü47AÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞž¡­ìðüìðüìðü� ¬ÏÒÞìðüìðüÏÒÞ«¯ºìðüìðüìðü((ìðüìðüìðü«¯º±´Àìðüìðüìðü +ÈÌØìðüìðüØÛç×ÛæìðüìðüÏÒÞNP[NP[‰Œ—ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü‰Œ—ÏÒÞìðüìðüÏÒÞ“–¢ìðüìðüìðü“–¢‰Œ—ìðüìðüìðü;=HÏÒÞìðüìðüÏÒÞFITìðüìðüìðü‚…�ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞŠ�˜ìðüìðüìðü: ÊÎÚìðüìðüìðü‰Œ—ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞŠ�˜ìðüìðüìðüìðüìðüìðüŠ�˜ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ')3ìðüìðüìðüìðüNP[ÏÒÞìðüìðüÏÒÞ�„�ìðüìðüìðüGJTFITìðüìðüìðü‚…�”—¢ìðüìðüìðü7:D°³¿ìðüìðüìðü((ìðüìðüìðüÏÒÞ?BL½À̽ÀÌ?BLÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ'êîúìðüìðüÛßëcfqìðüìðüìðüjlwÏÒÞìðüìðüÏÒÞ}€‹ìðüìðüìðüVXcÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞcfqìðüìðüìðüilvjlwìðüìðüìðücfqÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^i?BL½À̽ÀÌ?BLÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞILVìðüìðüìðüìðüHKUÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ$àäðìðüìðüìðüìðüàäð#ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞuxƒìðüìðüìðüÅÈÔÏÒÞìðüìðüÏÒÞUXbìðüìðüìðü}�Œ}€‹ìðüìðüìðüVXcdgrìðüìðüìðügju�„�ìðüìðüìðüps~or}ìðüìðüìðüÏÒÞ½ÀÌìðüìðü½ÀÌ"%/ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü!$.ÏÒÞìðüìðüÏÒÞ� ¬ìðüìðüìðü.0;35?ìðüìðüìðüª­¹ÏÒÞìðüìðüÏÒÞÆÉÕìðüìðüìðü!#-ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ35?ìðüìðüìðüª­¹ª­¹ìðüìðüìðü35?ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^i½ÀÌìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ‰Œ—ìðüìðüìðüÉÍÙ ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞmp{ìðüìðüìðüìðümp{ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÆÉÕìðüìðüìðüuxƒÏÒÞìðüìðüÏÒÞ ",ìðüìðüìðüÆÉÕÆÉÕìðüìðüìðü!#-58Bìðüìðüìðü±´À<>IìðüìðüìðüìðüHKUHKUìðüìðüìðüìðüãçó&&äèôìðüìðüÇÊÖdgrìðüìðüìðüz}ˆ[^i[^i[^i[^i[^i[^i[^i[^i{~‰ìðüìðüìðücfqÏÒÞìðüìðüÏÒÞmp{ìðüìðüìðüMOZÐÓßìðüìðüìðü'ÏÒÞìðüìðüÏÒÞDFQìðüìðüìðü´·ÃÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÐÔàìðüìðüìðü&'ìðüìðüìðüÐÓßÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÉÍÙìðüìðüÖÚåÕÙåìðüìðüÊÎÚÏÒÞìðüìðüÏÒÞ ÊÎÚìðüìðüìðü‰Œ—ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÄÇÓìðüìðüÄÇÓÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞOQ\ìðüìðüìðüìðü')3ÏÒÞìðüìðüÏÒÞ´·ÃìðüìðüìðüDFQDFQìðüìðüìðü´·ÃÈÌØìðüìðüìðü02=§ª¶ìðüìðüìðüìðüÑÕáìðüìðüìðüìðüìðüìðüäèôãçóìðüìðüìðü—𥦩µìðüìðüìðü7:D8:Eìðüìðüìðü¦©µÏÒÞìðüìðüÏÒÞ]`kìðüìðüìðü[^i��›ìðüìðüìðüuxƒÏÒÞìðüìðüÏÒÞ©¬¸ìðüìðüìðükmxÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ��›ìðüìðüìðüuxƒuxƒìðüìðüìðü��›ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^i¾ÁÍìðüìðüéíùèìøìðüìðü¾ÁÍÏÒÞìðüìðüÏÒÞILVìðüìðüìðüìðüHKUÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ?BL½À̽ÀÌ?BLÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞž¡­ìðüìðüìðü� ¬ÏÒÞìðüìðüÏÒÞkmxìðüìðüìðüª­¹©¬¸ìðüìðüìðükmx{~‰ìðüìðüìðü™�¨*-7Ûßëìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü8:E éíùìðüìðüÒÖâÒÖâìðüìðüéíù ÏÒÞìðüìðüÏÒÞlozìðüìðüìðüNP[24>ìðüìðüìðüÜàì#:ÏÒÞìðüìðüÏÒÞ\_jìðüìðüìðüÖÚå ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ24>ìðüìðüìðüÜàì"#Üàììðüìðüìðü24>ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^išž©ìðüìðüìðü.0;-0:ìðüìðüìðü›ŸªÏÒÞìðüìðüÏÒÞ‰Œ—ìðüìðüìðüÉÍÙ ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ')3ìðüìðüìðüìðüÏÒÞìðüìðüÏÒÞÕÙåìðüìðüìðü\_j\_jìðüìðüìðüÖÚå 'èìøìðüìðüìðüUXb=?IÏÒÞìðüìðüìðüìðüìðüÏÒÞgjuìðüìðüìðüìðüìðüìðügjuOQ\ìðüìðüìðü�“ž�”ŸìðüìðüìðüNP[ÏÒÞìðüìðüÏÒÞœŸ«ìðüìðüìðü/1<«¯ºìðüìðüìðü��›‰Œ—ìðüìðülozÏÒÞìðüìðüÏÒÞ,/9Þâîìðüìðüìðüps~ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ«¯ºìðüìðüìðü��›��›ìðüìðüìðü«¯ºÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^imp{ìðüìðüìðümp{lozìðüìðüìðünq|ÏÒÞìðüìðüÏÒÞ ÊÎÚìðüìðüìðü‰Œ—ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞuxƒìðüìðüìðüÏÒÞìðüìðüÏÒÞps~ìðüìðüìðüÞâî,/9,/9Þâîìðüìðüìðüps~}�ŒìðüìðüìðüÝáí8:E + sv�·»ÆÏÒÞ·»Æsv� + 8:E—š¥ÇÊÖÇË×—š¥8:E�”ŸìðüìðüìðüNP[OQ\ìðüìðüìðü�“žÏÒÞìðüìðüÏÒÞ'êîúìðüìðüÜàì7:Dìðüìðüìðüìðükmxjlwìðüìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞ$&1ÊÎÚìðüìðüìðü·»ÆÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ7:Dìðüìðüìðüìðüjlwkmxìðüìðüìðüìðü7:DÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^i02=ìðüìðüìðüÄÇÓÃÇÒìðüìðüìðü02=ÏÒÞìðüìðüÏÒÞILVìðüìðüìðüìðüHKUÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÆÉÕìðüìðüìðüìðüìðüÏÒÞ¶ºÅìðüìðüìðüÊÎÚ$&1$&1ÊÎÚìðüìðüìðü·»Æ¾ÂÎìðüìðüìðüÙÝéMOZFIT £®‚�ÒÖâìðüìðüéíù  éíùìðüìðüÒÖâÏÒÞìðüìðüÏÒÞ“–¢ìðüìðüìðü“–¢†Š•ìðüìðüìðüìðüru€ru€ìðüìðüìðüìðü†Š•ÏÒÞìðüìðüÏÒÞOR]Ûßëìðüìðüìðüìðü47AÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ†Š•ìðüìðüìðüìðüru€ru€ìðüìðüìðüìðü†Š•ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^i¶ºÅìðüìðüìðüsv�ru€ìðüìðüìðü·»ÆÏÒÞìðüìðüÏÒÞ‰Œ—ìðüìðüìðüÉÍÙ ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞOQ\ìðüìðüìðüìðüìðüÏÒÞ47AìðüìðüìðüìðüÛßëOR]OR]Ûßëìðüìðüìðüìðü47A9;Féíùìðüìðüìðüìðü™�¨=?I?BL–™¤ìðüìðüìðüwz…8:Eìðüìðüìðü¦©µ¦©µìðüìðüìðü7:DÏÒÞìðüìðüÏÒÞ'�”Ÿìðüìðüìðüìðü02=¬°»ìðüìðüìðüìðü®²½JMW KNX®²½ìðüìðüìðüìðü¬°»ÏÒÞìðüìðüÏÒÞSV`ª­¹ìðüìðüìðüìðüìðüSV`ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ¬°»ìðüìðüìðüìðü®²½KNX JMW®²½ìðüìðüìðüìðü¬°»ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iTWaìðüìðüìðüìðüknyknyìðüìðüìðüìðüUXbÏÒÞìðüìðüÏÒÞ ÊÎÚìðüìðüìðü‰Œ—ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞž¡­ìðüìðüìðüìðüÏÒÞSV`ìðüìðüìðüìðüìðüª­¹SV`SV`ª­¹ìðüìðüìðüìðüìðüSV`GJTìðüìðüìðüìðüìðüìðüäèôØÛçëïûìðüìðüìðüìðüìðü�’�{~‰ìðüìðüìðücfqdgrìðüìðüìðüz}ˆÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÑÕáìðüìðüìðüìðüìðü‚�'¾ÁÍìðüìðüìðüìðüìðüëïûÑÕáìðüìðüìðüìðüìðüìðü¾ÁÍ(ÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÝáíìðüìðüìðüìðüìðüìðüìðü]`kÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BLÏÒÞìðüìðüÏÒÞ(¾ÁÍìðüìðüìðüìðüìðüìðüÑÕáëïûìðüìðüìðüìðüìðü¾ÁÍ'ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^i¢¦±ìðüìðüìðüìðüßãïàäðìðüìðüìðüìðü£§²ÏÒÞìðüìðüÏÒÞILVìðüìðüìðüìðüHKUÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BLÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ')3ìðüìðüìðüìðüÏÒÞ]`kìðüìðüìðüìðüìðüìðüìðüÜàìÝáíìðüìðüìðüìðüìðüìðüìðü]`k>AKÆÉÕìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÍÑÜ02=½ÀÌìðüìðüìðü!$."%/ìðüìðüìðü½ÀÌÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü� ¬¨«·ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü¨«·ÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÅÈÔ8:EÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞ¨«·ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü¨«·ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^i ÁÅÐìðüìðüìðüìðüìðüìðüìðüìðüÁÅÐ!ÏÒÞìðüìðüÏÒÞ‰Œ—ìðüìðüìðü½ÀÌÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞuxƒìðüìðüìðüÏÒÞ8:EÅÈÔìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÅÈÔ8:E �„�åéõìðüìðüìðüìðüìðüìðüìðüìðü}€‹½ÀÌìðüìðü½À̽ÀÌìðüìðü½À̽ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü„‡’ehsÜàììðüìðüìðüìðüìðüìðüìðüÛßëehs½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÙÜènq|½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½À̽ÀÌìðüìðü½ÀÌehsÛßëìðüìðüìðüìðüìðüìðüìðüÜàìehs½ÀÌìðüìðü½À̽ÀÌìðüìðü½ÀÌNP[ìðüìðüìðüNP[#§ª¶ìðüìðüìðüìðüìðüìðü§ª¶#½ÀÌìðüìðü½ÀÌ ÊÎÚìðüìðü½À̽ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½À̽ÀÌìðüìðü½À̽ÀÌìðüìðü½À̽ÀÌìðüìðü½ÀÌÆÉÕìðüìðü½ÀÌnq|ÙÜèìðüìðüìðüìðüìðüìðüìðüìðüÙÜènq|"_bl™œ§¼¿ËÈÌØ»¾Êšž©`bm?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞº½É‚…�13> SV`›Ÿª¸¼ÇÏÒÞ·»Æ›ŸªSV` +?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÆÉÕ­±¼Š�˜HKU?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BL?BL½À̽ÀÌ?BL +SV`›Ÿª·»ÆÏÒÞ¸¼Ç›ŸªSV` ?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL‰Œ—ÏÒÞ‰Œ—QT_Ÿ¢®ÅÈÔÄÇÓŸ¢®QT_?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BLILV‹Ž™®²½ÆÉÕÆÉÕ­±¼Š�˜HKU%'2[^i[^i[^i[^i[^i[^i[^i%'2NP[[^i[^i[^i[^i[^i[^iNP[%'2âæòìðüìðüìðüìðüìðüìðüìðüâæò%'2‰Œ—ìðüìðüìðüìðüìðüìðüìðüìðü‰Œ—?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÇËײµÁ}€‹35?HKUŠ�˜­±¼ÆÉÕÆÉÕ®²½‹Ž™ILV?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÇËײµÁ}€‹35?47A{~‰­±¼ÊÎÚÇË׬°»}€‹35?‰Œ—ÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ‰Œ—?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL‰Œ—ÏÒÞ‰Œ—‰Œ—ÏÒÞ‰Œ—‰Œ—ÏÒÞ‰Œ—‰Œ—ÏÒÞ‰Œ—‰Œ—ÏÒÞ‰Œ—?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL‰Œ—ÏÒÞ‰Œ—‰Œ—ÏÒÞ‰Œ—?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BL[^iìðüìðüìðüìðüìðüìðüìðüìðüìðü[^i?BL½À̽ÀÌ?BLÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞ½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü¢¥°)+5nq|ÙÜèìðüìðüìðüìðüìðüìðüìðüìðüÙÜènq|½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü¢¥°)+5')3¢¥°ìðüìðüìðüìðüìðüìðüìðüìðü £®)+5NP[ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüNP[½ÀÌìðüìðü½À̽ÀÌìðüìðü½ÀÌNP[ìðüìðüìðüOQ\OR]ìðüìðüìðüNP[NP[ìðüìðüìðüNP[NP[ìðüìðüìðüNP[NP[ìðüìðüìðüNP[½ÀÌìðüìðüÅÈÔÅÈÔìðüìðü½ÀÌNP[ìðüìðüìðümp{mp{ìðüìðüìðüNP[½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌ[^iìðüìðüìðüìðüìðüìðüìðüìðüâæò%'2½ÀÌìðüìðü½À̉Œ—ìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞNP[NP[ÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüâåñLNY8:EÅÈÔìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÅÈÔ8:EÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüâåñLNYMOZâåñìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüàäðNP[NP[ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüNP[ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞNP[ìðüìðüìðü›ŸªœŸ«ìðüìðüìðüNP[NP[ìðüìðüìðü†‰”†Š•ìðüìðüìðü†‰”†Š•ìðüìðüìðüNP[½ÀÌìðüìðüìðüuxƒuxƒìðüìðüìðü½ÀÌNP[ìðüìðüìðüìðü47A47AìðüìðüìðüìðüNP[½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌ[^iìðüìðüìðü[^i[^i[^i[^i[^i%'2½ÀÌìðüìðüìðü<>INP[[^i[^i[^i[^iÏÒÞìðüìðüÏÒÞ‰Œ—ìðüìðü‰Œ—ÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÙÜèìðüìðüìðüìðüìðüìðü>AK]`kìðüìðüìðüìðüìðüìðüìðüÝáíÜàììðüìðüìðüìðüìðüìðüìðü]`kÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÙÜèìðüìðüìðüìðüìðüìðü>AKADNìðüìðüìðüìðüìðüìðüÖÚåÖÚåìðüìðüìðüìðüìðüìðüCEP‰Œ—ÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ‰Œ—ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÞâîìðüìðüèìøèìøìðüìðüÝáí"ìðüìðüìðü¾Á;ÁÍìðüìðüìðü¾Á;ÁÍìðüìðüìðü!OQ\ìðüìðüìðüìðü')3')3ìðüìðüìðüìðüOQ\¥©´ìðüìðüìðü¸¼Ç¸¼Çìðüìðüìðü¥©´?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞìðüìðüìðüìðüOQ\[^iìðüìðüìðü[^ihkvìðüìðüìðü’•¡ÏÒÞìðüìðüÏÒÞ47Aìðüìðüìðüìðü47AÏÒÞìðüìðüÏÒÞ!+sv�êîúìðüìðüìðüÇË×SV`ìðüìðüìðüìðüìðüª­¹SV`SV`ª­¹ìðüìðüìðüìðüìðüSV`ÏÒÞìðüìðüÏÒÞ!+sv�êîúìðüìðüìðüÇË× ÅÈÔìðüìðüìðüìðüuxƒ!$.!$.vy„ìðüìðüìðüìðüÇÊÖ ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ‘• ìðüìðüìðüZ]h[^iìðüìðüìðü�”Ÿ¾ÁÍìðüìðüìðü!"ìðüìðüìðüìðüìðü!"ìðüìðüìðü¾ÁÍž¡­ìðüìðüìðü� ¬� ¬ìðüìðüìðüž¡­!$.ßãïìðüìðüìðü€ƒŽ€ƒŽìðüìðüìðüÞâî!$.� ¬ìðüìðüìðüž¡­[^iìðüìðüìðü[^ièìøìðüìðüçë÷ÏÒÞìðüìðüÏÒÞ§ª¶ìðüìðüìðüìðü¦©µÏÒÞìðüìðüÏÒÞ7:DÙÝéìðüìðüìðüps~47AìðüìðüìðüìðüÛßëOR]OR]Ûßëìðüìðüìðüìðü47AÏÒÞìðüìðüÏÒÞ7:DÙÝéìðüìðüìðüps~nq|ìðüìðüìðüØÛç46@58BÙÝéìðüìðüìðüWYdÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞEGRìðüìðüìðü§ª¶§ª¶ìðüìðüìðüEGR†Š•ìðüìðüìðüNP[NP[ìðüìðüìðüìðüìðüNP[NP[ìðüìðüìðü†‰”')3ìðüìðüìðüìðüNP[NP[ìðüìðüìðüìðü')3Z]hìðüìðüìðüìðüFITGJTìðüìðüìðüìðüZ]hNP[ìðüìðüìðüìðü')3[^iìðüìðüìðü[^i’•¡ìðüìðüìðügjuÏÒÞìðüìðüÏÒÞQT_ìðüìðüìðüìðüìðüìðüQT_ÏÒÞìðüìðüÏÒÞKNXìðüìðüìðüÉÍÙ·»ÆìðüìðüìðüÊÎÚ$&1$&1ÊÎÚìðüìðüìðü¶ºÅÏÒÞìðüìðüÏÒÞKNXìðüìðüìðüÉÍÙÈÌØìðüìðüìðüNP[LNYìðüìðüìðü;=HÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÒÖâìðüìðüìðü%%ìðüìðüìðüÑÕáNP[ìðüìðüìðü†‰”†Š•ìðüìðüìðüìðüìðü†‰”†Š•ìðüìðüìðüNP[uxƒìðüìðüìðüÅÈÔÅÈÔìðüìðüìðüuxƒ“–¢ìðüìðüìðüÌÐÛÌÐÛìðüìðüìðü’•¡ÅÈÔìðüìðüìðüuxƒ[^iìðüìðüìðü[^i=?Iìðüìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞÄÇÓìðüìðüìðüìðüìðüìðüÄÇÓÏÒÞìðüìðüÏÒÞ²µÁìðüìðüìðü')3ps~ìðüìðüìðüÞâî,/9,/9Þâîìðüìðüìðüps~ÏÒÞìðüìðüÏÒÞ²µÁìðüìðüìðü')3+.8ìðüìðüìðü±´ÀY\g•˜£XZeÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ†‰”ìðüìðüìðüehsehsìðüìðüìðü†‰”"ìðüìðüìðü¾Á;ÁÍìðüìðüìðüìðüìðü¾Á;ÁÍìðüìðüìðü!ÆÉÕìðüìðüìðüuxƒuxƒìðüìðüìðüÆÉÕÌÐÛìðüìðüìðü’•¡“–¢ìðüìðüìðüÌÐÛuxƒìðüìðüìðüÆÉÕ[^iìðüìðüìðü[^i½ÀÌìðüìðüìðü<>IÏÒÞìðüìðüÏÒÞmp{ìðüìðüìðüÄÇÓÄÇÓìðüìðüìðümp{ÏÒÞìðüìðüÏÒÞtw‚ìðüìðüìðüJMW ÖÚåìðüìðüìðü\_j\_jìðüìðüìðüÕÙåÏÒÞìðüìðüÏÒÞtw‚ìðüìðüìðüJMWJMWìðüìðüìðütw‚ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ:IÏÒÞìðüìðüÏÒÞQT_ìðüìðüìðüàäð#$àäðìðüìðüìðüQT_ÏÒÞìðüìðüÏÒÞ7:DÙÝéìðüìðüìðüps~‚…�ìðüìðüìðüFITGJTìðüìðüìðü�„�ÏÒÞìðüìðüÏÒÞ7:DÙÝéìðüìðüìðüps~tv�ìðüìðüìðüØÛç8:EÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞqtìðüìðüìðü{~‰|Šìðüìðüìðüps~†Š•ìðüìðüìðüNP[NP[ìðüìðüìðü†‰”†Š•ìðüìðüìðüNP[NP[ìðüìðüìðü†‰”OQ\ìðüìðüìðüìðüìðüìðüìðüìðüOQ\¥©´ìðüìðüìðü¸¼Ç¸¼Çìðüìðüìðü¥©´')3ìðüìðüìðüìðüOQ\[^iìðüìðüìðü[^ihkvìðüìðüìðü’•¡ÏÒÞìðüìðüÏÒÞ½ÀÌìðüìðüìðümp{mp{ìðüìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞ ",tv�êîúìðüìðüìðüÈÌØ«¯ºìðüìðüìðü((ìðüìðüìðü«¯ºÏÒÞìðüìðüÏÒÞ ",tv�êîúìðüìðüìðüÈÌØËÏÚìðüìðüìðüìðütw‚!#-ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ$&1ìðüìðüìðüÇË×ÇË×ìðüìðüìðü#&0NP[ìðüìðüìðü†‰”†Š•ìðüìðüìðüNP[NP[ìðüìðüìðü†‰”†Š•ìðüìðüìðüNP[ž¡­ìðüìðüìðüìðüìðüìðüž¡­!$.ßãïìðüìðüìðüìðüìðüìðüÞâî!$.� ¬ìðüìðüìðüž¡­[^iìðüìðüìðü[^ièìøìðüìðüçë÷ÏÒÞìðüìðüÏÒÞ½ÀÌìðüìðüÄÇÓÄÇÓìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÙÝéìðüìðüìðüìðüìðüìðü?BL»¾Êìðüìðüåéõæêöìðüìðüº½ÉÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÙÝéìðüìðüìðüìðüìðüìðü?BL=@JìðüìðüìðüìðüìðüìðüÛßëÇËײµÁ}€‹35?ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ²µÁìðüìðüìðü:IÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÇÊÖ²µÁ}€‹35?º½Éìðüìðüæêöåéõìðüìðü»¾ÊÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞìðüìðüìðüìðü35?46@{~‰±´ÀÆÉÕÙÜèìðüìðüìðüìðüìðüìðü>AKÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ§ª¶ìðüìðüìðüEGREGRìðüìðüìðü§ª¶NP[ìðüìðüìðü†‰”†Š•ìðüìðüìðüNP[NP[ìðüìðüìðü†‰”†Š•ìðüìðüìðüNP[')3ìðüìðüìðüìðüìðüìðü')3ÏÒÞìðüìðüÏÒÞ')3ìðüìðüìðüìðüOQ\[^iìðüìðüìðü[^ihkvìðüìðüìðü’•¡ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ«¯ºìðüìðüìðü((ìðüìðüìðü«¯ºÏÒÞìðüìðüÏÒÞž¡­ìðüìðüìðü� ¬!+sv�êîúìðüìðüìðüÉÍÙÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü�”Ÿ‘• ìðüìðüìðüZ]h"ìðüìðüìðü¾Á;ÁÍìðüìðüìðü!"ìðüìðüìðü¾Á;ÁÍìðüìðüìðü!� ¬ìðüìðüìðüìðüìðüìðü� ¬ÏÒÞìðüìðüÏÒÞ� ¬ìðüìðüìðüž¡­[^iìðüìðüìðü[^ièìøìðüìðüçë÷ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ�„�ìðüìðüìðüGJTFITìðüìðüìðü‚…�ÏÒÞìðüìðüÏÒÞ')3ìðüìðüìðüìðüNP[8:EÙÜèìðüìðüìðüsv�ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞèìøìðüìðüÝáíÞâîìðüìðüèìø¾ÁÍìðüìðüìðü!"ìðüìðüìðü¾Á;ÁÍìðüìðüìðü!"ìðüìðüìðü¾ÁÍNP[ìðüìðüìðüìðüìðüìðüìðüìðüNP[ÏÒÞìðüìðüÏÒÞNP[ìðüìðüìðüìðü')3[^iìðüìðüìðü[^i’•¡ìðüìðüìðügjuÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞUXbìðüìðüìðü}�Œ?BL½À̽ÀÌ?BL}€‹ìðüìðüìðüVXcÏÒÞìðüìðüÏÒÞuxƒìðüìðüìðüÅÈÔKNXìðüìðüìðüÇË×ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÐÓßÐÔàìðüìðüÏÒÞœŸ«ìðüìðüìðüOQ\OR]ìðüìðüìðü›Ÿª†Š•ìðüìðüìðüNP[NP[ìðüìðüìðü†‰”†Š•ìðüìðüìðüNP[NP[ìðüìðüìðü†‰”ÅÈÔìðüìðüìðüuxƒuxƒìðüìðüìðüÅÈÔÏÒÞìðüìðüÏÒÞÅÈÔìðüìðüìðüuxƒ[^iìðüìðüìðü[^i=?Iìðüìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ ",ìðüìðüìðüÆÉÕ½ÀÌìðüìðüØÛç(*4ÆÉÕìðüìðüìðü!#-ÏÒÞìðüìðüÏÒÞÆÉÕìðüìðüìðüuxƒ³¶Âìðüìðüìðü$&1ÏÒÞìðüìðüÏÒÞÁÅÐìðüìðüàäðáåðìðüìðüÀÄÏOR]ìðüìðüìðü›ŸªœŸ«ìðüìðüìðüOQ\NP[ìðüìðüìðü†‰”†Š•ìðüìðüìðüNP[NP[ìðüìðüìðü†‰”†Š•ìðüìðüìðüNP[uxƒìðüìðüìðüÆÉÕÆÉÕìðüìðüìðüuxƒÏÒÞìðüìðüÏÒÞuxƒìðüìðüìðüÆÉÕ[^iìðüìðüìðü[^i½ÀÌìðüìðüìðü<>IÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ´·ÃìðüìðüìðüDFQ½ÀÌìðüìðüìðü¾ÂÎDFQìðüìðüìðü´·ÃÏÒÞìðüìðüÏÒÞOQ\ìðüìðüìðüìðü')3wz…ìðüìðüìðüNP[ÏÒÞìðüìðüÏÒÞ¬°»ìðüìðüìðü *!+ìðüìðüìðü«¯ºÞâîìðüìðüèìøèìøìðüìðüÝáí"ìðüìðüìðü¾Á;ÁÍìðüìðüìðü!"ìðüìðüìðü¾Á;ÁÍìðüìðüìðü!')3ìðüìðüìðüìðüOQ\OQ\ìðüìðüìðüìðü')3ÏÒÞìðüìðüÏÒÞ')3ìðüìðüìðüìðüOQ\[^iìðüìðüìðü[^ihkvìðüìðüìðü’•¡ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞkmxìðüìðüìðüª­¹ADNìðüìðüìðüìðü¥©´©¬¸ìðüìðüìðükmxÏÒÞìðüìðüÏÒÞž¡­ìðüìðüìðü� ¬acnìðüìðüìðüXZeÏÒÞìðüìðüÏÒÞ~�ŒìðüìðüìðüWYdWYdìðüìðüìðü}�Œ‘• ìðüìðüìðüZ]h[^iìðüìðüìðü�”Ÿ¾ÁÍìðüìðüìðüìðüìðüìðü¾Á;ÁÍìðüìðüìðüìðüìðüìðü¾ÁÍ� ¬ìðüìðüìðüž¡­ž¡­ìðüìðüìðü� ¬ÏÒÞìðüìðüÏÒÞ� ¬ìðüìðüìðüž¡­[^iìðüìðüìðü[^ièìøìðüìðüçë÷ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÕÙåìðüìðüìðü\_jY\gìðüìðüìðüìðüŒ�šìðüìðüìðüÖÚå ÏÒÞìðüìðüÏÒÞ')3ìðüìðüìðüìðüNP[sv�ìðüìðüìðüJMWÏÒÞìðüìðüÏÒÞHKUìðüìðüìðü¤¨³¤¨³ìðüìðüìðüHKUEGRìðüìðüìðü§ª¶§ª¶ìðüìðüìðüEGR†Š•ìðüìðüìðüìðüìðüìðü†‰”†Š•ìðüìðüìðüìðüìðüìðü†‰”NP[ìðüìðüìðüìðü')3')3ìðüìðüìðüìðüNP[ÏÒÞìðüìðüÏÒÞNP[ìðüìðüìðüìðü')3[^iìðüìðüìðü[^i’•¡ìðüìðüìðügjuÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞps~ìðüìðüìðüÞâî,/9tv�ìðüìðüìðüìðüìðüìðüìðüps~ÏÒÞìðüìðüÏÒÞuxƒìðüìðüìðüÅÈÔXZe•˜£Y\g¯³¾ìðüìðüìðü*,6ÏÒÞìðüìðüÏÒÞÕÙåìðüìðüìðü@CMADNìðüìðüìðüÔØäÒÖâìðüìðüìðüìðüìðüìðüÑÕáNP[ìðüìðüìðüìðüìðüìðüNP[NP[ìðüìðüìðüìðüìðüìðüNP[ÅÈÔìðüìðüìðüuxƒuxƒìðüìðüìðüÅÈÔÏÒÞìðüìðüÏÒÞÅÈÔìðüìðüìðüuxƒ[^iìðüìðüìðü[^i=?Iìðüìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ¶ºÅìðüìðüìðüÊÎÚ$&1Œ�šìðüìðüìðüìðüìðü·»ÆÏÒÞìðüìðüÏÒÞÆÉÕìðüìðüìðüuxƒ;=HìðüìðüìðüNP[LNYìðüìðüìðüËÏÚÏÒÞìðüìðüÏÒÞuxƒìðüìðüìðüÇÊÖÇË×ìðüìðüìðüuxƒ†‰”ìðüìðüìðüìðüìðüìðü†‰”"ìðüìðüìðüìðüìðüìðü!"ìðüìðüìðüìðüìðüìðü!uxƒìðüìðüìðüÆÉÕÆÉÕìðüìðüìðüuxƒÏÒÞìðüìðüÏÒÞuxƒìðüìðüìðüÆÉÕ[^iìðüìðüìðü[^i½ÀÌìðüìðüìðü<>IÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ47AìðüìðüìðüìðüÛßëOR]OR]ÛßëìðüìðüìðüìðüADNÏÒÞìðüìðüÏÒÞOQ\ìðüìðüìðüìðü')3WYdìðüìðüìðüØÛç46@58BÙÝéìðüìðüìðümp{ÏÒÞìðüìðüÏÒÞ + ÔØäìðüìðüìðüµ¹Ä!$.!$.µ¹ÄìðüìðüìðüÔØä + :I½ÀÌìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞ;=H¹½Èìðüìðüìðüìðüìðüìðüìðü¹½È<>I=@J·»Æìðüìðüìðüìðüìðüìðüìðü·»Æ?BL;=H¹½Èìðüìðüìðüìðüìðüìðüìðü¹½È<>IÏÒÞìðüìðüÏÒÞ<>I¸¼Çìðüìðüìðüìðüìðüìðüìðü¼¿Ë9;F½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌ;=H¹½Èìðüìðüìðüìðüìðüìðüìðü¹½È<>I½ÀÌìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞdgrÚÞêìðüìðüìðüìðüìðüìðüìðüÚÞêehsNP[ìðüìðüìðüNP[½ÀÌìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞ%'2³¶ÂìðüìðüìðüNP[[^iìðüìðüìðü[^i½ÀÌìðüìðü½ÀÌèìøìðüìðüìðüìðüìðüìðüèìøps~or}èìøìðüìðüìðüìðüìðüìðüèìøps~½ÀÌìðüìðü½ÀÌdgrÚÞêìðüìðüìðüìðüìðüìðüìðüÚÞêehs;=H¹½Èìðüìðüìðüìðüìðüìðüìðü¹½È<>I]`kìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü]`k\_jìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü^ak]`kìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞìðüìðüÏÒÞbdoìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü]`k½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌ]`kìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü—š¥[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞNP[ÛßëìðüìðüìðüìðüNP[[^iìðüìðüìðü[^iÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü�’��’�ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü�’�ÏÒÞìðüìðüÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü—š¥]`kìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü]`kQT_ìðüìðüìðüìðüìðüìðüÑÕáëïûìðüìðüìðüìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüÑÕáëïûìðüìðüìðüìðüìðüQT_NP[ìðüìðüìðüìðüìðüìðüÖÚåìðüìðüìðüìðüìðüìðüLNYQT_ìðüìðüìðüìðüìðüìðüÑÕáëïûìðüìðüìðüìðüìðüìðüìðüÏÒÞSV`ìðüìðüìðüìðüìðüéíùÓ×ãìðüìðüìðüìðüìðüìðüQT_?BL½ÀÌÏÒÞÏÒÞÏÒÞìðüìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BLQT_ìðüìðüìðüìðüìðüìðüÑÕáëïûìðüìðüìðüìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðüìðüìðüåéõÐÔàäèôìðüìðüìðüìðüìðü—š¥[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞuxƒìðüìðüìðüìðüìðüŠ�˜[^iìðüìðüìðü[^iÏÒÞìðüìðüìðüìðüìðüìðüÙÝéÙÜèìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÙÝéÙÜèìðüìðüìðüìðüìðüor}ÏÒÞìðüìðüìðüìðüìðüìðüìðüåéõÐÔàäèôìðüìðüìðüìðüìðü—š¥QT_ìðüìðüìðüìðüìðüìðüÑÕáëïûìðüìðüìðüìðüìðüQT_'ØÛçìðüìðüìðüÙÜè`bm  `bmÙÜèìðüìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðüÙÜè`bm  `bmÙÜèìðüìðüìðü×Ûæ'!ÛßëìðüìðüìðüÖÚå\_j  + ]`kÔØäìðüìðüìðüÛßë'ØÛçìðüìðüìðüÙÜè`bm  `bmÙÜèìðüìðüìðüìðüìðüÏÒÞ"ØÛçìðüìðüìðüÙÜè_bl  `bmÚÞêìðüìðüìðüØÛç'[^iìðüìðüìðü[^i'ØÛçìðüìðüìðüÙÜè`bm  `bmÙÜèìðüìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðü®²½GJTFIT®²½ìðüìðüìðüìðüdgr[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞŸ¢®ìðüìðüìðüìðüìðübdo[^iìðüìðüìðü[^iÏÒÞìðüìðüìðüìðü£§²47A47A£§²ìðüìðüìðüìðüìðüìðü£§²47A47A£§²ìðüìðüìðüèìø%ÏÒÞìðüìðüìðüìðüìðü®²½GJTFIT®²½ìðüìðüìðüìðüdgr'ØÛçìðüìðüìðüÙÜè`bm  `bmÙÜèìðüìðüìðü×Ûæ'†‰”ìðüìðüìðüÇË×"%/"%/ÇË×ìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüÇË×"%/"%/ÇË×ìðüìðüìðü…ˆ“Š�˜ìðüìðüìðüÉÍÙ$&1$&1ÊÎÚìðüìðüìðü(†‰”ìðüìðüìðüÇË×"%/"%/ÇË×ìðüìðüìðüìðüÏÒÞ†Š•ìðüìðüìðüÉÍÙ"%/"%/ÇË×ìðüìðüìðü†‰”[^iìðüìðüìðü[^i†‰”ìðüìðüìðüÇË×"%/"%/ÇË×ìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüìðü‚…�‚…�ìðüìðüìðüÚÞê[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ9;FÇÊÖìðüìðüìðüìðüÇÊÖ9;F[^iìðüìðüìðü[^iÏÒÞìðüìðüìðü£§²£§²ìðüìðüìðüìðü£§²£§²ìðüìðüìðüps~ÏÒÞìðüìðüìðüìðü‚…�‚…�ìðüìðüìðüÚÞꆉ”ìðüìðüìðüÇË×"%/"%/ÇË×ìðüìðüìðü…ˆ“ëïûìðüìðüìðü;=H;=HìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüìðü;=H;=Hìðüìðüìðüêîúæêöìðüìðüìðü8:E69CÓ×ãìðü‹Ž™ëïûìðüìðüìðü;=H;=HìðüìðüìðüìðüÏÒÞ êîúìðüìðüìðü;=H;=Hìðüìðüìðüëïû[^iìðüìðüìðü[^iëïûìðüìðüìðü;=H;=HìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüìðü®²½®²½ìðüìðüìðü^ak[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞbdoìðüìðüìðüìðüìðüŸ¢®[^iìðüìðüìðü[^iÏÒÞìðüìðüìðü47A47Aìðüìðüìðüìðü47A47Aìðüìðüìðüª­¹ÏÒÞìðüìðüìðü®²½®²½ìðüìðüìðü^akëïûìðüìðüìðü;=H;=Hìðüìðüìðüêîú\_jìðüìðüìðü“–¢“–¢ìðüìðüìðüÏÒÞÏÒÞìðüìðüìðü“–¢“–¢ìðüìðüìðü[^iY\gìðüìðüìðü•˜£$\_jìðüìðüìðü“–¢“–¢ìðüìðüìðüÏÒÞXZeìðüìðüìðü•˜£“–¢ìðüìðüìðü\_j[^iìðüìðüìðü[^i\_jìðüìðüìðü“–¢“–¢ìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüFITGJTìðüìðüìðü—š¥[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞŠ�˜ìðüìðüìðüìðüìðüuxƒ[^iìðüìðüìðü[^iÏÒÞìðüìðüÙÜèÙÝéìðüìðüÙÜèÙÝéìðüìðüÇÊÖÏÒÞìðüìðüìðüFITGJTìðüìðüìðü—š¥\_jìðüìðüìðü“–¢“–¢ìðüìðüìðü[^i�“žìðüìðüìðüCEPDFQìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüCEPDFQìðüìðüìðü�’�“–¢ìðüìðüìðüBDO�“žìðüìðüìðüCEPDFQìðüìðüìðüÏÒÞ�“žìðüìðüìðüEGRCEPìðüìðüìðü�“ž[^iìðüìðüìðü[^i�“žìðüìðüìðüCEPDFQìðüìðüìðüÏÒÞÏÒÞìðüìðüäèôåéõìðüìðü¾ÁÍ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ³¶ÂìðüìðüìðüìðüÛßëNP[[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüäèôåéõìðüìðü¾ÁÍ�“žìðüìðüìðüCEPDFQìðüìðüìðü�’�º½Éìðüìðüìðü ìðüìðüìðüÏÒÞÏÒÞìðüìðüìðü ìðüìðüìðü¹½È´¸Äìðüìðüìðü + º½Éìðüìðüìðü ìðüìðüìðüÏÒÞ¶ºÅìðüìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞìðüìðüìðüº½É[^iìðüìðüìðü[^iº½Éìðüìðüìðü ìðüìðüìðüÏÒÞÏÒÞìðüìðüÐÓßÐÔàìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÛßëìðüìðüìðüìðüâæò?BL[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÐÓßÐÔàìðüìðüÏÒÞº½Éìðüìðüìðü ìðüìðüìðü¹½ÈÉÍÙìðüìðüØÛçÙÜèìðüìðüÏÒÞÏÒÞìðüìðüØÛçÙÜèìðüìðüÈÌØÉÍÙìðüìðüÔØäÉÍÙìðüìðüØÛçÙÜèìðüìðüÏÒÞÇÊÖìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÉÍÙ[^iìðüìðüìðü[^iÉÍÙìðüìðüØÛçÙÜèìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüâæò?BL[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÉÍÙìðüìðüØÛçÙÜèìðüìðüÈÌØÈÌØìðüìðüÙÜèØÛçìðüìðüÏÒÞÏÒÞìðüìðüÙÜèØÛçìðüìðüÉÍÙÇË×ìðüìðüÖÚåÈÌØìðüìðüÙÜèØÛçìðüìðüÏÒÞÌÐÛìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌ[^iìðüìðüìðü[^iÈÌØìðüìðüÙÜèØÛçìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðüâæòìðüìðüìðüâæò?BL[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÈÌØìðüìðüÙÜèØÛçìðüìðüÉÍÙ¹½Èìðüìðüìðü ìðüìðüìðüÏÒÞÏÒÞìðüìðüìðü ìðüìðüìðüº½É´¸Äìðüìðüìðü ¹½Èìðüìðüìðü ìðüìðüìðüÏÒÞ´·ÃìðüìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BL[^iìðüìðüìðü[^i¹½Èìðüìðüìðü ìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüìðüÇÊÖ9;F?BLâæòìðüìðüìðüâæò?BL[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ¹½Èìðüìðüìðü ìðüìðüìðüº½É�’�ìðüìðüìðüDFQCEPìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüDFQCEPìðüìðüìðü�“ž”—¢ìðüìðüìðüDFQ�’�ìðüìðüìðüDFQCEPìðüìðüìðüÏÒÞ‘• ìðüìðüìðüADN[^iìðüìðüìðü[^i�’�ìðüìðüìðüDFQCEPìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ?BLâæòìðüìðüìðüâæò?BL[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ�’�ìðüìðüìðüDFQCEPìðüìðüìðü�“ž[^iìðüìðüìðü“–¢“–¢ìðüìðüìðüÏÒÞÏÒÞìðüìðüìðü“–¢“–¢ìðüìðüìðü\_jXZeìðüìðüìðü•˜£$[^iìðüìðüìðü“–¢“–¢ìðüìðüìðüÏÒÞZ]hìðüìðüìðü”—¢$[^iìðüìðüìðü[^i[^iìðüìðüìðü“–¢“–¢ìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ?BLâæòìðüìðüìðüâæò?BL[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü“–¢“–¢ìðüìðüìðü\_jêîúìðüìðüìðü;=H;=HìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüìðü;=H;=Hìðüìðüìðüëïûæêöìðüìðüìðü9;F7:DÓ×ãìðü‹Ž™êîúìðüìðüìðü;=H;=HìðüìðüìðüìðüÏÒÞæêöìðüìðüìðü8:E69CÓ×ãìðü‹Ž™[^iìðüìðüìðü[^iêîúìðüìðüìðü;=H;=HìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ?BLâæòìðüìðüìðüâæò?BL[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞêîúìðüìðüìðü;=H;=Hìðüìðüìðüëïû…ˆ“ìðüìðüìðüÇË×"%/"%/ÇË×ìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüÇË×"%/"%/ÇË×ìðüìðüìðü†‰”Š�˜ìðüìðüìðüÉÍÙ$&1$&1ÉÍÙìðüìðüìðü(…ˆ“ìðüìðüìðüÇË×"%/"%/ÇË×ìðüìðüìðüìðüÏÒÞˆ‹—ìðüìðüìðüÇË×$&1$&1ÊÎÚìðüìðüìðü([^iìðüìðüìðü[^i…ˆ“ìðüìðüìðüÇË×"%/"%/ÇË×ìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ?BLâæòìðüìðüìðüâæò?BL[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ…ˆ“ìðüìðüìðüÇË×"%/"%/ÇË×ìðüìðüìðü†‰”'×ÛæìðüìðüìðüÙÜè`bm  `bmÙÜèìðüìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðüÙÜè`bm  `bmÙÜèìðüìðüìðüØÛç'!ÙÜèìðüìðüìðüÔØä]`k +  \_jÖÚåìðüìðüìðüÛßë'×ÛæìðüìðüìðüÙÜè`bm  `bmÙÜèìðüìðüìðüìðüìðüÏÒÞ"Üàììðüìðüìðü×Ûæ_bl  + ]`kÔØäìðüìðüìðüÛßë[^iìðüìðüìðü[^i'×ÛæìðüìðüìðüÙÜè`bm  `bmÙÜèìðüìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ?BLâæòìðüìðüìðüâæò?BL[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ'×ÛæìðüìðüìðüÙÜè`bm  `bmÙÜèìðüìðüìðüØÛç'QT_ìðüìðüìðüìðüìðüëïûÑÕáìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðüìðüìðüëïûÑÕáìðüìðüìðüìðüìðüìðüQT_OR]ìðüìðüìðüìðüìðüìðüÖÚåìðüìðüìðüìðüìðüìðüNP[QT_ìðüìðüìðüìðüìðüëïûÑÕáìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞNP[ìðüìðüìðüìðüìðüìðüÖÚåìðüìðüìðüìðüìðüìðüLNY[^iìðüìðüìðü[^iQT_ìðüìðüìðüìðüìðüëïûÑÕáìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ?BLâæòìðüìðüìðüâæò?BL[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞQT_ìðüìðüìðüìðüìðüëïûÑÕáìðüìðüìðüìðüìðüìðüQT_]`kìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü]`k^akìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü\_j]`kìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞìðüìðüÏÒÞ\_jìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü^ak[^iìðüìðüìðü[^i]`kìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ?BLâæòìðüìðüìðü½ÀÌ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ]`kìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü]`k<>I¹½Èìðüìðüìðüìðüìðüìðüìðü¹½È;=H½ÀÌìðüìðü½À̽ÀÌìðüìðü½ÀÌ<>I¹½Èìðüìðüìðüìðüìðüìðüìðü¹½È;=H?BL·»Æìðüìðüìðüìðüìðüìðüìðü·»Æ=@J<>I¹½Èìðüìðüìðüìðüìðüìðüìðü¹½È;=H½ÀÌìðüìðü½ÀÌ<>I¹½Èìðüìðüìðüìðüìðüìðüìðü·»Æ?BLNP[ìðüìðüìðüNP[<>I¹½Èìðüìðüìðüìðüìðüìðüìðü¹½È;=HÏÒÞìðüìðüÏÒÞ½ÀÌìðüìðü½À̽ÀÌìðüìðü½ÀÌNP[ìðüìðüìðüNP[ÏÒÞìðüìðüÏÒÞ½ÀÌìðüìðü½ÀÌ?BLâæòìðüìðü½ÀÌNP[ìðüìðüìðüNP[½ÀÌìðüìðü½À̽ÀÌìðüìðü½À̽ÀÌìðüìðü½À̽ÀÌìðüìðü½À̽ÀÌìðüìðü½ÀÌ<>I¹½Èìðüìðüìðüìðüìðüìðüìðü¹½È;=HOQ\�“ž¼¿ËÏÒÞ»¾Ê�’�OQ\?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BLOQ\�“ž¼¿ËÏÒÞ»¾Ê�’�OQ\GJT’•¡¼¿ËÇË×¾ÂÎ�”ŸGJTOQ\�“ž¼¿ËÏÒÞ»¾Ê�’�OQ\?BL½À̽ÀÌ?BLFIT�”Ÿ¾ÂÎÇË×¼¿Ë’•¡GJT‰Œ—ÏÒÞ‰Œ—OQ\�“ž¼¿ËÏÒÞ»¾Ê�’�OQ\ÏÒÞìðüìðüÏÒÞ?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL‰Œ—ÏÒÞ‰Œ—ÏÒÞìðüìðüÏÒÞ?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL‰Œ—ÏÒÞ‰Œ—?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BLOQ\�“ž¼¿ËÏÒÞ»¾Ê�’�OQ\ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÙÜèìðüìðüÇË××ÛæìðüìðüÉÍÙ!"!+ìðüìðüìðü²µÁìðüìðüìðü¶ºÅehsìðüìðühkvtw‚ìðüìðüìðü}€‹SV`ìðüìðüìðüŠ�˜ÈÌØìðüìðüìðü47A7:Dìðüìðüìðüìðü35?µ¹ÄìðüìðüìðüJMW¤¨³ìðüìðüìðüÖÚåMOZILVÚÞêìðüìðüìðü£§²OR]OR]†‰”ìðüìðüìðüÊÎÚ$&1âåñìðüìðüìðüìðü²µÁvy„bdovy„´¸Äìðüìðüìðüìðüãçó(*4Š�˜ìðüìðü´¸Äknykmxµ¹ÄìðüìðüìðüìðüacnKNXìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüJMWÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðü™�¨?BLÇÊÖìðüìðüìðüìðüìðüìðüìðüìðüìðüËÏÚ=?Iˆ‹—ìðüìðüìðüìðüìðüìðüìðüìðü›Ÿª or}ÇË×ìðüìðüìðüìðüìðüÅÈÔtv�`bmËÏÚìðüìðüìðüìðüÊÎÚcfq*,6JMWVXcOR]&(347AUXbQT_02=NP[NP[%'2[^i%'2NP[NP[Y\gÀÄÏìðüìðü‰Œ—%'2âæòìðüâæò%'2‰Œ—ìðüìðüÀÄÏY\g?BLÀÄÏìðüìðüìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüìðüìðüÀÄÏ?BL½ÀÌìðüìðüìðüìðüìðü‰Œ—[^iìðüìðüìðü[^i‰Œ—ìðüìðüìðüìðüìðü½ÀÌÏÒÞìðüìðüìðü¿ÃÏX[f[^iìðüìðüìðü[^iX[f¿ÃÏìðüìðüìðüÏÒÞ‰Œ—ÏÒÞ‰Œ—ÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞNP[ìðüìðüìðüNP[ÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ?BL½À̽ÀÌ?BLOQ\�’�»¾ÊÏÒÞ¼¿Ë�“žOQ\OQ\�’�»¾ÊÏÒÞ¼¿Ë�“žOQ\?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL\_j—š¥¿ÃÏÍÑܾÁÍ—š¥\_jbep›ŸªÀÄÏËÏÚ¾ÂΛŸªbep?BL½ÀÌÏÒÞÏÒÞÏÒÞìðüìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BLÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ½ÀÌìðüìðü½ÀÌ;=H¹½Èìðüìðüìðüìðüìðüìðüìðü¹½È<>I;=H¹½Èìðüìðüìðüìðüìðüìðüìðü¹½È<>I½ÀÌìðüìðü½À̽ÀÌìðüìðü½ÀÌehsÚÞêìðüìðüìðüìðüìðüìðüìðü›ŸªlozÞâîìðüìðüìðüìðüìðüìðüìðüàäðloz½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½À̽ÀÌìðüìðü½À̽ÀÌìðüìðü½À̽ÀÌìðüìðü¾Á;ÁÍìðüìðü½À̽ÀÌìðüìðü½À̽ÀÌìðüìðü½À̽ÀÌìðüìðü½À̽ÀÌìðüìðüÕÙå$&1$&1ÕÙåìðüìðü½À̽ÀÌìðüìðü¾Á;ÁÍìðüìðü½À̽ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌ?BLâæòìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüâæò?BLÏÒÞìðüìðüÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü]`k]`kìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüÝáí��›ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü�’�½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ½ÀÌìðüìðüìðüADNADNìðüìðüìðü½À̽ÀÌìðüìðüìðü*-7*-7ìðüìðüìðüìðü*-7*-7ìðüìðüìðü½À̽ÀÌìðüìðüìðü¸¼Ç¸¼Çìðüìðüìðü½À̽ÀÌìðüìðüìðüADNBDOìðüìðüìðü½À̽ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌ?BLâæòìðüìðüìðü½ÀÌ[^iìðüìðüìðü[^i½ÀÌìðüìðüìðüâæò?BLÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüÑÕáëïûìðüìðüìðüìðüìðüQT_QT_ìðüìðüìðüìðüìðüìðüÑÕáëïûìðüìðüìðüìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðüìðüìðüæêöÓ×ãäèôìðüìðü�’�lozìðüìðüìðüìðüìðüâæòÒÖâåéõìðüìðüìðüìðüìðüfit?BL½ÀÌÏÒÞÏÒÞÏÒÞìðüìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BLÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞdgrìðüìðüìðüšž©šž©ìðüìðüìðüdgrtv�ìðüìðüìðütv�tv�ìðüìðüìðüìðütv�tv�ìðüìðüìðütv�BDOìðüìðüìðüìðüšž©šž©ìðüìðüìðüìðüBDOdgrìðüìðüìðüšž©›Ÿªìðüìðüìðüdgr?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞìðüìðüìðüìðüBDO?BLâæòìðüìðüìðüâæò?BL[^iìðüìðüìðü[^i?BLâæòìðüìðüìðüâæò?BLÏÒÞìðüìðüìðüìðüìðüÙÜè`bm  `bmÙÜèìðüìðüìðü×Ûæ''ØÛçìðüìðüìðüÙÜè`bm  `bmÙÜèìðüìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðü®²½GJT>AKFITÛßëìðüìðüìðü¨«·@CMADN¨«·ìðüìðüìðü…ˆ“[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ áåðìðüìðüìðü) *ìðüìðüìðüáåð *-7ìðüìðüìðü½À̽ÀÌìðüìðüìðüìðü½À̽ÀÌìðüìðüìðü*-7_blìðüìðüìðüìðü}€‹}€‹ìðüìðüìðüìðü_bl áåðìðüìðüìðü) ",ìðüìðüìðüßãï + }€‹ìðüìðüìðüìðü_bl½ÀÌìðüìðüìðüâæò?BL[^iìðüìðüìðü[^i?BLâæòìðüìðüìðü½ÀÌ%'2[^i%'2ÏÒÞìðüìðüìðüìðüÇË×"%/"%/ÇË×ìðüìðüìðü…ˆ“†‰”ìðüìðüìðüÇË×"%/"%/ÇË×ìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüìðü‚…�BDOìðüìðüìðü¦©µšž©ìðüÒÖâ.0;[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞˆ‹—ìðüìðüìðüvy„vy„ìðüìðüìðü‡‹–½ÀÌìðüìðüìðü*-7*-7ìðüìðüìðüìðüìðüìðü*-7*-7ìðüìðüìðü½ÀÌ}€‹ìðüìðüìðüìðü_bl_blìðüìðüìðüìðü}€‹ˆ‹—ìðüìðüìðüvy„z}ˆìðüìðüìðü†‰”_blìðüìðüìðüìðü}€‹½ÀÌìðüìðüìðüâæò?BL[^iìðüìðüìðü[^i?BLâæòìðüìðüìðü½ÀÌilvéíùìðüæêö[^iÏÒÞìðüìðüìðüìðü;=H;=Hìðüìðüìðüêîúëïûìðüìðüìðü;=H;=HìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüìðü®²½XZeìðüìðüìðü`bm ",[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ/1<ìðüìðüìðüÏÒÞÐÓßìðüìðüìðü/1<tv�ìðüìðüìðütv�tv�ìðüìðüìðüìðüìðüìðütv�tv�ìðüìðüìðütv�šž©ìðüìðüìðüìðüADNADNìðüìðüìðüìðüšž©/1<ìðüìðüìðüÏÒÞÓ×ãìðüìðüìðü,/9ADNìðüìðüìðüìðüšž©?BLâæòìðüìðüìðüâæò?BL[^iìðüìðüìðü[^i?BLâæòìðüìðüìðüâæò?BL)+5©¬¸ìðüìðüìðüìðüìðüŠ�˜HKU½À̽ÀÌ?BLÏÒÞìðüìðüìðü“–¢“–¢ìðüìðüìðü[^i\_jìðüìðüìðü“–¢“–¢ìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüFITDFQìðüìðüìðü£§²[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ¬°»ìðüìðüìðüSV`SV`ìðüìðüìðü«¯º*-7ìðüìðüìðü½À̽ÀÌìðüìðüìðüìðüìðüìðü½À̽ÀÌìðüìðüìðü*-7¸¼ÇìðüìðüìðüÕÙå$&1ÕÙåìðüìðüìðü¸¼Ç¬°»ìðüìðüìðüSV`X[fìðüìðüìðü¨«·$&1ÕÙåìðüìðüìðü¸¼Ç?BLâæòìðüìðüìðü½ÀÌ[^iìðüìðüìðü[^i½ÀÌìðüìðüìðüâæò?BLilvéíùìðüìðüìðüìðüìðüìðüìðü¸¼Ç.0; ‰Œ—ìðüìðüìðü½ÀÌÏÒÞìðüìðüìðüCEPDFQìðüìðüìðü�’��“žìðüìðüìðüCEPDFQìðüìðüìðüÏÒÞÏÒÞìðüìðüäèô +Üàììðüìðüìðü«®¹>AK[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞSV`ìðüìðüìðü«¯º¬°»ìðüìðüìðüSV`½ÀÌìðüìðüìðü*-7*-7ìðüìðüìðü½À̽ÀÌìðüìðüìðü*-7*-7ìðüìðüìðü½ÀÌ$&1ÖÚåìðüìðüìðü¸¼ÇìðüìðüìðüÖÚå$&1SV`ìðüìðüìðü«¯º²µÁìðüìðüìðüNP[¸¼ÇìðüìðüìðüÖÚå$&1?BLâæòìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüâæò?BL‰Œ—ìðüìðüìðüìðüìðü¸¼Çìðüìðüìðüìðüæêö[^iÉÍÙìðüìðüìðüìðü½ÀÌÏÒÞìðüìðüìðü ìðüìðüìðü¹½Èº½Éìðüìðüìðü ìðüìðüìðüÏÒÞÏÒÞìðüìðüÐÓßps~ìðüìðüìðüìðüìðüäèôÐÔàÂÆÑ� ¬`bm [^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÐÓßìðüìðüìðü/1</1<ìðüìðüìðüÏÒÞtv�ìðüìðüìðütv�tv�ìðüìðüìðütv�tv�ìðüìðüìðütv�tv�ìðüìðüìðütv�BDOìðüìðüìðüìðüìðüìðüìðüBDOÐÓßìðüìðüìðü/1<69CìðüìðüìðüÉÍÙšž©ìðüìðüìðüìðüBDOÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüìðüêîújlwŠ�˜ìðüìðüìðüìðüìðüìðüìðüìðüìðüÊÎÚ?BLÏÒÞìðüìðüØÛçÙÜèìðüìðüÈÌØÉÍÙìðüìðüØÛçÙÜèìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ��›ìðüìðüìðüìðüìðüìðüìðüìðüìðüÞâîhkv[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞvy„ìðüìðüìðü‡‹–ˆ‹—ìðüìðüìðüvy„*-7ìðüìðüìðü½À̽ÀÌìðüìðüìðü*-7*-7ìðüìðüìðü½À̽ÀÌìðüìðüìðü*-7_blìðüìðüìðüìðüìðü_blvy„ìðüìðüìðü‡‹–�”Ÿìðüìðüìðüor}}€‹ìðüìðüìðüìðü_blÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ‰Œ—ìðüìðü©¬¸)+5[^iæêöìðüìðüìðüìðüìðüìðü‰Œ— ÏÒÞìðüìðüÙÜèØÛçìðüìðüÉÍÙÈÌØìðüìðüÙÜèØÛçìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞilvÞâîìðüìðüìðüìðüìðüìðüìðüìðüìðü�’�[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ *ìðüìðüìðüáåð  áåðìðüìðüìðü)½ÀÌìðüìðüìðü*-7*-7ìðüìðüìðü½À̽ÀÌìðüìðüìðü*-7*-7ìðüìðüìðü½ÀÌ_blìðüìðüìðüìðüìðü_bl *ìðüìðüìðüáåð "êîúìðüìðüêîú"_blìðüìðüìðüìðü}€‹ÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞNP[NP[-0:¸¼ÇìðüìðüìðüÊÎÚILVÏÒÞìðüìðüìðü ìðüìðüìðüº½É¹½Èìðüìðüìðü ìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ _bl›ŸªÀÄÏÐÓßäèôìðüìðüìðüìðüìðüps~[^iìðüìðüìðü[^iÏÒÞìðüìðüÐÓßÐÔàìðüìðüÏÒÞšž©ìðüìðüìðüdgrdgrìðüìðüìðüšž©tv�ìðüìðüìðütv�tv�ìðüìðüìðütv�tv�ìðüìðüìðütv�tv�ìðüìðüìðütv�ADNìðüìðüìðüìðüìðüìðüìðüADNšž©ìðüìðüìðüdgrnq|ìðüìðüìðü‘• ADNìðüìðüìðüìðüšž©ÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ‰Œ—ÏÒÞ‰Œ— ÏÒÞìðüìðüìðüDFQCEPìðüìðüìðü�“ž�’�ìðüìðüìðüDFQCEPìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ>AK«®¹ìðüìðüìðüÝáí[^iìðüìðüìðü[^i¾ÂÎìðüìðüäèôåéõìðüìðüÏÒÞADNìðüìðüìðü¾Á;ÁÍìðüìðüìðüADN*-7ìðüìðüìðü½À̽ÀÌìðüìðüìðü*-7*-7ìðüìðüìðü½À̽ÀÌìðüìðüìðü*-7$&1ÕÙåìðüìðüìðü¸¼ÇìðüìðüìðüÕÙå$&1ADNìðüìðüìðü¾ÁÍÈÌØìðüìðüìðü7:D$&1ÕÙåìðüìðüìðü¸¼ÇÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüìðü“–¢“–¢ìðüìðüìðü\_j[^iìðüìðüìðü“–¢“–¢ìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ¥©´ìðüìðüìðüFHS[^iìðüìðüìðü[^i˜›¦ìðüìðüìðüFITGJTìðüìðüìðüÏÒÞ¾ÁÍìðüìðüìðüADNìðüìðüìðü¾ÁͽÀÌìðüìðüìðüìðüìðüìðü½À̽ÀÌìðüìðüìðüìðüìðüìðü½À̸¼ÇìðüìðüìðüÖÚå$&1ÖÚåìðüìðüìðü¸¼Ç¾ÁÍìðüìðüìðüMOZìðüìðüìðü³¶Â¸¼ÇìðüìðüìðüÖÚå$&1ÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüìðüìðü;=H;=Hìðüìðüìðüëïûêîúìðüìðüìðü;=H;=HìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ ",acnìðüìðüìðüY\g[^iìðüìðüìðü]`k^akìðüìðüìðü®²½®²½ìðüìðüìðüÏÒÞdgrìðüìðüìðüšž©ìðüìðüìðüdgrtv�ìðüìðüìðüìðüìðüìðütv�tv�ìðüìðüìðüìðüìðüìðütv�šž©ìðüìðüìðüìðüBDOBDOìðüìðüìðüìðüšž©dgrìðüìðüìðü§ª¶ìðüìðüìðüY\gšž©ìðüìðüìðüìðüBDOÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüÇË×"%/"%/ÇË×ìðüìðüìðü†‰”…ˆ“ìðüìðüìðüÇË×"%/"%/ÇË×ìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ.0;ÒÖâìðüšž©¦©µìðüìðüìðüCEPILVìðüìðüìðü��›ADNtw‚58BÚÞêìðüìðüìðü‚…�‚…�ìðüìðüìðüìðüÏÒÞ áåðìðüìðüìðüìðüìðüáåð *-7ìðüìðüìðüìðüìðüìðü*-7*-7ìðüìðüìðüìðüìðüìðü*-7}€‹ìðüìðüìðüìðü_bl_blìðüìðüìðüìðü}€‹ áåðìðüìðüìðüìðüìðüÔØä}€‹ìðüìðüìðüìðü_blÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðüÙÜè`bm  `bmÙÜèìðüìðüìðüØÛç''×ÛæìðüìðüìðüÙÜè`bm  `bmÙÜèìðüìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ…ˆ“ìðüìðüìðü¨«·@CMADN¨«·ìðüìðüìðüÞâî!ìðüìðüìðüìðü`bm_blìðüìðüëïû$&1ehsìðüìðüìðüìðü®²½GJTFIT®²½ìðüìðüìðüìðüìðüÏÒÞˆ‹—ìðüìðüìðüìðüìðü‡‹–½ÀÌìðüìðüìðüìðü½À̽ÀÌìðüìðüìðüìðü½ÀÌ_blìðüìðüìðüìðü}€‹}€‹ìðüìðüìðüìðü_blˆ‹—ìðüìðüìðüìðüìðü{~‰_blìðüìðüìðüìðü}€‹ÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðüìðüìðüëïûÑÕáìðüìðüìðüìðüìðüìðüQT_QT_ìðüìðüìðüìðüìðüëïûÑÕáìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞfitìðüìðüìðüìðüìðüâæòÒÖâåéõìðüìðüìðüìðüìðüloz‘• ìðüìðüìðüìðüÞâîÛßëìðüìðüìðüìðüOQ\—š¥ìðüìðüìðüìðüìðüåéõÐÔàäèôìðüìðüìðüìðüìðüìðüìðüÏÒÞ/1<ìðüìðüìðüìðüìðü/1<tv�ìðüìðüìðüìðütv�tv�ìðüìðüìðüìðütv�ADNìðüìðüìðüìðüšž©šž©ìðüìðüìðüìðüADN/1<ìðüìðüìðüìðüìðü!#-ADNìðüìðüìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BLÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü]`k]`kìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ��›ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü�’�"ÇÊÖìðüìðüìðüìðüìðüìðüìðüìðüÈÌØ—š¥ìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞìðüìðüÏÒÞ¬°»ìðüìðüìðü«¯º*-7ìðüìðüìðüìðü*-7*-7ìðüìðüìðüìðü*-7½ÀÌìðüìðüìðü¸¼Ç¸¼Çìðüìðüìðü½À̬°»ìðüìðüìðüœŸ«½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌÏÒÞìðüìðüìðüÀÄÏY\g[^iìðüìðüìðü[^iY\gÀÄÏìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ<>I¹½Èìðüìðüìðüìðüìðüìðüìðü¹½È;=H<>I¹½Èìðüìðüìðüìðüìðüìðüìðü¹½È;=HÏÒÞìðüìðüÏÒÞ½ÀÌìðüìðü½ÀÌlozÞâîìðüìðüìðüìðüìðüìðüìðüàäðloz%'2¶ºÅìðüìðüìðüìðüìðüìðü´·Ã%'2dgrÚÞêìðüìðüìðüìðüìðüìðüìðüÚÞêehs½ÀÌìðüìðü½ÀÌSV`ìðüìðüìðüSV`½ÀÌìðüìðü½À̽ÀÌìðüìðü½À̽ÀÌìðüìðüÖÚå$&1$&1ÖÚåìðüìðü½À̾ÁÍìðüìðüìðüNP[½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½À̽ÀÌìðüìðüìðüìðüìðü‰Œ—[^iìðüìðüìðü[^i‰Œ—ìðüìðüìðüìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞOQ\�“ž¼¿ËÏÒÞ»¾Ê�’�OQ\OQ\�“ž¼¿ËÏÒÞ»¾Ê�’�OQ\ÏÒÞìðüìðüÏÒÞ?BL½À̽ÀÌ?BLbep›ŸªÀÄÏËÏÚ¾ÂΛŸªbepX[f¢¥°ÈÌØÈÌØ¢¦±[^i^ak—š¥¾ÁÍÏÒÞ¾ÂΘ›¦^ak?BL½À̽ÀÌ?BL‰Œ—ÏÒÞ‰Œ—?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BLBDOìðüìðüìðü¾ÂÎ?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BL?BL¿ÃÏìðüìðüìðüìðüÏÒÞ[^iìðüìðüìðü[^iÏÒÞìðüìðüìðüìðü¿ÃÏ?BLÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ›ŸªìðüìðüìðüdgrX[f¿ÃÏìðüìðü‰Œ—[^iìðüìðüìðü[^i‰Œ—ìðüìðü¿ÃÏX[fÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ ",ìðüìðüìðüßãï + NP[NP[[^iìðüìðüìðü[^iNP[NP[ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞz}ˆìðüìðüìðü†‰”[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÓ×ãìðüìðüìðü,/9%'2âæòìðüâæò%'2ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞX[fìðüìðüìðü¨«·%'2[^i%'2ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ²µÁìðüìðüìðüNP[ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ69CìðüìðüìðüÉÍÙÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ�”Ÿìðüìðüìðüor}ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüêîú"‰Œ—ìðüìðü‰Œ—‰Œ—ìðüìðü‰Œ—‰Œ—ìðüìðü‰Œ—NP[NP[NP[NP[NP[NP[ \ No newline at end of file diff --git a/evidence/allen-omega-L694/L758/font.log b/evidence/allen-omega-L694/L758/font.log new file mode 100644 index 00000000..1f885320 --- /dev/null +++ b/evidence/allen-omega-L694/L758/font.log @@ -0,0 +1,421 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 +183 0 +184 0 +185 0 +186 0 +187 0 +188 0 +189 0 +190 0 +191 0 +192 0 +193 0 +194 0 +195 0 +196 0 +197 0 +198 0 +199 0 +200 0 +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 +225 0 +226 0 +227 0 +228 0 +229 0 +230 0 +231 0 +232 0 +233 0 +234 0 +235 0 +236 0 +237 0 +238 0 +239 0 +240 0 +241 0 +242 0 +243 0 +244 0 +245 0 +246 0 +247 0 +248 0 +249 0 +250 0 +251 0 +252 0 +253 0 +254 0 +255 0 +256 0 +257 0 +258 0 +259 0 +260 0 +261 0 +262 0 +263 0 +264 0 +265 0 +266 0 +267 0 +268 0 +269 0 +270 0 +271 0 +272 0 +273 0 +274 0 +275 0 +276 0 +277 0 +278 0 +279 0 +280 0 +281 0 +282 0 +283 0 +284 0 +285 0 +286 0 +287 0 +288 0 +289 0 +290 0 +291 0 +292 0 +293 0 +294 0 +295 0 +296 0 +297 0 +298 0 +299 0 +300 0 +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 0 +310 0 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +361 0 +362 0 +363 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 0 +380 0 +381 0 +382 0 +383 0 +384 0 +385 0 +386 0 +387 0 +388 0 +389 0 +390 0 +391 0 +392 0 +393 0 +394 0 +395 0 +396 0 +397 0 +398 0 +399 0 +400 0 +401 0 +402 0 +403 0 +404 0 +405 0 +406 0 +407 0 +408 0 +409 0 +410 0 +411 0 +412 0 +413 0 +414 0 +415 0 +416 0 +417 0 +418 0 +419 0 +420 0 +421 0 diff --git a/evidence/allen-omega-L694/L758/fontalpha-mutant.log b/evidence/allen-omega-L694/L758/fontalpha-mutant.log new file mode 100644 index 00000000..4dba5479 --- /dev/null +++ b/evidence/allen-omega-L694/L758/fontalpha-mutant.log @@ -0,0 +1,421 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 +183 0 +184 0 +185 0 +186 0 +187 0 +188 0 +189 0 +190 0 +191 0 +192 0 +193 0 +194 0 +195 0 +196 0 +197 0 +198 0 +199 0 +200 0 +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 +225 0 +226 0 +227 0 +228 0 +229 0 +230 0 +231 0 +232 0 +233 0 +234 0 +235 0 +236 0 +237 0 +238 0 +239 0 +240 0 +241 0 +242 0 +243 0 +244 0 +245 0 +246 0 +247 0 +248 0 +249 0 +250 0 +251 0 +252 0 +253 0 +254 0 +255 0 +256 0 +257 0 +258 0 +259 0 +260 0 +261 0 +262 0 +263 0 +264 0 +265 0 +266 0 +267 0 +268 0 +269 0 +270 0 +271 0 +272 0 +273 0 +274 0 +275 0 +276 0 +277 0 +278 0 +279 0 +280 0 +281 0 +282 0 +283 0 +284 0 +285 0 +286 0 +287 0 +288 0 +289 0 +290 0 +291 0 +292 0 +293 0 +294 0 +295 0 +296 0 +297 0 +298 0 +299 0 +300 0 +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 0 +310 0 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +361 0 +362 0 +363 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 0 +380 0 +381 0 +382 0 +383 0 +384 0 +385 0 +386 0 +387 0 +388 0 +389 0 +390 0 +391 0 +392 0 +393 0 +394 0 +395 0 +396 0 +397 0 +398 0 +399 0 +400 0 +401 0 +402 0 +403 0 +404 0 +405 0 +406 0 +407 0 +408 0 +409 0 +410 0 +411 0 +412 0 +413 1 +414 0 +415 0 +416 0 +417 0 +418 0 +419 1 +420 0 +421 0 diff --git a/evidence/allen-omega-L694/L758/fontroot-mutant.log b/evidence/allen-omega-L694/L758/fontroot-mutant.log new file mode 100644 index 00000000..326cd397 --- /dev/null +++ b/evidence/allen-omega-L694/L758/fontroot-mutant.log @@ -0,0 +1,421 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 1 +11 1 +12 1 +13 1 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 +183 0 +184 0 +185 0 +186 0 +187 0 +188 0 +189 0 +190 0 +191 0 +192 0 +193 0 +194 0 +195 0 +196 0 +197 0 +198 0 +199 0 +200 0 +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 +225 0 +226 0 +227 0 +228 0 +229 0 +230 0 +231 0 +232 0 +233 0 +234 0 +235 0 +236 0 +237 0 +238 0 +239 0 +240 0 +241 0 +242 0 +243 0 +244 0 +245 0 +246 0 +247 0 +248 0 +249 0 +250 0 +251 0 +252 0 +253 0 +254 0 +255 0 +256 0 +257 0 +258 0 +259 0 +260 0 +261 0 +262 0 +263 0 +264 0 +265 0 +266 0 +267 0 +268 0 +269 0 +270 0 +271 0 +272 0 +273 0 +274 0 +275 0 +276 0 +277 0 +278 0 +279 0 +280 0 +281 0 +282 0 +283 0 +284 0 +285 0 +286 0 +287 0 +288 0 +289 0 +290 0 +291 0 +292 0 +293 0 +294 0 +295 0 +296 0 +297 0 +298 0 +299 0 +300 0 +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 0 +310 0 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +361 0 +362 0 +363 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 0 +380 0 +381 0 +382 0 +383 0 +384 0 +385 0 +386 0 +387 0 +388 0 +389 0 +390 0 +391 0 +392 0 +393 0 +394 0 +395 0 +396 0 +397 0 +398 0 +399 0 +400 0 +401 0 +402 0 +403 0 +404 0 +405 0 +406 0 +407 0 +408 0 +409 0 +410 0 +411 0 +412 0 +413 0 +414 1 +415 1 +416 1 +417 1 +418 1 +419 0 +420 1 +421 1 diff --git a/evidence/allen-omega-L694/L758/framecheck-mutant.log b/evidence/allen-omega-L694/L758/framecheck-mutant.log new file mode 100644 index 00000000..d5454577 --- /dev/null +++ b/evidence/allen-omega-L694/L758/framecheck-mutant.log @@ -0,0 +1,100 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 1 +7 1 +8 1 +9 1 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 diff --git a/evidence/allen-omega-L694/L758/full.exit b/evidence/allen-omega-L694/L758/full.exit new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/L758/full.exit @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/L758/full.log b/evidence/allen-omega-L694/L758/full.log new file mode 100644 index 00000000..ddd49563 --- /dev/null +++ b/evidence/allen-omega-L694/L758/full.log @@ -0,0 +1,52 @@ +runtime compile=0 native-exit=0 +code compile=0 native-exit=0 +courier compile=0 native-exit=0 +scheduler compile=0 native-exit=0 +application compile=0 native-exit=0 +provider-core compile=0 native-exit=0 +presentation compile=0 native-exit=0 +font compile=0 native-exit=0 +memory compile=0 native-exit=0 +context compile=0 native-exit=0 +intent compile=0 native-exit=0 +reply compile=0 native-exit=0 +view compile=0 native-exit=0 +scene compile=0 native-exit=0 +scene-input compile=0 native-exit=0 +paint compile=0 native-exit=0 +edges compile=0 native-exit=0 +fixture compile=0 native-exit=0 +golden compile=0 native-exit=0 +render compile=0 native-exit=0 +font-output compile=0 native-exit=0 +font-render compile=0 native-exit=0 +font native masks match frozen external legacy oracle +stdio native-exit=0 golden-cmp=0 +stdio overflow native-exit=65 no-later-command=PASS +provider malformed mode=1 exit=65 no-later-command=PASS +provider malformed mode=2 exit=65 no-later-command=PASS +provider malformed mode=3 exit=65 no-later-command=PASS +provider malformed mode=4 exit=65 no-later-command=PASS +provider malformed mode=5 exit=65 no-later-command=PASS +provider malformed mode=6 exit=65 no-later-command=PASS +provider native-exit=0 fragmented-pipe=0 output-verifier=0 +stale mutant compile=0 rejected-exit=3 +crc mutant compile=0 rejected-exit=2 +hash mutant compile=0 rejected-exit=2 +readback mutant compile=0 rejected-exit=7 +session mutant compile=0 rejected-exit=1 +keepalive mutant compile=0 rejected-exit=40 +ackstop mutant compile=0 rejected-exit=27 +pendingwire mutant compile=0 rejected-exit=1 +appcode mutant compile=0 rejected-exit=3 +thinking mutant compile=0 rejected-exit=6 +scenecap mutant compile=0 rejected-exit=3 +contextnote mutant compile=0 rejected-exit=5 +contextjob mutant compile=0 rejected-exit=36 +autosent mutant compile=0 rejected-exit=1 +framecheck mutant compile=0 rejected-exit=1 +staleview mutant compile=0 rejected-exit=1 +inputtail mutant compile=0 rejected-exit=1 +fontroot mutant compile=0 rejected-exit=1 +fontalpha mutant compile=0 rejected-exit=1 +ALLEN_OMEGA_HOST: PASS; target=NOT_RUN; live=NOT_RUN diff --git a/evidence/allen-omega-L694/L758/green2.exit b/evidence/allen-omega-L694/L758/green2.exit new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/L758/green2.exit @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/L758/green2.log b/evidence/allen-omega-L694/L758/green2.log new file mode 100644 index 00000000..5e5ba97d --- /dev/null +++ b/evidence/allen-omega-L694/L758/green2.log @@ -0,0 +1,412 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 +183 0 +184 0 +185 0 +186 0 +187 0 +188 0 +189 0 +190 0 +191 0 +192 0 +193 0 +194 0 +195 0 +196 0 +197 0 +198 0 +199 0 +200 0 +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 +225 0 +226 0 +227 0 +228 0 +229 0 +230 0 +231 0 +232 0 +233 0 +234 0 +235 0 +236 0 +237 0 +238 0 +239 0 +240 0 +241 0 +242 0 +243 0 +244 0 +245 0 +246 0 +247 0 +248 0 +249 0 +250 0 +251 0 +252 0 +253 0 +254 0 +255 0 +256 0 +257 0 +258 0 +259 0 +260 0 +261 0 +262 0 +263 0 +264 0 +265 0 +266 0 +267 0 +268 0 +269 0 +270 0 +271 0 +272 0 +273 0 +274 0 +275 0 +276 0 +277 0 +278 0 +279 0 +280 0 +281 0 +282 0 +283 0 +284 0 +285 0 +286 0 +287 0 +288 0 +289 0 +290 0 +291 0 +292 0 +293 0 +294 0 +295 0 +296 0 +297 0 +298 0 +299 0 +300 0 +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 0 +310 0 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +361 0 +362 0 +363 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 0 +380 0 +381 0 +382 0 +383 0 +384 0 +385 0 +386 0 +387 0 +388 0 +389 0 +390 0 +391 0 +392 0 +393 0 +394 0 +395 0 +396 0 +397 0 +398 0 +399 0 +400 0 +401 0 +402 0 +403 0 +404 0 +405 0 +406 0 +407 0 +408 0 +409 0 +410 0 +411 0 +412 0 diff --git a/evidence/allen-omega-L694/L758/hash-mutant.log b/evidence/allen-omega-L694/L758/hash-mutant.log new file mode 100644 index 00000000..c75cfefb --- /dev/null +++ b/evidence/allen-omega-L694/L758/hash-mutant.log @@ -0,0 +1,79 @@ +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 1 +310 1 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +362 0 +363 0 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 0 +361 0 diff --git a/evidence/allen-omega-L694/L758/independent-review/inventory.json b/evidence/allen-omega-L694/L758/independent-review/inventory.json new file mode 100644 index 00000000..edc31098 --- /dev/null +++ b/evidence/allen-omega-L694/L758/independent-review/inventory.json @@ -0,0 +1,27 @@ +{ + "parent-boundary.log": "f1213f3c6bc539ee37f85581502cf6e52cc7236ac3604b924992150e13724901", + "parent-verification.json": "8a8c6fc627ecd5135d4c386a0c8f01020fc77c8c3e535f612767ac4594fce33f", + "probes/font-boundary.om": "d59c6611798c7fd922c51be697b72c92c9b47d41cf194ed59c0421184433851c", + "receipt-disposition.md": "5d123ee877c380b3b921b3f7b924056804aa4aed207da92335241b629ac9558d", + "receipts/boundary-build.log": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "receipts/boundary-build2.log": "d94b9498f6a6c50ebc8c0a393344f85412452d873468eea2670fd1f73da86c8a", + "receipts/boundary-final-build.log": "1862f1fb98c86018fe59b2da091eee9d110aa2d85e106da84a88438ccbd8cc58", + "receipts/boundary-final.log": "94b5eb52e78020afab303c6b05ee13afd04e1d2159c6a2c1455c8c1149f5c380", + "receipts/boundary-final.sha256": "a9f7f67c5dc83d5e9eed6f5725fe9ea8c3a93c9a0dbac28eecdf07a396190b3a", + "receipts/boundary-final2-build.log": "54253cb7aaac6f4a0b2838c320412227e71e501f44a83d5656347d247908925c", + "receipts/boundary-verified-build.log": "54253cb7aaac6f4a0b2838c320412227e71e501f44a83d5656347d247908925c", + "receipts/boundary.log": "94b5eb52e78020afab303c6b05ee13afd04e1d2159c6a2c1455c8c1149f5c380", + "receipts/boundary.sha256": "c9e6e1e5ade70e701259790679eff88fe8ee94f3dc697b741d4374c53590107d", + "receipts/closure.log": "9f3d4ebee0f50d33b4b77994279aa6ec9704f878dec6eefe1acdf9c49bf66aa1", + "receipts/failure-and-receipt-hashes.sha256": "f7eb35d3abf8eb67b761c39aa5974d8874e43f8dd37fb18d60ed1a13d136653d", + "receipts/focused-build.log": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "receipts/focused-font.log": "1717fc2d53d03151502581b646ecfe8a8f55620641d4d99bc46c28a4eb7842b5", + "receipts/focused-font.om": "ac3f9e5eee125754df0d97822e10f050ff0a25cd41a5f528e590081e25422789", + "receipts/focused.sha256": "1055393d4b2fef379e486371f39f7d4cb364c2205666d4ce03a25451a19b7b53", + "receipts/font-boundary-final.om": "cc9b844bf8cdf7e238c8f0a8af0d3024573e94972e66748eca6b8c34d1a6e30c", + "receipts/font-boundary-final2.om": "cc9b844bf8cdf7e238c8f0a8af0d3024573e94972e66748eca6b8c34d1a6e30c", + "receipts/font-boundary-verified.om": "23aec065f06644635f4a6fdab451e1845212905a0a3bddf881e3f34c42bf1135", + "receipts/font-boundary.om": "5eb8bcd09b12d8787b16352458a579d8f0ff832b6084b7f2e18c62f3680898bf", + "receipts/font-core.om": "90ad35ebb9d78c71bcce41fcd9b005e060f7b417ad9d4894a464b4cf1e0b57b1", + "report.md": "d28a44e2141507a8a7151ab2ea4d6b3b117ca61b6b33bb786b213e082f20a637" +} diff --git a/evidence/allen-omega-L694/L758/independent-review/parent-boundary.log b/evidence/allen-omega-L694/L758/independent-review/parent-boundary.log new file mode 100644 index 00000000..4b5a2436 --- /dev/null +++ b/evidence/allen-omega-L694/L758/independent-review/parent-boundary.log @@ -0,0 +1,308 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 +183 0 +184 0 +185 0 +186 0 +187 0 +188 0 +189 0 +190 0 +191 0 +192 0 +193 0 +194 0 +195 0 +196 0 +197 0 +198 0 +199 0 +200 0 +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 +225 0 +226 0 +227 0 +228 0 +229 0 +230 0 +231 0 +232 0 +233 0 +234 0 +235 0 +236 0 +237 0 +238 0 +239 0 +240 0 +241 0 +242 0 +243 0 +244 0 +245 0 +246 0 +247 0 +248 0 +249 0 +250 0 +251 0 +252 0 +253 0 +254 0 +255 0 +256 0 +257 0 +258 0 +259 0 +260 0 +261 0 +262 0 +263 0 +264 0 +265 0 +266 0 +267 0 +268 0 +269 0 +270 0 +271 0 +272 0 +273 0 +274 0 +275 0 +276 0 +277 0 +278 0 +279 0 +280 0 +281 0 +282 0 +283 0 +284 0 +285 0 +286 0 +287 0 +288 0 +289 0 +290 0 +291 0 +292 0 +293 0 +294 0 +295 0 +296 0 +297 0 +298 0 +299 0 +300 0 +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 diff --git a/evidence/allen-omega-L694/L758/independent-review/parent-verification.json b/evidence/allen-omega-L694/L758/independent-review/parent-verification.json new file mode 100644 index 00000000..30fcedf7 --- /dev/null +++ b/evidence/allen-omega-L694/L758/independent-review/parent-verification.json @@ -0,0 +1,12 @@ +{ + "pin": "61ef587ee5d24bf862705f51bffb8039c9a2ed01", + "declared_source_files": 26, + "baseline_checks": 421, + "independent_checks": 308, + "parent_replay_checks": 308, + "parent_binary_sha256": "4fb63b921aac869ce370b03365b609fe24a3ea7fecb2903924b8303d167e500c", + "source_concat_sha256": "5eb8bcd09b12d8787b16352458a579d8f0ff832b6084b7f2e18c62f3680898bf", + "report_sha256": "d28a44e2141507a8a7151ab2ea4d6b3b117ca61b6b33bb786b213e082f20a637", + "findings": "none in scoped font component", + "scope": "native host only" +} diff --git a/evidence/allen-omega-L694/L758/independent-review/probes/font-boundary.om b/evidence/allen-omega-L694/L758/independent-review/probes/font-boundary.om new file mode 100644 index 00000000..f8735daa --- /dev/null +++ b/evidence/allen-omega-L694/L758/independent-review/probes/font-boundary.om @@ -0,0 +1,61 @@ +note Independent L762 boundary probe; handwritten Omega assertions. +global SnapAf ulong 6 +global SnapAb long 4 +fn probe ok bool to void +check ok add get Checks 0 1 +end +fn main to int +probe not afinit 0 1 +probe not afinit 65 2500 +probe not afinit 1 0 +probe not afinit 1 2501 +probe afinit 1 1 +probe eq get Af 0 12 +probe eq get Af 1 0 +probe afglyph 32 +probe eq get Af 3 0 +probe eq get Af 4 1 +probe afinit 64 2500 +probe eq get Af 0 819 +probe eq get Af 1 2047 +for c ulong 95 +probe afglyph uchar add c 32 +probe le mul get Af 3 get Af 4 65536 +probe le get Af 2 160 +end +probe afglyph 63 +for i ulong 6 +put SnapAf i get Af i +end +for i ulong 4 +put SnapAb i get Ab i +end +put Alpha 0 77 +probe not afinit 0 2500 +same = true +for i ulong 6 +if ne get Af i get SnapAf i +same = false +end +end +for i ulong 4 +if ne get Ab i get SnapAb i +same = false +end +end +if ne get Alpha 0 77 +same = false +end +probe same +probe afglyph 0 +probe afglyph 63 +probe eq get Af 3 get SnapAf 3 +probe afglyph 127 +probe eq get Af 3 get SnapAf 3 +probe afglyph 255 +probe eq get Af 3 get SnapAf 3 +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L758/independent-review/receipt-disposition.md b/evidence/allen-omega-L694/L758/independent-review/receipt-disposition.md new file mode 100644 index 00000000..2dbf6bae --- /dev/null +++ b/evidence/allen-omega-L694/L758/independent-review/receipt-disposition.md @@ -0,0 +1,12 @@ +The canonical boundary.sha256 matches the final standalone probe, +receipts/font-boundary.om, font-boundary3.elf and308-row boundary.log. Parent +reconstructed that exact source closure from61ef587 Git objects, rebuilt a +byte-identical executable and reproduced all308 passing rows. focused.sha256 +and failure-and-receipt-hashes.sha256 also match their original artifacts. + +The separately named boundary-final.sha256 is a stale developmental receipt: +font-boundary-final.om was subsequently overwritten by a failed oversized-scratch +probe variant, so that one source hash no longer matches. This variant and its +original manifest are retained, not accepted as current qualification. The +canonical boundary.sha256 and parent replay above are the accepted evidence. +No product correction or gate relaxation was required. Original report retained. diff --git a/evidence/allen-omega-L694/L758/independent-review/receipts/boundary-build.log b/evidence/allen-omega-L694/L758/independent-review/receipts/boundary-build.log new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L758/independent-review/receipts/boundary-build2.log b/evidence/allen-omega-L694/L758/independent-review/receipts/boundary-build2.log new file mode 100644 index 00000000..71a3984b --- /dev/null +++ b/evidence/allen-omega-L694/L758/independent-review/receipts/boundary-build2.log @@ -0,0 +1 @@ +omc: line 4151: error 3 diff --git a/evidence/allen-omega-L694/L758/independent-review/receipts/boundary-final-build.log b/evidence/allen-omega-L694/L758/independent-review/receipts/boundary-final-build.log new file mode 100644 index 00000000..555ceb80 --- /dev/null +++ b/evidence/allen-omega-L694/L758/independent-review/receipts/boundary-final-build.log @@ -0,0 +1 @@ +fresh output required diff --git a/evidence/allen-omega-L694/L758/independent-review/receipts/boundary-final.log b/evidence/allen-omega-L694/L758/independent-review/receipts/boundary-final.log new file mode 100644 index 00000000..83fc6994 --- /dev/null +++ b/evidence/allen-omega-L694/L758/independent-review/receipts/boundary-final.log @@ -0,0 +1,309 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 +183 0 +184 0 +185 0 +186 0 +187 0 +188 0 +189 0 +190 0 +191 0 +192 0 +193 0 +194 0 +195 0 +196 0 +197 0 +198 0 +199 0 +200 0 +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 +225 0 +226 0 +227 0 +228 0 +229 0 +230 0 +231 0 +232 0 +233 0 +234 0 +235 0 +236 0 +237 0 +238 0 +239 0 +240 0 +241 0 +242 0 +243 0 +244 0 +245 0 +246 0 +247 0 +248 0 +249 0 +250 0 +251 0 +252 0 +253 0 +254 0 +255 0 +256 0 +257 0 +258 0 +259 0 +260 0 +261 0 +262 0 +263 0 +264 0 +265 0 +266 0 +267 0 +268 0 +269 0 +270 0 +271 0 +272 0 +273 0 +274 0 +275 0 +276 0 +277 0 +278 0 +279 0 +280 0 +281 0 +282 0 +283 0 +284 0 +285 0 +286 0 +287 0 +288 0 +289 0 +290 0 +291 0 +292 0 +293 0 +294 0 +295 0 +296 0 +297 0 +298 0 +299 0 +300 0 +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +exit=0 diff --git a/evidence/allen-omega-L694/L758/independent-review/receipts/boundary-final.sha256 b/evidence/allen-omega-L694/L758/independent-review/receipts/boundary-final.sha256 new file mode 100644 index 00000000..26fdbcba --- /dev/null +++ b/evidence/allen-omega-L694/L758/independent-review/receipts/boundary-final.sha256 @@ -0,0 +1,4 @@ +d59c6611798c7fd922c51be697b72c92c9b47d41cf194ed59c0421184433851c /home/drakestapleton/handoffs/L762-review/probes/font-boundary.om +5eb8bcd09b12d8787b16352458a579d8f0ff832b6084b7f2e18c62f3680898bf /home/drakestapleton/handoffs/L762-review/receipts/font-boundary-final.om +4fb63b921aac869ce370b03365b609fe24a3ea7fecb2903924b8303d167e500c /home/drakestapleton/handoffs/L762-review/receipts/font-boundary-final.elf +94b5eb52e78020afab303c6b05ee13afd04e1d2159c6a2c1455c8c1149f5c380 /home/drakestapleton/handoffs/L762-review/receipts/boundary-final.log diff --git a/evidence/allen-omega-L694/L758/independent-review/receipts/boundary-final2-build.log b/evidence/allen-omega-L694/L758/independent-review/receipts/boundary-final2-build.log new file mode 100644 index 00000000..a5699089 --- /dev/null +++ b/evidence/allen-omega-L694/L758/independent-review/receipts/boundary-final2-build.log @@ -0,0 +1 @@ +omc: line 4167: error 13 diff --git a/evidence/allen-omega-L694/L758/independent-review/receipts/boundary-verified-build.log b/evidence/allen-omega-L694/L758/independent-review/receipts/boundary-verified-build.log new file mode 100644 index 00000000..a5699089 --- /dev/null +++ b/evidence/allen-omega-L694/L758/independent-review/receipts/boundary-verified-build.log @@ -0,0 +1 @@ +omc: line 4167: error 13 diff --git a/evidence/allen-omega-L694/L758/independent-review/receipts/boundary.log b/evidence/allen-omega-L694/L758/independent-review/receipts/boundary.log new file mode 100644 index 00000000..83fc6994 --- /dev/null +++ b/evidence/allen-omega-L694/L758/independent-review/receipts/boundary.log @@ -0,0 +1,309 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 +183 0 +184 0 +185 0 +186 0 +187 0 +188 0 +189 0 +190 0 +191 0 +192 0 +193 0 +194 0 +195 0 +196 0 +197 0 +198 0 +199 0 +200 0 +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 +225 0 +226 0 +227 0 +228 0 +229 0 +230 0 +231 0 +232 0 +233 0 +234 0 +235 0 +236 0 +237 0 +238 0 +239 0 +240 0 +241 0 +242 0 +243 0 +244 0 +245 0 +246 0 +247 0 +248 0 +249 0 +250 0 +251 0 +252 0 +253 0 +254 0 +255 0 +256 0 +257 0 +258 0 +259 0 +260 0 +261 0 +262 0 +263 0 +264 0 +265 0 +266 0 +267 0 +268 0 +269 0 +270 0 +271 0 +272 0 +273 0 +274 0 +275 0 +276 0 +277 0 +278 0 +279 0 +280 0 +281 0 +282 0 +283 0 +284 0 +285 0 +286 0 +287 0 +288 0 +289 0 +290 0 +291 0 +292 0 +293 0 +294 0 +295 0 +296 0 +297 0 +298 0 +299 0 +300 0 +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +exit=0 diff --git a/evidence/allen-omega-L694/L758/independent-review/receipts/boundary.sha256 b/evidence/allen-omega-L694/L758/independent-review/receipts/boundary.sha256 new file mode 100644 index 00000000..86d0ce74 --- /dev/null +++ b/evidence/allen-omega-L694/L758/independent-review/receipts/boundary.sha256 @@ -0,0 +1,4 @@ +d59c6611798c7fd922c51be697b72c92c9b47d41cf194ed59c0421184433851c /home/drakestapleton/handoffs/L762-review/probes/font-boundary.om +5eb8bcd09b12d8787b16352458a579d8f0ff832b6084b7f2e18c62f3680898bf /home/drakestapleton/handoffs/L762-review/receipts/font-boundary.om +4fb63b921aac869ce370b03365b609fe24a3ea7fecb2903924b8303d167e500c /home/drakestapleton/handoffs/L762-review/receipts/font-boundary3.elf +94b5eb52e78020afab303c6b05ee13afd04e1d2159c6a2c1455c8c1149f5c380 /home/drakestapleton/handoffs/L762-review/receipts/boundary.log diff --git a/evidence/allen-omega-L694/L758/independent-review/receipts/closure.log b/evidence/allen-omega-L694/L758/independent-review/receipts/closure.log new file mode 100644 index 00000000..2af6a150 --- /dev/null +++ b/evidence/allen-omega-L694/L758/independent-review/receipts/closure.log @@ -0,0 +1,36 @@ +184f4270c72c4eca6a7afdd28b70a608f2e237980b12c8a7bfc2c7d2c3e625b9 native/omega/allen/base.om +992ec4a4957271b442740598136887a5c610effcd8ae9fb9480a006a4f181097 native/omega/allen/vendor/sha256-core.om +5b01eae03204d08f6d207ef29f2ba09a1d9f249f1738f68f151214675a4ff2ed native/omega/allen/runtime.om +4d2235ac5d6b237695b1c3112f70ebdfa0cebafa2ec8e691e4be4de37a62199b native/omega/allen/code.om +76ee9cdeaac036905c76dfa29f42bf5a78d1259ad1656adfaa24916c3b93550d native/omega/allen/courier.om +615dff78462a715153b3d891b2cfe146c318d3a0a26ae1aaa642484f965c12df native/omega/allen/scheduler.om +068292abd04d3a61b063fc5380b22a56c4235a87915c219ebf3b37d16d7bc9c7 native/omega/allen/memory.om +06087bc573ebb876a0ed80f6025c592fb4b1d23335169c3da402824fd1482c35 native/omega/allen/intent.om +e50a7f673aaee92aba4a3aec303aa93b071121c09ad05d4ad1dcc2deb9706dcc native/omega/allen/reply.om +abbefd2f7dc48f2ac28b9526f5c2e5b369da4b7c5e84dde6e6a3cd20bd5687ac native/omega/allen/view.om +c8d4a437b41538cc1eeb62a2029c6993d41e5ef90cc7b26c8e1c92bc98ec57d3 native/omega/allen/scene.om +b4d7b6e6cd680d2ba1eec2978b0cbb81ffc63035b73f5c3726bdad97a7b6aa04 native/omega/allen/paint.om +56936108de0087499bb62a117a275f27b01d7bfb05eb8f6250f13ab8783e1095 native/omega/allen/application.om +c16d61dbcb81f7ef8196c937929a53e47de3de0015e5d663bcd8e49b3cb05002 native/omega/allen/scene-input.om +75e86e193346a5548e596c84fa7d65aaeefd69f9979a648e0bf53f0f97cd9eb4 native/omega/allen/context.om +330b31b81a60f3dc553b87316d2fa1c3df9106af5fe7975911ba00b8c356f626 native/omega/allen/provider-core.om +d3e3004fb587f75514c638b8b723c996303f664a74b653a6fc674f4600288d41 native/omega/allen/presentation.om +f8c559b449c81159172d3e08f185e1fcd9ac446ab594420d07221ca68ffa87d5 native/omega/allen/font-data.om +c62f5a799b601315e61b05283295810a084d1adcc06b5bddc34010f3b344b915 native/omega/allen/font.om +f085198549d1c235a97574ff6f6560ce82217611f4051fc3dbbc8286aab6d536 native/omega/allen/tests/check.om +cf836ead7ced76a528bd2df1738a2255d9b37b4ab51702d593488bc94726f75a native/omega/allen/tests/font.om +7ef1280488f17ac3001876ca8f1d9a48e202f8fb3305d974e6cd33166458f8eb native/omega/allen/tests/font-output.om +a3e64c2054a9c83daacc8bd86ce5df0395014eb0ac2e237e63ade12dfb1a6bd8 native/omega/allen/tests/font-render.om +b861dbdc9ef3a29157c10500767de69d2a1f5478d0bcdbbfd767bd5d69e587e2 native/omega/allen/gate.sh +795ca28627a19f1088de0f23277e79cdac921ff88451c606c7b655ce0f2e8a5b native/omega/allen/build-one.sh +79e5c778e31f9753553ade367c7de2a5a2521bef7247672cab7498f3ba32d9e6 native/omega/allen/FONT.md +CLOSURE_OK files=26 pin=61ef587ee5d24bf862705f51bffb8039c9a2ed01 worktree=clean +92d7157386e65351325d80d5036565e406145230dfb696c9804ec80888d26904 native/kernel/ui/allen_font.c +0dc4abaa8c8cc1c5a79772bdd00b2d74458beac6ccfe85637069d04c77a7ff69 evidence/allen-omega-L694/L758/legacy-font.bin +8a9adeeace1aa3e577a61c220d5fc66afd0c5959263f18736303432d0b44f6bb evidence/allen-omega-L694/L758/native-font.bin +dec95182af5faa01ed739336ed32dcadd5168e6be35bef310042fe032113ee7f evidence/allen-omega-L694/L758/font-specimen.ppm +e4e6800797c0ab91d415ce1fe5837d57def56b2246e2f9f0762feb3294f08893 evidence/allen-omega-L694/L758/font-specimen.png +191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9 /home/drakestapleton/handoffs/allen-omega-L694/omc + Class: ELF64 + Type: EXEC (Executable file) + Machine: AArch64 diff --git a/evidence/allen-omega-L694/L758/independent-review/receipts/failure-and-receipt-hashes.sha256 b/evidence/allen-omega-L694/L758/independent-review/receipts/failure-and-receipt-hashes.sha256 new file mode 100644 index 00000000..42e92f80 --- /dev/null +++ b/evidence/allen-omega-L694/L758/independent-review/receipts/failure-and-receipt-hashes.sha256 @@ -0,0 +1,5 @@ +9f3d4ebee0f50d33b4b77994279aa6ec9704f878dec6eefe1acdf9c49bf66aa1 /home/drakestapleton/handoffs/L762-review/receipts/closure.log +d94b9498f6a6c50ebc8c0a393344f85412452d873468eea2670fd1f73da86c8a /home/drakestapleton/handoffs/L762-review/receipts/boundary-build2.log +54253cb7aaac6f4a0b2838c320412227e71e501f44a83d5656347d247908925c /home/drakestapleton/handoffs/L762-review/receipts/boundary-final2-build.log +54253cb7aaac6f4a0b2838c320412227e71e501f44a83d5656347d247908925c /home/drakestapleton/handoffs/L762-review/receipts/boundary-verified-build.log +1055393d4b2fef379e486371f39f7d4cb364c2205666d4ce03a25451a19b7b53 /home/drakestapleton/handoffs/L762-review/receipts/focused.sha256 diff --git a/evidence/allen-omega-L694/L758/independent-review/receipts/focused-build.log b/evidence/allen-omega-L694/L758/independent-review/receipts/focused-build.log new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L758/independent-review/receipts/focused-font.log b/evidence/allen-omega-L694/L758/independent-review/receipts/focused-font.log new file mode 100644 index 00000000..fc67b3a8 --- /dev/null +++ b/evidence/allen-omega-L694/L758/independent-review/receipts/focused-font.log @@ -0,0 +1,422 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 +183 0 +184 0 +185 0 +186 0 +187 0 +188 0 +189 0 +190 0 +191 0 +192 0 +193 0 +194 0 +195 0 +196 0 +197 0 +198 0 +199 0 +200 0 +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 +225 0 +226 0 +227 0 +228 0 +229 0 +230 0 +231 0 +232 0 +233 0 +234 0 +235 0 +236 0 +237 0 +238 0 +239 0 +240 0 +241 0 +242 0 +243 0 +244 0 +245 0 +246 0 +247 0 +248 0 +249 0 +250 0 +251 0 +252 0 +253 0 +254 0 +255 0 +256 0 +257 0 +258 0 +259 0 +260 0 +261 0 +262 0 +263 0 +264 0 +265 0 +266 0 +267 0 +268 0 +269 0 +270 0 +271 0 +272 0 +273 0 +274 0 +275 0 +276 0 +277 0 +278 0 +279 0 +280 0 +281 0 +282 0 +283 0 +284 0 +285 0 +286 0 +287 0 +288 0 +289 0 +290 0 +291 0 +292 0 +293 0 +294 0 +295 0 +296 0 +297 0 +298 0 +299 0 +300 0 +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 0 +310 0 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +361 0 +362 0 +363 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 0 +380 0 +381 0 +382 0 +383 0 +384 0 +385 0 +386 0 +387 0 +388 0 +389 0 +390 0 +391 0 +392 0 +393 0 +394 0 +395 0 +396 0 +397 0 +398 0 +399 0 +400 0 +401 0 +402 0 +403 0 +404 0 +405 0 +406 0 +407 0 +408 0 +409 0 +410 0 +411 0 +412 0 +413 0 +414 0 +415 0 +416 0 +417 0 +418 0 +419 0 +420 0 +421 0 +focused_exit=0 diff --git a/evidence/allen-omega-L694/L758/independent-review/receipts/focused-font.om b/evidence/allen-omega-L694/L758/independent-review/receipts/focused-font.om new file mode 100644 index 00000000..62dc06df --- /dev/null +++ b/evidence/allen-omega-L694/L758/independent-review/receipts/focused-font.om @@ -0,0 +1,4277 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +note Stable application presentation; see PRESENTATION.md for scope and ownership. +global Ds ulong 8 +global Dt ulong 64 +global Dtext uchar 2304 +global Dsay ulong 1 +global Dm ulong 3 +global Dcode uchar 32768 +global Dstart ulong 4096 +global Dlen ulong 4096 +global Dline ulong 4096 +global Dview ulong 3 +global Din uchar 8192 +fn dscene to bool +n = get Inlen 0 +for i ulong 8192 +put Din i get In i +end +for i ulong get R 8 +put In i get Answer i +end +put Inlen 0 get R 8 +ok = scdecode +for i ulong 8192 +put In i get Din i +end +put Inlen 0 n +if not ok +ret false +end +for i ulong 8 +put Ds i get Sc i +end +for i ulong 64 +put Dt i get Things i +end +for i ulong 2304 +put Dtext i 0 +end +for i ulong get Sc 4 +put Dtext i get Stext i +end +put Dsay 0 get Sw 3 +put Dm 0 1 +ret true +end +fn dcode to bool +if or le get R 2 1 ne get R 1 0 +ret false +end +if or eq get R 6 0 ne get C 0 get R 0 +ret false +end +if not rows 80 4096 +ret false +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong get C 2 +put Dcode i get Code i +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong get View 0 +put Dstart i get Rowst i +put Dlen i get Rowlen i +put Dline i get Rowline i +end +put Dview 0 get View 0 +put Dview 1 0 +put Dview 2 get C 2 +put Dm 1 1 +ret true +end +fn dpresent to bool +if or eq get A 0 0 ne get A 2 1 +ret false +end +if or gt get R 8 159 gt get Inlen 0 8192 +ret false +end +shown = dscene +coded = dcode +if or shown coded +put Dm 2 get R 0 +ret true +end +ret false +end +fn dask now ulong to bool +if not appask now +ret false +end +b = dpresent +ret true +end +fn drecv now ulong to bool +if not appreceive now +ret false +end +b = dpresent +ret true +end +fn dreset to void +appreset +for i ulong 8 +put Ds i 0 +end +for i ulong 64 +put Dt i 0 +end +for i ulong 2304 +put Dtext i 0 +end +put Dsay 0 0 +for i ulong 3 +put Dm i 0 +put Dview i 0 +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong 8192 +put Din i 0 +end +end +note Declarative Allen glyph designs and integer sine samples, retained from +note native/kernel/ui/allen_font.c at4c7888f. No foreign executable implementation. +text Afdata "w6|w6 M3,0 L3,14 D3,20|w10 M3,0 L3,5 M7,0 L7,5|w15 M6,2 L4,20 M11,2 L9,20 M2,8 L13,8 M1,14 L12,14|w15 A8,5,5,5,-30,-270 A8,15,5,5,270,510 M8,-2 L8,22|w16 A4,4,2,3,0,360 A12,16,2,3,0,360 M13,1 L3,19|w16 M14,20 L5,9 A7,5,3,4,150,400 L3,14 A7,15,4,5,180,60 L13,11|w6 M3,0 L3,5|w9 A10,10,6,12,240,120|w9 A-1,10,6,12,-60,60|w14 M7,2 L7,10 M3,4 L11,8 M11,4 L3,8|w14 M2,12 L12,12 M7,7 L7,17|w6 M3,19 L2,23|w11 M2,13 L9,13|w6 D3,20|w12 M10,0 L2,20|w14 A7,10,5,10,0,360|w14 M3,4 L8,0 L8,20|w14 A7,6,5,6,200,400 L2,20 L12,20|w14 A7,5,5,5,200,450 A7,15,5,5,270,520|w14 M10,20 L10,0 L1,14 L13,14|w14 M12,0 L4,0 L4,9 A7,14,5,6,235,520|w14 A7,14,5,6,0,360 M10,0 L3,11|w14 M2,0 L12,0 L5,20|w14 A7,5,4,5,0,360 A7,15,5,5,0,360|w14 A7,6,5,6,0,360 M4,20 L11,9|w6 D3,8 D3,20|w6 D3,8 M3,19 L2,23|w14 M12,6 L2,12 L12,18|w14 M2,10 L12,10 M2,15 L12,15|w14 M2,6 L12,12 L2,18|w14 A7,5,5,5,190,450 L7,14 D7,20|w19 A9,12,3,4,0,360 M12,8 L12,14 A14,14,2,2,180,0 A9,11,7,9,0,-300|w16 M2,20 L8,0 L14,20 M4,13 L12,13|w15 M2,0 L2,20 M2,0 L8,0 A8,5,4,5,270,450 L2,10 M2,10 L9,10 A9,15,4,5,270,450 L2,20|w17 A9,10,7,10,45,315|w16 M2,0 L2,20 M2,0 L6,0 A6,10,8,10,270,450 L2,20|w14 M12,0 L2,0 L2,20 L12,20 M2,10 L10,10|w13 M12,0 L2,0 L2,20 M2,10 L10,10|w18 A9,10,7,10,-45,-360 M11,10 L16,10|w16 M2,0 L2,20 M14,0 L14,20 M2,10 L14,10|w6 M3,0 L3,20|w13 M10,0 L10,14 A6,14,4,6,0,180|w15 M2,0 L2,20 M13,0 L2,12 M6,8 L14,20|w13 M2,0 L2,20 L12,20|w20 M2,20 L2,0 L10,14 L18,0 L18,20|w16 M2,20 L2,0 L14,20 L14,0|w20 A10,10,8,10,0,360|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10|w20 A10,10,8,10,0,360 M12,14 L18,21|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10 M8,10 L14,20|w16 A8,5,5,5,-30,-270 A8,15,5,5,270,510|w16 M1,0 L15,0 M8,0 L8,20|w16 M2,0 L2,13 A8,13,6,7,180,0 L14,0|w16 M1,0 L8,20 L15,0|w22 M1,0 L6,20 L11,0 L16,20 L21,0|w16 M2,0 L14,20 M14,0 L2,20|w16 M1,0 L8,10 L15,0 M8,10 L8,20|w16 M2,0 L14,0 L2,20 L14,20|w9 M7,-1 L3,-1 L3,21 L7,21|w12 M2,0 L10,20|w9 M2,-1 L6,-1 L6,21 L2,21|w12 M2,8 L6,1 L10,8|w14 M1,23 L13,23|w7 M2,0 L4,4|w15 A7,14,5,6,0,360 M12,8 L12,20|w15 M2,0 L2,20 A7,14,5,6,0,360|w13 A7,14,5,6,40,320|w15 A7,14,5,6,0,360 M12,0 L12,20|w14 M2,14 L12,14 A7,14,5,6,0,-320|w11 M5,20 L5,4 A9,4,4,4,180,300 M2,8 L10,8|w15 A7,14,5,6,0,360 M12,8 L12,22 A7,22,5,5,0,150|w15 M2,0 L2,20 A7,13,5,5,180,360 L12,20|w6 M3,8 L3,20 D3,3|w7 M4,8 L4,22 A0,22,4,5,0,120 D4,3|w13 M2,0 L2,20 M11,8 L2,15 M5,13 L12,20|w6 M3,0 L3,20|w21 M2,8 L2,20 A6,12,4,4,180,360 L10,20 A14,12,4,4,180,360 L18,20|w15 M2,8 L2,20 A7,13,5,5,180,360 L12,20|w14 A7,14,5,6,0,360|w15 M2,8 L2,27 A7,14,5,6,0,360|w15 A7,14,5,6,0,360 M12,8 L12,27|w10 M2,8 L2,20 A7,13,5,5,180,290|w14 A7,11,4,3,-30,-270 A7,17,4,3,270,510|w11 M5,2 L5,17 A8,17,3,3,180,40 M2,8 L10,8|w15 M2,8 L2,15 A7,15,5,5,180,0 M12,8 L12,20|w14 M2,8 L7,20 L12,8|w20 M2,8 L6,20 L10,8 L14,20 L18,8|w14 M2,8 L12,20 M12,8 L2,20|w14 M2,8 L7,20 M12,8 L4,27|w14 M2,8 L12,8 L2,20 L12,20|w10 M8,-1 L6,0 L6,8 L4,10 L6,12 L6,20 L8,21|w6 M3,-1 L3,23|w10 M2,-1 L4,0 L4,8 L6,10 L4,12 L4,20 L2,21|w14 M2,13 L5,11 L9,14 L12,12|" +text Afsines "0 286 572 857 1143 1428 1713 1997 2280 2563 2845 3126 3406 3686 3964 4240 4516 4790 5063 5334 5604 5872 6138 6402 6664 6924 7182 7438 7692 7943 8192 8438 8682 8923 9162 9397 9630 9860 10087 10311 10531 10749 10963 11174 11381 11585 11786 11982 12176 12365 12551 12733 12911 13085 13255 13421 13583 13741 13894 14044 14189 14330 14466 14598 14726 14849 14968 15082 15191 15296 15396 15491 15582 15668 15749 15826 15897 15964 16026 16083 16135 16182 16225 16262 16294 16322 16344 16362 16374 16382 16384 " +note Handwritten bounded Allen stroke rasterizer. Legacy C is an external oracle only. +global Af ulong 6 +global Ab long 4 +global Ag long 640 +global Alpha uchar 65536 +global Asin long 91 +global Afpos ulong 2 +global Apen long 2 +global Arc long 6 +fn afsqrt value ulong to ulong +r = ulong 0 +bit = shl ulong 1 62 +while gt bit value +bit = shr bit 2 +end +while ne bit 0 +if ge value add r bit +value = sub value add r bit +r = add shr r 1 bit +else +r = shr r 1 +end +bit = shr bit 2 +end +ret r +end +fn afsin deg long to long +a = rem deg 360 +if lt a 0 +a = add a 360 +end +if le a 90 +ret get Asin ulong a +end +if le a 180 +ret get Asin ulong sub long 180 a +end +if le a 270 +ret neg get Asin ulong sub a 180 +end +ret neg get Asin ulong sub long 360 a +end +fn afcos deg long to long +ret afsin add rem deg 360 90 +end +fn afinit cap ulong wt ulong to bool +if or eq cap 0 gt cap 64 +ret false +end +if or eq wt 0 gt wt 2500 +ret false +end +for i ulong 6 +put Af i 0 +end +put Af 0 div mul cap 256 20 +put Af 1 div mul wt get Af 0 1000 +v = long 0 +slot = ulong 0 +for i ulong len Afsines +c = get Afsines i +if eq c 32 +put Asin slot v +slot = add slot 1 +v = 0 +else +v = add mul v 10 sub long c 48 +end +end +ret eq slot 91 +end +fn afpick c uchar to bool +if or lt c 32 gt c 126 +c = 63 +end +wanted = sub ulong c 32 +slot = ulong 0 +startat = ulong 0 +for i ulong len Afdata +if eq get Afdata i 124 +if eq slot wanted +put Afpos 0 startat +put Afpos 1 i +ret true +end +slot = add slot 1 +startat = add i 1 +end +end +ret false +end +fn afnum to long +p = get Afpos 0 +minus = false +if eq get Afdata p 45 +minus = true +p = add p 1 +end +v = long 0 +go = true +while and lt p get Afpos 1 go +c = get Afdata p +if and ge c 48 le c 57 +v = add mul v 10 sub long c 48 +p = add p 1 +else +go = false +end +end +if lt p get Afpos 1 +if eq get Afdata p 44 +p = add p 1 +end +end +put Afpos 0 p +if minus +ret neg v +end +ret v +end +fn afseg nx long ny long to bool +n = get Af 2 +if ge n 160 +ret false +end +at = mul n 4 +put Ag at get Apen 0 +put Ag add at 1 get Apen 1 +put Ag add at 2 nx +put Ag add at 3 ny +put Apen 0 nx +put Apen 1 ny +put Af 2 add n 1 +ret true +end +fn afpoint a long first bool to bool +s = long get Af 0 +x = mul get Arc 0 s +x = add x div mul mul get Arc 2 s afcos a 16384 +y = mul sub get Arc 1 20 s +y = add y div mul mul get Arc 3 s afsin a 16384 +if first +put Apen 0 x +put Apen 1 y +ret true +end +ret afseg x y +end +fn afarc to bool +for i ulong 6 +put Arc i afnum +end +span = sub get Arc 5 get Arc 4 +if lt span 0 +span = neg span +end +steps = div span 9 +if lt steps 2 +steps = 2 +end +for k ulong ulong add steps 1 +a = sub get Arc 5 get Arc 4 +a = add get Arc 4 div mul a long k steps +if not afpoint a eq k 0 +ret false +end +end +ret true +end +fn afcmd cmd uchar to bool +if eq cmd 32 +ret true +end +if eq cmd 119 +put Af 5 mul ulong afnum get Af 0 +ret true +end +if eq cmd 65 +ret afarc +end +x = mul afnum long get Af 0 +y = mul sub afnum 20 long get Af 0 +if or eq cmd 77 eq cmd 68 +put Apen 0 x +put Apen 1 y +end +if eq cmd 77 +ret true +end +if or eq cmd 76 eq cmd 68 +ret afseg x y +end +ret false +end +fn affloor value long to long +if ge value 0 +ret div value 256 +end +ret neg div add neg value 255 256 +end +fn afbound x long y long to void +if lt x get Ab 0 +put Ab 0 x +end +if lt y get Ab 1 +put Ab 1 y +end +if gt x get Ab 2 +put Ab 2 x +end +if gt y get Ab 3 +put Ab 3 y +end +end +fn afbox to bool +put Ab 0 get Ag 0 +put Ab 2 get Ag 0 +put Ab 1 get Ag 1 +put Ab 3 get Ag 1 +for i ulong get Af 2 +at = mul i 4 +afbound get Ag at get Ag add at 1 +afbound get Ag add at 2 get Ag add at 3 +end +pad = add long get Af 1 256 +x0 = affloor sub get Ab 0 pad +y0 = affloor sub get Ab 1 pad +x1 = add affloor add get Ab 2 pad 1 +y1 = add affloor add get Ab 3 pad 1 +put Ab 0 x0 +put Ab 1 y0 +put Af 3 ulong sub x1 x0 +put Af 4 ulong sub y1 y0 +ret le mul get Af 3 get Af 4 len Alpha +end +fn afproj qx long qy long dx long dy long to ulong +len2 = add mul dx dx mul dy dy +ex = qx +ey = qy +if ne len2 0 +t = add mul qx dx mul qy dy +if gt t 0 +if ge t len2 +ex = sub qx dx +ey = sub qy dy +else +ex = sub qx div mul dx t len2 +ey = sub qy div mul dy t len2 +end +end +end +ret ulong add mul ex ex mul ey ey +end +fn afdist slot ulong px long py long to ulong +at = mul slot 4 +dx = sub get Ag add at 2 get Ag at +dy = sub get Ag add at 3 get Ag add at 1 +qx = sub px get Ag at +qy = sub py get Ag add at 1 +ret afproj qx qy dx dy +end +fn afalpha px long py long to uchar +best = ulong 18446744073709551615 +for i ulong get Af 2 +d2 = afdist i px py +if lt d2 best +best = d2 +end +end +d = long afsqrt best +cov = sub add long get Af 1 128 d +if le cov 0 +ret 0 +end +if ge cov 256 +ret 255 +end +ret uchar div mul cov 255 256 +end +fn afrow y ulong to void +py = add mul add get Ab 1 long y 256 128 +for x ulong get Af 3 +px = add mul add get Ab 0 long x 256 128 +at = add mul y get Af 3 x +put Alpha at afalpha px py +end +end +fn afpaint to void +for y ulong get Af 4 +afrow y +end +end +fn afglyph c uchar to bool +if eq get Af 0 0 +ret false +end +if not afpick c +ret false +end +for i ulong 65536 +put Alpha i 0 +end +put Af 2 0 +put Af 3 0 +put Af 4 1 +put Af 5 0 +put Ab 0 0 +put Ab 1 0 +put Apen 0 0 +put Apen 1 0 +while lt get Afpos 0 get Afpos 1 +cmd = get Afdata get Afpos 0 +put Afpos 0 add get Afpos 0 1 +if not afcmd cmd +ret false +end +end +if eq get Af 2 0 +ret true +end +if not afbox +ret false +end +afpaint +ret true +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +global Oldmask uchar 65536 +global Oldmeta ulong 6 +fn test ok bool to void +check ok add get Checks 0 1 +end +fn asym to bool +w = get Af 3 +for y ulong get Af 4 +at = mul y w +for x ulong w +a = long get Alpha add at x +mirror = add at sub sub w 1 x +b = long get Alpha mirror +d = sub a b +if gt d 40 +ret false +end +if lt d -40 +ret false +end +end +end +ret true +end +fn main to int +test not afglyph 65 +test not afinit 0 1250 +test not afinit 65 1250 +test not afinit 30 0 +test not afinit 30 2501 +test afinit 30 1250 +test eq get Af 0 384 +test eq get Af 1 480 +test eq afsqrt 0 0 +test eq afsqrt 15 3 +test eq afsqrt 16 4 +test eq afsqrt 18446744073709551615 4294967295 +test eq afsqrt mul ulong 1000000007 1000000007 1000000007 +test eq afsin 0 0 +test eq afsin 90 16384 +test eq afsin -90 -16384 +test eq afsin 450 16384 +test eq afcos 180 -16384 +for c ulong 95 +test afglyph uchar add c 32 +test gt get Af 5 0 +test le mul get Af 3 get Af 4 len Alpha +if eq c 0 +test eq get Af 3 0 +test eq get Af 4 1 +else +ink = ulong 0 +for i ulong mul get Af 3 get Af 4 +if gt get Alpha i 128 +ink = add ink 1 +end +end +test ge ink 4 +end +end +test afglyph 111 +test asym +test afglyph 63 +for i ulong mul get Af 3 get Af 4 +put Oldmask i get Alpha i +end +for i ulong 6 +put Oldmeta i get Af i +end +test afglyph 0 +same = true +for i ulong 6 +if ne get Oldmeta i get Af i +same = false +end +end +for i ulong mul get Af 3 get Af 4 +if ne get Oldmask i get Alpha i +same = false +end +end +test same +test not afinit 999 1250 +test eq get Af 0 get Oldmeta 0 +test eq get Af 3 get Oldmeta 3 +test afinit 64 2500 +test afglyph 87 +test le mul get Af 3 get Af 4 len Alpha +test afinit 1 1 +test afglyph 65 +note Independent analytic coverage for round-capped strokes and zero-length dots. +put Af 2 1 +put Af 1 128 +put Ag 0 0 +put Ag 1 0 +put Ag 2 512 +put Ag 3 0 +test eq afalpha 256 0 255 +test eq afalpha 256 128 127 +test eq afalpha 256 256 0 +test eq afalpha 768 0 0 +test eq afalpha -128 0 127 +put Ag 0 512 +put Ag 2 0 +test eq afalpha 256 128 127 +put Ag 0 0 +test eq afalpha 0 0 255 +test eq afalpha 0 128 127 +test eq afalpha 0 256 0 +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L758/independent-review/receipts/focused.sha256 b/evidence/allen-omega-L694/L758/independent-review/receipts/focused.sha256 new file mode 100644 index 00000000..79d84b07 --- /dev/null +++ b/evidence/allen-omega-L694/L758/independent-review/receipts/focused.sha256 @@ -0,0 +1,4 @@ +90ad35ebb9d78c71bcce41fcd9b005e060f7b417ad9d4894a464b4cf1e0b57b1 /home/drakestapleton/handoffs/L762-review/receipts/font-core.om +ac3f9e5eee125754df0d97822e10f050ff0a25cd41a5f528e590081e25422789 /home/drakestapleton/handoffs/L762-review/receipts/focused-font.om +71043853f991d69e84e32edefb3063a1276e7c7c4517ca712f8bdf0aa03c9eac /home/drakestapleton/handoffs/L762-review/receipts/focused-font.elf +1717fc2d53d03151502581b646ecfe8a8f55620641d4d99bc46c28a4eb7842b5 /home/drakestapleton/handoffs/L762-review/receipts/focused-font.log diff --git a/evidence/allen-omega-L694/L758/independent-review/receipts/font-boundary-final.om b/evidence/allen-omega-L694/L758/independent-review/receipts/font-boundary-final.om new file mode 100644 index 00000000..1a0e2fe7 --- /dev/null +++ b/evidence/allen-omega-L694/L758/independent-review/receipts/font-boundary-final.om @@ -0,0 +1,4248 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +note Stable application presentation; see PRESENTATION.md for scope and ownership. +global Ds ulong 8 +global Dt ulong 64 +global Dtext uchar 2304 +global Dsay ulong 1 +global Dm ulong 3 +global Dcode uchar 32768 +global Dstart ulong 4096 +global Dlen ulong 4096 +global Dline ulong 4096 +global Dview ulong 3 +global Din uchar 8192 +fn dscene to bool +n = get Inlen 0 +for i ulong 8192 +put Din i get In i +end +for i ulong get R 8 +put In i get Answer i +end +put Inlen 0 get R 8 +ok = scdecode +for i ulong 8192 +put In i get Din i +end +put Inlen 0 n +if not ok +ret false +end +for i ulong 8 +put Ds i get Sc i +end +for i ulong 64 +put Dt i get Things i +end +for i ulong 2304 +put Dtext i 0 +end +for i ulong get Sc 4 +put Dtext i get Stext i +end +put Dsay 0 get Sw 3 +put Dm 0 1 +ret true +end +fn dcode to bool +if or le get R 2 1 ne get R 1 0 +ret false +end +if or eq get R 6 0 ne get C 0 get R 0 +ret false +end +if not rows 80 4096 +ret false +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong get C 2 +put Dcode i get Code i +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong get View 0 +put Dstart i get Rowst i +put Dlen i get Rowlen i +put Dline i get Rowline i +end +put Dview 0 get View 0 +put Dview 1 0 +put Dview 2 get C 2 +put Dm 1 1 +ret true +end +fn dpresent to bool +if or eq get A 0 0 ne get A 2 1 +ret false +end +if or gt get R 8 159 gt get Inlen 0 8192 +ret false +end +shown = dscene +coded = dcode +if or shown coded +put Dm 2 get R 0 +ret true +end +ret false +end +fn dask now ulong to bool +if not appask now +ret false +end +b = dpresent +ret true +end +fn drecv now ulong to bool +if not appreceive now +ret false +end +b = dpresent +ret true +end +fn dreset to void +appreset +for i ulong 8 +put Ds i 0 +end +for i ulong 64 +put Dt i 0 +end +for i ulong 2304 +put Dtext i 0 +end +put Dsay 0 0 +for i ulong 3 +put Dm i 0 +put Dview i 0 +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong 8192 +put Din i 0 +end +end +note Declarative Allen glyph designs and integer sine samples, retained from +note native/kernel/ui/allen_font.c at4c7888f. No foreign executable implementation. +text Afdata "w6|w6 M3,0 L3,14 D3,20|w10 M3,0 L3,5 M7,0 L7,5|w15 M6,2 L4,20 M11,2 L9,20 M2,8 L13,8 M1,14 L12,14|w15 A8,5,5,5,-30,-270 A8,15,5,5,270,510 M8,-2 L8,22|w16 A4,4,2,3,0,360 A12,16,2,3,0,360 M13,1 L3,19|w16 M14,20 L5,9 A7,5,3,4,150,400 L3,14 A7,15,4,5,180,60 L13,11|w6 M3,0 L3,5|w9 A10,10,6,12,240,120|w9 A-1,10,6,12,-60,60|w14 M7,2 L7,10 M3,4 L11,8 M11,4 L3,8|w14 M2,12 L12,12 M7,7 L7,17|w6 M3,19 L2,23|w11 M2,13 L9,13|w6 D3,20|w12 M10,0 L2,20|w14 A7,10,5,10,0,360|w14 M3,4 L8,0 L8,20|w14 A7,6,5,6,200,400 L2,20 L12,20|w14 A7,5,5,5,200,450 A7,15,5,5,270,520|w14 M10,20 L10,0 L1,14 L13,14|w14 M12,0 L4,0 L4,9 A7,14,5,6,235,520|w14 A7,14,5,6,0,360 M10,0 L3,11|w14 M2,0 L12,0 L5,20|w14 A7,5,4,5,0,360 A7,15,5,5,0,360|w14 A7,6,5,6,0,360 M4,20 L11,9|w6 D3,8 D3,20|w6 D3,8 M3,19 L2,23|w14 M12,6 L2,12 L12,18|w14 M2,10 L12,10 M2,15 L12,15|w14 M2,6 L12,12 L2,18|w14 A7,5,5,5,190,450 L7,14 D7,20|w19 A9,12,3,4,0,360 M12,8 L12,14 A14,14,2,2,180,0 A9,11,7,9,0,-300|w16 M2,20 L8,0 L14,20 M4,13 L12,13|w15 M2,0 L2,20 M2,0 L8,0 A8,5,4,5,270,450 L2,10 M2,10 L9,10 A9,15,4,5,270,450 L2,20|w17 A9,10,7,10,45,315|w16 M2,0 L2,20 M2,0 L6,0 A6,10,8,10,270,450 L2,20|w14 M12,0 L2,0 L2,20 L12,20 M2,10 L10,10|w13 M12,0 L2,0 L2,20 M2,10 L10,10|w18 A9,10,7,10,-45,-360 M11,10 L16,10|w16 M2,0 L2,20 M14,0 L14,20 M2,10 L14,10|w6 M3,0 L3,20|w13 M10,0 L10,14 A6,14,4,6,0,180|w15 M2,0 L2,20 M13,0 L2,12 M6,8 L14,20|w13 M2,0 L2,20 L12,20|w20 M2,20 L2,0 L10,14 L18,0 L18,20|w16 M2,20 L2,0 L14,20 L14,0|w20 A10,10,8,10,0,360|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10|w20 A10,10,8,10,0,360 M12,14 L18,21|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10 M8,10 L14,20|w16 A8,5,5,5,-30,-270 A8,15,5,5,270,510|w16 M1,0 L15,0 M8,0 L8,20|w16 M2,0 L2,13 A8,13,6,7,180,0 L14,0|w16 M1,0 L8,20 L15,0|w22 M1,0 L6,20 L11,0 L16,20 L21,0|w16 M2,0 L14,20 M14,0 L2,20|w16 M1,0 L8,10 L15,0 M8,10 L8,20|w16 M2,0 L14,0 L2,20 L14,20|w9 M7,-1 L3,-1 L3,21 L7,21|w12 M2,0 L10,20|w9 M2,-1 L6,-1 L6,21 L2,21|w12 M2,8 L6,1 L10,8|w14 M1,23 L13,23|w7 M2,0 L4,4|w15 A7,14,5,6,0,360 M12,8 L12,20|w15 M2,0 L2,20 A7,14,5,6,0,360|w13 A7,14,5,6,40,320|w15 A7,14,5,6,0,360 M12,0 L12,20|w14 M2,14 L12,14 A7,14,5,6,0,-320|w11 M5,20 L5,4 A9,4,4,4,180,300 M2,8 L10,8|w15 A7,14,5,6,0,360 M12,8 L12,22 A7,22,5,5,0,150|w15 M2,0 L2,20 A7,13,5,5,180,360 L12,20|w6 M3,8 L3,20 D3,3|w7 M4,8 L4,22 A0,22,4,5,0,120 D4,3|w13 M2,0 L2,20 M11,8 L2,15 M5,13 L12,20|w6 M3,0 L3,20|w21 M2,8 L2,20 A6,12,4,4,180,360 L10,20 A14,12,4,4,180,360 L18,20|w15 M2,8 L2,20 A7,13,5,5,180,360 L12,20|w14 A7,14,5,6,0,360|w15 M2,8 L2,27 A7,14,5,6,0,360|w15 A7,14,5,6,0,360 M12,8 L12,27|w10 M2,8 L2,20 A7,13,5,5,180,290|w14 A7,11,4,3,-30,-270 A7,17,4,3,270,510|w11 M5,2 L5,17 A8,17,3,3,180,40 M2,8 L10,8|w15 M2,8 L2,15 A7,15,5,5,180,0 M12,8 L12,20|w14 M2,8 L7,20 L12,8|w20 M2,8 L6,20 L10,8 L14,20 L18,8|w14 M2,8 L12,20 M12,8 L2,20|w14 M2,8 L7,20 M12,8 L4,27|w14 M2,8 L12,8 L2,20 L12,20|w10 M8,-1 L6,0 L6,8 L4,10 L6,12 L6,20 L8,21|w6 M3,-1 L3,23|w10 M2,-1 L4,0 L4,8 L6,10 L4,12 L4,20 L2,21|w14 M2,13 L5,11 L9,14 L12,12|" +text Afsines "0 286 572 857 1143 1428 1713 1997 2280 2563 2845 3126 3406 3686 3964 4240 4516 4790 5063 5334 5604 5872 6138 6402 6664 6924 7182 7438 7692 7943 8192 8438 8682 8923 9162 9397 9630 9860 10087 10311 10531 10749 10963 11174 11381 11585 11786 11982 12176 12365 12551 12733 12911 13085 13255 13421 13583 13741 13894 14044 14189 14330 14466 14598 14726 14849 14968 15082 15191 15296 15396 15491 15582 15668 15749 15826 15897 15964 16026 16083 16135 16182 16225 16262 16294 16322 16344 16362 16374 16382 16384 " +note Handwritten bounded Allen stroke rasterizer. Legacy C is an external oracle only. +global Af ulong 6 +global Ab long 4 +global Ag long 640 +global Alpha uchar 65536 +global Asin long 91 +global Afpos ulong 2 +global Apen long 2 +global Arc long 6 +fn afsqrt value ulong to ulong +r = ulong 0 +bit = shl ulong 1 62 +while gt bit value +bit = shr bit 2 +end +while ne bit 0 +if ge value add r bit +value = sub value add r bit +r = add shr r 1 bit +else +r = shr r 1 +end +bit = shr bit 2 +end +ret r +end +fn afsin deg long to long +a = rem deg 360 +if lt a 0 +a = add a 360 +end +if le a 90 +ret get Asin ulong a +end +if le a 180 +ret get Asin ulong sub long 180 a +end +if le a 270 +ret neg get Asin ulong sub a 180 +end +ret neg get Asin ulong sub long 360 a +end +fn afcos deg long to long +ret afsin add rem deg 360 90 +end +fn afinit cap ulong wt ulong to bool +if or eq cap 0 gt cap 64 +ret false +end +if or eq wt 0 gt wt 2500 +ret false +end +for i ulong 6 +put Af i 0 +end +put Af 0 div mul cap 256 20 +put Af 1 div mul wt get Af 0 1000 +v = long 0 +slot = ulong 0 +for i ulong len Afsines +c = get Afsines i +if eq c 32 +put Asin slot v +slot = add slot 1 +v = 0 +else +v = add mul v 10 sub long c 48 +end +end +ret eq slot 91 +end +fn afpick c uchar to bool +if or lt c 32 gt c 126 +c = 63 +end +wanted = sub ulong c 32 +slot = ulong 0 +startat = ulong 0 +for i ulong len Afdata +if eq get Afdata i 124 +if eq slot wanted +put Afpos 0 startat +put Afpos 1 i +ret true +end +slot = add slot 1 +startat = add i 1 +end +end +ret false +end +fn afnum to long +p = get Afpos 0 +minus = false +if eq get Afdata p 45 +minus = true +p = add p 1 +end +v = long 0 +go = true +while and lt p get Afpos 1 go +c = get Afdata p +if and ge c 48 le c 57 +v = add mul v 10 sub long c 48 +p = add p 1 +else +go = false +end +end +if lt p get Afpos 1 +if eq get Afdata p 44 +p = add p 1 +end +end +put Afpos 0 p +if minus +ret neg v +end +ret v +end +fn afseg nx long ny long to bool +n = get Af 2 +if ge n 160 +ret false +end +at = mul n 4 +put Ag at get Apen 0 +put Ag add at 1 get Apen 1 +put Ag add at 2 nx +put Ag add at 3 ny +put Apen 0 nx +put Apen 1 ny +put Af 2 add n 1 +ret true +end +fn afpoint a long first bool to bool +s = long get Af 0 +x = mul get Arc 0 s +x = add x div mul mul get Arc 2 s afcos a 16384 +y = mul sub get Arc 1 20 s +y = add y div mul mul get Arc 3 s afsin a 16384 +if first +put Apen 0 x +put Apen 1 y +ret true +end +ret afseg x y +end +fn afarc to bool +for i ulong 6 +put Arc i afnum +end +span = sub get Arc 5 get Arc 4 +if lt span 0 +span = neg span +end +steps = div span 9 +if lt steps 2 +steps = 2 +end +for k ulong ulong add steps 1 +a = sub get Arc 5 get Arc 4 +a = add get Arc 4 div mul a long k steps +if not afpoint a eq k 0 +ret false +end +end +ret true +end +fn afcmd cmd uchar to bool +if eq cmd 32 +ret true +end +if eq cmd 119 +put Af 5 mul ulong afnum get Af 0 +ret true +end +if eq cmd 65 +ret afarc +end +x = mul afnum long get Af 0 +y = mul sub afnum 20 long get Af 0 +if or eq cmd 77 eq cmd 68 +put Apen 0 x +put Apen 1 y +end +if eq cmd 77 +ret true +end +if or eq cmd 76 eq cmd 68 +ret afseg x y +end +ret false +end +fn affloor value long to long +if ge value 0 +ret div value 256 +end +ret neg div add neg value 255 256 +end +fn afbound x long y long to void +if lt x get Ab 0 +put Ab 0 x +end +if lt y get Ab 1 +put Ab 1 y +end +if gt x get Ab 2 +put Ab 2 x +end +if gt y get Ab 3 +put Ab 3 y +end +end +fn afbox to bool +put Ab 0 get Ag 0 +put Ab 2 get Ag 0 +put Ab 1 get Ag 1 +put Ab 3 get Ag 1 +for i ulong get Af 2 +at = mul i 4 +afbound get Ag at get Ag add at 1 +afbound get Ag add at 2 get Ag add at 3 +end +pad = add long get Af 1 256 +x0 = affloor sub get Ab 0 pad +y0 = affloor sub get Ab 1 pad +x1 = add affloor add get Ab 2 pad 1 +y1 = add affloor add get Ab 3 pad 1 +put Ab 0 x0 +put Ab 1 y0 +put Af 3 ulong sub x1 x0 +put Af 4 ulong sub y1 y0 +ret le mul get Af 3 get Af 4 len Alpha +end +fn afproj qx long qy long dx long dy long to ulong +len2 = add mul dx dx mul dy dy +ex = qx +ey = qy +if ne len2 0 +t = add mul qx dx mul qy dy +if gt t 0 +if ge t len2 +ex = sub qx dx +ey = sub qy dy +else +ex = sub qx div mul dx t len2 +ey = sub qy div mul dy t len2 +end +end +end +ret ulong add mul ex ex mul ey ey +end +fn afdist slot ulong px long py long to ulong +at = mul slot 4 +dx = sub get Ag add at 2 get Ag at +dy = sub get Ag add at 3 get Ag add at 1 +qx = sub px get Ag at +qy = sub py get Ag add at 1 +ret afproj qx qy dx dy +end +fn afalpha px long py long to uchar +best = ulong 18446744073709551615 +for i ulong get Af 2 +d2 = afdist i px py +if lt d2 best +best = d2 +end +end +d = long afsqrt best +cov = sub add long get Af 1 128 d +if le cov 0 +ret 0 +end +if ge cov 256 +ret 255 +end +ret uchar div mul cov 255 256 +end +fn afrow y ulong to void +py = add mul add get Ab 1 long y 256 128 +for x ulong get Af 3 +px = add mul add get Ab 0 long x 256 128 +at = add mul y get Af 3 x +put Alpha at afalpha px py +end +end +fn afpaint to void +for y ulong get Af 4 +afrow y +end +end +fn afglyph c uchar to bool +if eq get Af 0 0 +ret false +end +if not afpick c +ret false +end +for i ulong 65536 +put Alpha i 0 +end +put Af 2 0 +put Af 3 0 +put Af 4 1 +put Af 5 0 +put Ab 0 0 +put Ab 1 0 +put Apen 0 0 +put Apen 1 0 +while lt get Afpos 0 get Afpos 1 +cmd = get Afdata get Afpos 0 +put Afpos 0 add get Afpos 0 1 +if not afcmd cmd +ret false +end +end +if eq get Af 2 0 +ret true +end +if not afbox +ret false +end +afpaint +ret true +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +note Independent L762 boundary probe; handwritten Omega assertions. +global SnapAf ulong 6 +global SnapAb long 4 +global FallbackMask uchar 65536 +fn probe ok bool to void +check ok add get Checks 0 1 +end +fn main to int +probe not afinit 0 1 +probe not afinit 65 2500 +probe not afinit 1 0 +probe not afinit 1 2501 +probe afinit 1 1 +probe eq get Af 0 12 +probe eq get Af 1 0 +probe afglyph 32 +probe eq get Af 3 0 +probe eq get Af 4 1 +probe afinit 64 2500 +probe eq get Af 0 819 +probe eq get Af 1 2047 +for c ulong 95 +probe afglyph uchar add c 32 +probe le mul get Af 3 get Af 4 65536 +probe le get Af 2 160 +end +probe afglyph 63 +for i ulong 65536 +put FallbackMask i get Alpha i +end +for i ulong 6 +put SnapAf i get Af i +end +for i ulong 4 +put SnapAb i get Ab i +end +put Alpha 0 77 +probe not afinit 0 2500 +same = true +for i ulong 6 +if ne get Af i get SnapAf i +same = false +end +end +for i ulong 4 +if ne get Ab i get SnapAb i +same = false +end +end +if ne get Alpha 0 77 +same = false +end +probe same +for bad ulong 3 +c = ulong 0 +if eq bad 1 +c = 127 +end +if eq bad 2 +c = 255 +end +probe afglyph uchar c +same = true +for i ulong 6 +if ne get Af i get SnapAf i +same = false +end +end +for i ulong 4 +if ne get Ab i get SnapAb i +same = false +end +end +for i ulong 65536 +if ne get Alpha i get FallbackMask i +same = false +end +end +probe same +end +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L758/independent-review/receipts/font-boundary-final2.om b/evidence/allen-omega-L694/L758/independent-review/receipts/font-boundary-final2.om new file mode 100644 index 00000000..1a0e2fe7 --- /dev/null +++ b/evidence/allen-omega-L694/L758/independent-review/receipts/font-boundary-final2.om @@ -0,0 +1,4248 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +note Stable application presentation; see PRESENTATION.md for scope and ownership. +global Ds ulong 8 +global Dt ulong 64 +global Dtext uchar 2304 +global Dsay ulong 1 +global Dm ulong 3 +global Dcode uchar 32768 +global Dstart ulong 4096 +global Dlen ulong 4096 +global Dline ulong 4096 +global Dview ulong 3 +global Din uchar 8192 +fn dscene to bool +n = get Inlen 0 +for i ulong 8192 +put Din i get In i +end +for i ulong get R 8 +put In i get Answer i +end +put Inlen 0 get R 8 +ok = scdecode +for i ulong 8192 +put In i get Din i +end +put Inlen 0 n +if not ok +ret false +end +for i ulong 8 +put Ds i get Sc i +end +for i ulong 64 +put Dt i get Things i +end +for i ulong 2304 +put Dtext i 0 +end +for i ulong get Sc 4 +put Dtext i get Stext i +end +put Dsay 0 get Sw 3 +put Dm 0 1 +ret true +end +fn dcode to bool +if or le get R 2 1 ne get R 1 0 +ret false +end +if or eq get R 6 0 ne get C 0 get R 0 +ret false +end +if not rows 80 4096 +ret false +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong get C 2 +put Dcode i get Code i +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong get View 0 +put Dstart i get Rowst i +put Dlen i get Rowlen i +put Dline i get Rowline i +end +put Dview 0 get View 0 +put Dview 1 0 +put Dview 2 get C 2 +put Dm 1 1 +ret true +end +fn dpresent to bool +if or eq get A 0 0 ne get A 2 1 +ret false +end +if or gt get R 8 159 gt get Inlen 0 8192 +ret false +end +shown = dscene +coded = dcode +if or shown coded +put Dm 2 get R 0 +ret true +end +ret false +end +fn dask now ulong to bool +if not appask now +ret false +end +b = dpresent +ret true +end +fn drecv now ulong to bool +if not appreceive now +ret false +end +b = dpresent +ret true +end +fn dreset to void +appreset +for i ulong 8 +put Ds i 0 +end +for i ulong 64 +put Dt i 0 +end +for i ulong 2304 +put Dtext i 0 +end +put Dsay 0 0 +for i ulong 3 +put Dm i 0 +put Dview i 0 +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong 8192 +put Din i 0 +end +end +note Declarative Allen glyph designs and integer sine samples, retained from +note native/kernel/ui/allen_font.c at4c7888f. No foreign executable implementation. +text Afdata "w6|w6 M3,0 L3,14 D3,20|w10 M3,0 L3,5 M7,0 L7,5|w15 M6,2 L4,20 M11,2 L9,20 M2,8 L13,8 M1,14 L12,14|w15 A8,5,5,5,-30,-270 A8,15,5,5,270,510 M8,-2 L8,22|w16 A4,4,2,3,0,360 A12,16,2,3,0,360 M13,1 L3,19|w16 M14,20 L5,9 A7,5,3,4,150,400 L3,14 A7,15,4,5,180,60 L13,11|w6 M3,0 L3,5|w9 A10,10,6,12,240,120|w9 A-1,10,6,12,-60,60|w14 M7,2 L7,10 M3,4 L11,8 M11,4 L3,8|w14 M2,12 L12,12 M7,7 L7,17|w6 M3,19 L2,23|w11 M2,13 L9,13|w6 D3,20|w12 M10,0 L2,20|w14 A7,10,5,10,0,360|w14 M3,4 L8,0 L8,20|w14 A7,6,5,6,200,400 L2,20 L12,20|w14 A7,5,5,5,200,450 A7,15,5,5,270,520|w14 M10,20 L10,0 L1,14 L13,14|w14 M12,0 L4,0 L4,9 A7,14,5,6,235,520|w14 A7,14,5,6,0,360 M10,0 L3,11|w14 M2,0 L12,0 L5,20|w14 A7,5,4,5,0,360 A7,15,5,5,0,360|w14 A7,6,5,6,0,360 M4,20 L11,9|w6 D3,8 D3,20|w6 D3,8 M3,19 L2,23|w14 M12,6 L2,12 L12,18|w14 M2,10 L12,10 M2,15 L12,15|w14 M2,6 L12,12 L2,18|w14 A7,5,5,5,190,450 L7,14 D7,20|w19 A9,12,3,4,0,360 M12,8 L12,14 A14,14,2,2,180,0 A9,11,7,9,0,-300|w16 M2,20 L8,0 L14,20 M4,13 L12,13|w15 M2,0 L2,20 M2,0 L8,0 A8,5,4,5,270,450 L2,10 M2,10 L9,10 A9,15,4,5,270,450 L2,20|w17 A9,10,7,10,45,315|w16 M2,0 L2,20 M2,0 L6,0 A6,10,8,10,270,450 L2,20|w14 M12,0 L2,0 L2,20 L12,20 M2,10 L10,10|w13 M12,0 L2,0 L2,20 M2,10 L10,10|w18 A9,10,7,10,-45,-360 M11,10 L16,10|w16 M2,0 L2,20 M14,0 L14,20 M2,10 L14,10|w6 M3,0 L3,20|w13 M10,0 L10,14 A6,14,4,6,0,180|w15 M2,0 L2,20 M13,0 L2,12 M6,8 L14,20|w13 M2,0 L2,20 L12,20|w20 M2,20 L2,0 L10,14 L18,0 L18,20|w16 M2,20 L2,0 L14,20 L14,0|w20 A10,10,8,10,0,360|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10|w20 A10,10,8,10,0,360 M12,14 L18,21|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10 M8,10 L14,20|w16 A8,5,5,5,-30,-270 A8,15,5,5,270,510|w16 M1,0 L15,0 M8,0 L8,20|w16 M2,0 L2,13 A8,13,6,7,180,0 L14,0|w16 M1,0 L8,20 L15,0|w22 M1,0 L6,20 L11,0 L16,20 L21,0|w16 M2,0 L14,20 M14,0 L2,20|w16 M1,0 L8,10 L15,0 M8,10 L8,20|w16 M2,0 L14,0 L2,20 L14,20|w9 M7,-1 L3,-1 L3,21 L7,21|w12 M2,0 L10,20|w9 M2,-1 L6,-1 L6,21 L2,21|w12 M2,8 L6,1 L10,8|w14 M1,23 L13,23|w7 M2,0 L4,4|w15 A7,14,5,6,0,360 M12,8 L12,20|w15 M2,0 L2,20 A7,14,5,6,0,360|w13 A7,14,5,6,40,320|w15 A7,14,5,6,0,360 M12,0 L12,20|w14 M2,14 L12,14 A7,14,5,6,0,-320|w11 M5,20 L5,4 A9,4,4,4,180,300 M2,8 L10,8|w15 A7,14,5,6,0,360 M12,8 L12,22 A7,22,5,5,0,150|w15 M2,0 L2,20 A7,13,5,5,180,360 L12,20|w6 M3,8 L3,20 D3,3|w7 M4,8 L4,22 A0,22,4,5,0,120 D4,3|w13 M2,0 L2,20 M11,8 L2,15 M5,13 L12,20|w6 M3,0 L3,20|w21 M2,8 L2,20 A6,12,4,4,180,360 L10,20 A14,12,4,4,180,360 L18,20|w15 M2,8 L2,20 A7,13,5,5,180,360 L12,20|w14 A7,14,5,6,0,360|w15 M2,8 L2,27 A7,14,5,6,0,360|w15 A7,14,5,6,0,360 M12,8 L12,27|w10 M2,8 L2,20 A7,13,5,5,180,290|w14 A7,11,4,3,-30,-270 A7,17,4,3,270,510|w11 M5,2 L5,17 A8,17,3,3,180,40 M2,8 L10,8|w15 M2,8 L2,15 A7,15,5,5,180,0 M12,8 L12,20|w14 M2,8 L7,20 L12,8|w20 M2,8 L6,20 L10,8 L14,20 L18,8|w14 M2,8 L12,20 M12,8 L2,20|w14 M2,8 L7,20 M12,8 L4,27|w14 M2,8 L12,8 L2,20 L12,20|w10 M8,-1 L6,0 L6,8 L4,10 L6,12 L6,20 L8,21|w6 M3,-1 L3,23|w10 M2,-1 L4,0 L4,8 L6,10 L4,12 L4,20 L2,21|w14 M2,13 L5,11 L9,14 L12,12|" +text Afsines "0 286 572 857 1143 1428 1713 1997 2280 2563 2845 3126 3406 3686 3964 4240 4516 4790 5063 5334 5604 5872 6138 6402 6664 6924 7182 7438 7692 7943 8192 8438 8682 8923 9162 9397 9630 9860 10087 10311 10531 10749 10963 11174 11381 11585 11786 11982 12176 12365 12551 12733 12911 13085 13255 13421 13583 13741 13894 14044 14189 14330 14466 14598 14726 14849 14968 15082 15191 15296 15396 15491 15582 15668 15749 15826 15897 15964 16026 16083 16135 16182 16225 16262 16294 16322 16344 16362 16374 16382 16384 " +note Handwritten bounded Allen stroke rasterizer. Legacy C is an external oracle only. +global Af ulong 6 +global Ab long 4 +global Ag long 640 +global Alpha uchar 65536 +global Asin long 91 +global Afpos ulong 2 +global Apen long 2 +global Arc long 6 +fn afsqrt value ulong to ulong +r = ulong 0 +bit = shl ulong 1 62 +while gt bit value +bit = shr bit 2 +end +while ne bit 0 +if ge value add r bit +value = sub value add r bit +r = add shr r 1 bit +else +r = shr r 1 +end +bit = shr bit 2 +end +ret r +end +fn afsin deg long to long +a = rem deg 360 +if lt a 0 +a = add a 360 +end +if le a 90 +ret get Asin ulong a +end +if le a 180 +ret get Asin ulong sub long 180 a +end +if le a 270 +ret neg get Asin ulong sub a 180 +end +ret neg get Asin ulong sub long 360 a +end +fn afcos deg long to long +ret afsin add rem deg 360 90 +end +fn afinit cap ulong wt ulong to bool +if or eq cap 0 gt cap 64 +ret false +end +if or eq wt 0 gt wt 2500 +ret false +end +for i ulong 6 +put Af i 0 +end +put Af 0 div mul cap 256 20 +put Af 1 div mul wt get Af 0 1000 +v = long 0 +slot = ulong 0 +for i ulong len Afsines +c = get Afsines i +if eq c 32 +put Asin slot v +slot = add slot 1 +v = 0 +else +v = add mul v 10 sub long c 48 +end +end +ret eq slot 91 +end +fn afpick c uchar to bool +if or lt c 32 gt c 126 +c = 63 +end +wanted = sub ulong c 32 +slot = ulong 0 +startat = ulong 0 +for i ulong len Afdata +if eq get Afdata i 124 +if eq slot wanted +put Afpos 0 startat +put Afpos 1 i +ret true +end +slot = add slot 1 +startat = add i 1 +end +end +ret false +end +fn afnum to long +p = get Afpos 0 +minus = false +if eq get Afdata p 45 +minus = true +p = add p 1 +end +v = long 0 +go = true +while and lt p get Afpos 1 go +c = get Afdata p +if and ge c 48 le c 57 +v = add mul v 10 sub long c 48 +p = add p 1 +else +go = false +end +end +if lt p get Afpos 1 +if eq get Afdata p 44 +p = add p 1 +end +end +put Afpos 0 p +if minus +ret neg v +end +ret v +end +fn afseg nx long ny long to bool +n = get Af 2 +if ge n 160 +ret false +end +at = mul n 4 +put Ag at get Apen 0 +put Ag add at 1 get Apen 1 +put Ag add at 2 nx +put Ag add at 3 ny +put Apen 0 nx +put Apen 1 ny +put Af 2 add n 1 +ret true +end +fn afpoint a long first bool to bool +s = long get Af 0 +x = mul get Arc 0 s +x = add x div mul mul get Arc 2 s afcos a 16384 +y = mul sub get Arc 1 20 s +y = add y div mul mul get Arc 3 s afsin a 16384 +if first +put Apen 0 x +put Apen 1 y +ret true +end +ret afseg x y +end +fn afarc to bool +for i ulong 6 +put Arc i afnum +end +span = sub get Arc 5 get Arc 4 +if lt span 0 +span = neg span +end +steps = div span 9 +if lt steps 2 +steps = 2 +end +for k ulong ulong add steps 1 +a = sub get Arc 5 get Arc 4 +a = add get Arc 4 div mul a long k steps +if not afpoint a eq k 0 +ret false +end +end +ret true +end +fn afcmd cmd uchar to bool +if eq cmd 32 +ret true +end +if eq cmd 119 +put Af 5 mul ulong afnum get Af 0 +ret true +end +if eq cmd 65 +ret afarc +end +x = mul afnum long get Af 0 +y = mul sub afnum 20 long get Af 0 +if or eq cmd 77 eq cmd 68 +put Apen 0 x +put Apen 1 y +end +if eq cmd 77 +ret true +end +if or eq cmd 76 eq cmd 68 +ret afseg x y +end +ret false +end +fn affloor value long to long +if ge value 0 +ret div value 256 +end +ret neg div add neg value 255 256 +end +fn afbound x long y long to void +if lt x get Ab 0 +put Ab 0 x +end +if lt y get Ab 1 +put Ab 1 y +end +if gt x get Ab 2 +put Ab 2 x +end +if gt y get Ab 3 +put Ab 3 y +end +end +fn afbox to bool +put Ab 0 get Ag 0 +put Ab 2 get Ag 0 +put Ab 1 get Ag 1 +put Ab 3 get Ag 1 +for i ulong get Af 2 +at = mul i 4 +afbound get Ag at get Ag add at 1 +afbound get Ag add at 2 get Ag add at 3 +end +pad = add long get Af 1 256 +x0 = affloor sub get Ab 0 pad +y0 = affloor sub get Ab 1 pad +x1 = add affloor add get Ab 2 pad 1 +y1 = add affloor add get Ab 3 pad 1 +put Ab 0 x0 +put Ab 1 y0 +put Af 3 ulong sub x1 x0 +put Af 4 ulong sub y1 y0 +ret le mul get Af 3 get Af 4 len Alpha +end +fn afproj qx long qy long dx long dy long to ulong +len2 = add mul dx dx mul dy dy +ex = qx +ey = qy +if ne len2 0 +t = add mul qx dx mul qy dy +if gt t 0 +if ge t len2 +ex = sub qx dx +ey = sub qy dy +else +ex = sub qx div mul dx t len2 +ey = sub qy div mul dy t len2 +end +end +end +ret ulong add mul ex ex mul ey ey +end +fn afdist slot ulong px long py long to ulong +at = mul slot 4 +dx = sub get Ag add at 2 get Ag at +dy = sub get Ag add at 3 get Ag add at 1 +qx = sub px get Ag at +qy = sub py get Ag add at 1 +ret afproj qx qy dx dy +end +fn afalpha px long py long to uchar +best = ulong 18446744073709551615 +for i ulong get Af 2 +d2 = afdist i px py +if lt d2 best +best = d2 +end +end +d = long afsqrt best +cov = sub add long get Af 1 128 d +if le cov 0 +ret 0 +end +if ge cov 256 +ret 255 +end +ret uchar div mul cov 255 256 +end +fn afrow y ulong to void +py = add mul add get Ab 1 long y 256 128 +for x ulong get Af 3 +px = add mul add get Ab 0 long x 256 128 +at = add mul y get Af 3 x +put Alpha at afalpha px py +end +end +fn afpaint to void +for y ulong get Af 4 +afrow y +end +end +fn afglyph c uchar to bool +if eq get Af 0 0 +ret false +end +if not afpick c +ret false +end +for i ulong 65536 +put Alpha i 0 +end +put Af 2 0 +put Af 3 0 +put Af 4 1 +put Af 5 0 +put Ab 0 0 +put Ab 1 0 +put Apen 0 0 +put Apen 1 0 +while lt get Afpos 0 get Afpos 1 +cmd = get Afdata get Afpos 0 +put Afpos 0 add get Afpos 0 1 +if not afcmd cmd +ret false +end +end +if eq get Af 2 0 +ret true +end +if not afbox +ret false +end +afpaint +ret true +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +note Independent L762 boundary probe; handwritten Omega assertions. +global SnapAf ulong 6 +global SnapAb long 4 +global FallbackMask uchar 65536 +fn probe ok bool to void +check ok add get Checks 0 1 +end +fn main to int +probe not afinit 0 1 +probe not afinit 65 2500 +probe not afinit 1 0 +probe not afinit 1 2501 +probe afinit 1 1 +probe eq get Af 0 12 +probe eq get Af 1 0 +probe afglyph 32 +probe eq get Af 3 0 +probe eq get Af 4 1 +probe afinit 64 2500 +probe eq get Af 0 819 +probe eq get Af 1 2047 +for c ulong 95 +probe afglyph uchar add c 32 +probe le mul get Af 3 get Af 4 65536 +probe le get Af 2 160 +end +probe afglyph 63 +for i ulong 65536 +put FallbackMask i get Alpha i +end +for i ulong 6 +put SnapAf i get Af i +end +for i ulong 4 +put SnapAb i get Ab i +end +put Alpha 0 77 +probe not afinit 0 2500 +same = true +for i ulong 6 +if ne get Af i get SnapAf i +same = false +end +end +for i ulong 4 +if ne get Ab i get SnapAb i +same = false +end +end +if ne get Alpha 0 77 +same = false +end +probe same +for bad ulong 3 +c = ulong 0 +if eq bad 1 +c = 127 +end +if eq bad 2 +c = 255 +end +probe afglyph uchar c +same = true +for i ulong 6 +if ne get Af i get SnapAf i +same = false +end +end +for i ulong 4 +if ne get Ab i get SnapAb i +same = false +end +end +for i ulong 65536 +if ne get Alpha i get FallbackMask i +same = false +end +end +probe same +end +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L758/independent-review/receipts/font-boundary-verified.om b/evidence/allen-omega-L694/L758/independent-review/receipts/font-boundary-verified.om new file mode 100644 index 00000000..b42a5535 --- /dev/null +++ b/evidence/allen-omega-L694/L758/independent-review/receipts/font-boundary-verified.om @@ -0,0 +1,4248 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +note Stable application presentation; see PRESENTATION.md for scope and ownership. +global Ds ulong 8 +global Dt ulong 64 +global Dtext uchar 2304 +global Dsay ulong 1 +global Dm ulong 3 +global Dcode uchar 32768 +global Dstart ulong 4096 +global Dlen ulong 4096 +global Dline ulong 4096 +global Dview ulong 3 +global Din uchar 8192 +fn dscene to bool +n = get Inlen 0 +for i ulong 8192 +put Din i get In i +end +for i ulong get R 8 +put In i get Answer i +end +put Inlen 0 get R 8 +ok = scdecode +for i ulong 8192 +put In i get Din i +end +put Inlen 0 n +if not ok +ret false +end +for i ulong 8 +put Ds i get Sc i +end +for i ulong 64 +put Dt i get Things i +end +for i ulong 2304 +put Dtext i 0 +end +for i ulong get Sc 4 +put Dtext i get Stext i +end +put Dsay 0 get Sw 3 +put Dm 0 1 +ret true +end +fn dcode to bool +if or le get R 2 1 ne get R 1 0 +ret false +end +if or eq get R 6 0 ne get C 0 get R 0 +ret false +end +if not rows 80 4096 +ret false +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong get C 2 +put Dcode i get Code i +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong get View 0 +put Dstart i get Rowst i +put Dlen i get Rowlen i +put Dline i get Rowline i +end +put Dview 0 get View 0 +put Dview 1 0 +put Dview 2 get C 2 +put Dm 1 1 +ret true +end +fn dpresent to bool +if or eq get A 0 0 ne get A 2 1 +ret false +end +if or gt get R 8 159 gt get Inlen 0 8192 +ret false +end +shown = dscene +coded = dcode +if or shown coded +put Dm 2 get R 0 +ret true +end +ret false +end +fn dask now ulong to bool +if not appask now +ret false +end +b = dpresent +ret true +end +fn drecv now ulong to bool +if not appreceive now +ret false +end +b = dpresent +ret true +end +fn dreset to void +appreset +for i ulong 8 +put Ds i 0 +end +for i ulong 64 +put Dt i 0 +end +for i ulong 2304 +put Dtext i 0 +end +put Dsay 0 0 +for i ulong 3 +put Dm i 0 +put Dview i 0 +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong 8192 +put Din i 0 +end +end +note Declarative Allen glyph designs and integer sine samples, retained from +note native/kernel/ui/allen_font.c at4c7888f. No foreign executable implementation. +text Afdata "w6|w6 M3,0 L3,14 D3,20|w10 M3,0 L3,5 M7,0 L7,5|w15 M6,2 L4,20 M11,2 L9,20 M2,8 L13,8 M1,14 L12,14|w15 A8,5,5,5,-30,-270 A8,15,5,5,270,510 M8,-2 L8,22|w16 A4,4,2,3,0,360 A12,16,2,3,0,360 M13,1 L3,19|w16 M14,20 L5,9 A7,5,3,4,150,400 L3,14 A7,15,4,5,180,60 L13,11|w6 M3,0 L3,5|w9 A10,10,6,12,240,120|w9 A-1,10,6,12,-60,60|w14 M7,2 L7,10 M3,4 L11,8 M11,4 L3,8|w14 M2,12 L12,12 M7,7 L7,17|w6 M3,19 L2,23|w11 M2,13 L9,13|w6 D3,20|w12 M10,0 L2,20|w14 A7,10,5,10,0,360|w14 M3,4 L8,0 L8,20|w14 A7,6,5,6,200,400 L2,20 L12,20|w14 A7,5,5,5,200,450 A7,15,5,5,270,520|w14 M10,20 L10,0 L1,14 L13,14|w14 M12,0 L4,0 L4,9 A7,14,5,6,235,520|w14 A7,14,5,6,0,360 M10,0 L3,11|w14 M2,0 L12,0 L5,20|w14 A7,5,4,5,0,360 A7,15,5,5,0,360|w14 A7,6,5,6,0,360 M4,20 L11,9|w6 D3,8 D3,20|w6 D3,8 M3,19 L2,23|w14 M12,6 L2,12 L12,18|w14 M2,10 L12,10 M2,15 L12,15|w14 M2,6 L12,12 L2,18|w14 A7,5,5,5,190,450 L7,14 D7,20|w19 A9,12,3,4,0,360 M12,8 L12,14 A14,14,2,2,180,0 A9,11,7,9,0,-300|w16 M2,20 L8,0 L14,20 M4,13 L12,13|w15 M2,0 L2,20 M2,0 L8,0 A8,5,4,5,270,450 L2,10 M2,10 L9,10 A9,15,4,5,270,450 L2,20|w17 A9,10,7,10,45,315|w16 M2,0 L2,20 M2,0 L6,0 A6,10,8,10,270,450 L2,20|w14 M12,0 L2,0 L2,20 L12,20 M2,10 L10,10|w13 M12,0 L2,0 L2,20 M2,10 L10,10|w18 A9,10,7,10,-45,-360 M11,10 L16,10|w16 M2,0 L2,20 M14,0 L14,20 M2,10 L14,10|w6 M3,0 L3,20|w13 M10,0 L10,14 A6,14,4,6,0,180|w15 M2,0 L2,20 M13,0 L2,12 M6,8 L14,20|w13 M2,0 L2,20 L12,20|w20 M2,20 L2,0 L10,14 L18,0 L18,20|w16 M2,20 L2,0 L14,20 L14,0|w20 A10,10,8,10,0,360|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10|w20 A10,10,8,10,0,360 M12,14 L18,21|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10 M8,10 L14,20|w16 A8,5,5,5,-30,-270 A8,15,5,5,270,510|w16 M1,0 L15,0 M8,0 L8,20|w16 M2,0 L2,13 A8,13,6,7,180,0 L14,0|w16 M1,0 L8,20 L15,0|w22 M1,0 L6,20 L11,0 L16,20 L21,0|w16 M2,0 L14,20 M14,0 L2,20|w16 M1,0 L8,10 L15,0 M8,10 L8,20|w16 M2,0 L14,0 L2,20 L14,20|w9 M7,-1 L3,-1 L3,21 L7,21|w12 M2,0 L10,20|w9 M2,-1 L6,-1 L6,21 L2,21|w12 M2,8 L6,1 L10,8|w14 M1,23 L13,23|w7 M2,0 L4,4|w15 A7,14,5,6,0,360 M12,8 L12,20|w15 M2,0 L2,20 A7,14,5,6,0,360|w13 A7,14,5,6,40,320|w15 A7,14,5,6,0,360 M12,0 L12,20|w14 M2,14 L12,14 A7,14,5,6,0,-320|w11 M5,20 L5,4 A9,4,4,4,180,300 M2,8 L10,8|w15 A7,14,5,6,0,360 M12,8 L12,22 A7,22,5,5,0,150|w15 M2,0 L2,20 A7,13,5,5,180,360 L12,20|w6 M3,8 L3,20 D3,3|w7 M4,8 L4,22 A0,22,4,5,0,120 D4,3|w13 M2,0 L2,20 M11,8 L2,15 M5,13 L12,20|w6 M3,0 L3,20|w21 M2,8 L2,20 A6,12,4,4,180,360 L10,20 A14,12,4,4,180,360 L18,20|w15 M2,8 L2,20 A7,13,5,5,180,360 L12,20|w14 A7,14,5,6,0,360|w15 M2,8 L2,27 A7,14,5,6,0,360|w15 A7,14,5,6,0,360 M12,8 L12,27|w10 M2,8 L2,20 A7,13,5,5,180,290|w14 A7,11,4,3,-30,-270 A7,17,4,3,270,510|w11 M5,2 L5,17 A8,17,3,3,180,40 M2,8 L10,8|w15 M2,8 L2,15 A7,15,5,5,180,0 M12,8 L12,20|w14 M2,8 L7,20 L12,8|w20 M2,8 L6,20 L10,8 L14,20 L18,8|w14 M2,8 L12,20 M12,8 L2,20|w14 M2,8 L7,20 M12,8 L4,27|w14 M2,8 L12,8 L2,20 L12,20|w10 M8,-1 L6,0 L6,8 L4,10 L6,12 L6,20 L8,21|w6 M3,-1 L3,23|w10 M2,-1 L4,0 L4,8 L6,10 L4,12 L4,20 L2,21|w14 M2,13 L5,11 L9,14 L12,12|" +text Afsines "0 286 572 857 1143 1428 1713 1997 2280 2563 2845 3126 3406 3686 3964 4240 4516 4790 5063 5334 5604 5872 6138 6402 6664 6924 7182 7438 7692 7943 8192 8438 8682 8923 9162 9397 9630 9860 10087 10311 10531 10749 10963 11174 11381 11585 11786 11982 12176 12365 12551 12733 12911 13085 13255 13421 13583 13741 13894 14044 14189 14330 14466 14598 14726 14849 14968 15082 15191 15296 15396 15491 15582 15668 15749 15826 15897 15964 16026 16083 16135 16182 16225 16262 16294 16322 16344 16362 16374 16382 16384 " +note Handwritten bounded Allen stroke rasterizer. Legacy C is an external oracle only. +global Af ulong 6 +global Ab long 4 +global Ag long 640 +global Alpha uchar 65536 +global Asin long 91 +global Afpos ulong 2 +global Apen long 2 +global Arc long 6 +fn afsqrt value ulong to ulong +r = ulong 0 +bit = shl ulong 1 62 +while gt bit value +bit = shr bit 2 +end +while ne bit 0 +if ge value add r bit +value = sub value add r bit +r = add shr r 1 bit +else +r = shr r 1 +end +bit = shr bit 2 +end +ret r +end +fn afsin deg long to long +a = rem deg 360 +if lt a 0 +a = add a 360 +end +if le a 90 +ret get Asin ulong a +end +if le a 180 +ret get Asin ulong sub long 180 a +end +if le a 270 +ret neg get Asin ulong sub a 180 +end +ret neg get Asin ulong sub long 360 a +end +fn afcos deg long to long +ret afsin add rem deg 360 90 +end +fn afinit cap ulong wt ulong to bool +if or eq cap 0 gt cap 64 +ret false +end +if or eq wt 0 gt wt 2500 +ret false +end +for i ulong 6 +put Af i 0 +end +put Af 0 div mul cap 256 20 +put Af 1 div mul wt get Af 0 1000 +v = long 0 +slot = ulong 0 +for i ulong len Afsines +c = get Afsines i +if eq c 32 +put Asin slot v +slot = add slot 1 +v = 0 +else +v = add mul v 10 sub long c 48 +end +end +ret eq slot 91 +end +fn afpick c uchar to bool +if or lt c 32 gt c 126 +c = 63 +end +wanted = sub ulong c 32 +slot = ulong 0 +startat = ulong 0 +for i ulong len Afdata +if eq get Afdata i 124 +if eq slot wanted +put Afpos 0 startat +put Afpos 1 i +ret true +end +slot = add slot 1 +startat = add i 1 +end +end +ret false +end +fn afnum to long +p = get Afpos 0 +minus = false +if eq get Afdata p 45 +minus = true +p = add p 1 +end +v = long 0 +go = true +while and lt p get Afpos 1 go +c = get Afdata p +if and ge c 48 le c 57 +v = add mul v 10 sub long c 48 +p = add p 1 +else +go = false +end +end +if lt p get Afpos 1 +if eq get Afdata p 44 +p = add p 1 +end +end +put Afpos 0 p +if minus +ret neg v +end +ret v +end +fn afseg nx long ny long to bool +n = get Af 2 +if ge n 160 +ret false +end +at = mul n 4 +put Ag at get Apen 0 +put Ag add at 1 get Apen 1 +put Ag add at 2 nx +put Ag add at 3 ny +put Apen 0 nx +put Apen 1 ny +put Af 2 add n 1 +ret true +end +fn afpoint a long first bool to bool +s = long get Af 0 +x = mul get Arc 0 s +x = add x div mul mul get Arc 2 s afcos a 16384 +y = mul sub get Arc 1 20 s +y = add y div mul mul get Arc 3 s afsin a 16384 +if first +put Apen 0 x +put Apen 1 y +ret true +end +ret afseg x y +end +fn afarc to bool +for i ulong 6 +put Arc i afnum +end +span = sub get Arc 5 get Arc 4 +if lt span 0 +span = neg span +end +steps = div span 9 +if lt steps 2 +steps = 2 +end +for k ulong ulong add steps 1 +a = sub get Arc 5 get Arc 4 +a = add get Arc 4 div mul a long k steps +if not afpoint a eq k 0 +ret false +end +end +ret true +end +fn afcmd cmd uchar to bool +if eq cmd 32 +ret true +end +if eq cmd 119 +put Af 5 mul ulong afnum get Af 0 +ret true +end +if eq cmd 65 +ret afarc +end +x = mul afnum long get Af 0 +y = mul sub afnum 20 long get Af 0 +if or eq cmd 77 eq cmd 68 +put Apen 0 x +put Apen 1 y +end +if eq cmd 77 +ret true +end +if or eq cmd 76 eq cmd 68 +ret afseg x y +end +ret false +end +fn affloor value long to long +if ge value 0 +ret div value 256 +end +ret neg div add neg value 255 256 +end +fn afbound x long y long to void +if lt x get Ab 0 +put Ab 0 x +end +if lt y get Ab 1 +put Ab 1 y +end +if gt x get Ab 2 +put Ab 2 x +end +if gt y get Ab 3 +put Ab 3 y +end +end +fn afbox to bool +put Ab 0 get Ag 0 +put Ab 2 get Ag 0 +put Ab 1 get Ag 1 +put Ab 3 get Ag 1 +for i ulong get Af 2 +at = mul i 4 +afbound get Ag at get Ag add at 1 +afbound get Ag add at 2 get Ag add at 3 +end +pad = add long get Af 1 256 +x0 = affloor sub get Ab 0 pad +y0 = affloor sub get Ab 1 pad +x1 = add affloor add get Ab 2 pad 1 +y1 = add affloor add get Ab 3 pad 1 +put Ab 0 x0 +put Ab 1 y0 +put Af 3 ulong sub x1 x0 +put Af 4 ulong sub y1 y0 +ret le mul get Af 3 get Af 4 len Alpha +end +fn afproj qx long qy long dx long dy long to ulong +len2 = add mul dx dx mul dy dy +ex = qx +ey = qy +if ne len2 0 +t = add mul qx dx mul qy dy +if gt t 0 +if ge t len2 +ex = sub qx dx +ey = sub qy dy +else +ex = sub qx div mul dx t len2 +ey = sub qy div mul dy t len2 +end +end +end +ret ulong add mul ex ex mul ey ey +end +fn afdist slot ulong px long py long to ulong +at = mul slot 4 +dx = sub get Ag add at 2 get Ag at +dy = sub get Ag add at 3 get Ag add at 1 +qx = sub px get Ag at +qy = sub py get Ag add at 1 +ret afproj qx qy dx dy +end +fn afalpha px long py long to uchar +best = ulong 18446744073709551615 +for i ulong get Af 2 +d2 = afdist i px py +if lt d2 best +best = d2 +end +end +d = long afsqrt best +cov = sub add long get Af 1 128 d +if le cov 0 +ret 0 +end +if ge cov 256 +ret 255 +end +ret uchar div mul cov 255 256 +end +fn afrow y ulong to void +py = add mul add get Ab 1 long y 256 128 +for x ulong get Af 3 +px = add mul add get Ab 0 long x 256 128 +at = add mul y get Af 3 x +put Alpha at afalpha px py +end +end +fn afpaint to void +for y ulong get Af 4 +afrow y +end +end +fn afglyph c uchar to bool +if eq get Af 0 0 +ret false +end +if not afpick c +ret false +end +for i ulong 65536 +put Alpha i 0 +end +put Af 2 0 +put Af 3 0 +put Af 4 1 +put Af 5 0 +put Ab 0 0 +put Ab 1 0 +put Apen 0 0 +put Apen 1 0 +while lt get Afpos 0 get Afpos 1 +cmd = get Afdata get Afpos 0 +put Afpos 0 add get Afpos 0 1 +if not afcmd cmd +ret false +end +end +if eq get Af 2 0 +ret true +end +if not afbox +ret false +end +afpaint +ret true +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +note Independent L762 boundary probe; handwritten Omega assertions. +global SnapAf ulong 6 +global SnapAb long 4 +global FallbackMask uchar 4096 +fn probe ok bool to void +check ok add get Checks 0 1 +end +fn main to int +probe not afinit 0 1 +probe not afinit 65 2500 +probe not afinit 1 0 +probe not afinit 1 2501 +probe afinit 1 1 +probe eq get Af 0 12 +probe eq get Af 1 0 +probe afglyph 32 +probe eq get Af 3 0 +probe eq get Af 4 1 +probe afinit 64 2500 +probe eq get Af 0 819 +probe eq get Af 1 2047 +for c ulong 95 +probe afglyph uchar add c 32 +probe le mul get Af 3 get Af 4 65536 +probe le get Af 2 160 +end +probe afglyph 63 +for i ulong mul get Af 3 get Af 4 +put FallbackMask i get Alpha i +end +for i ulong 6 +put SnapAf i get Af i +end +for i ulong 4 +put SnapAb i get Ab i +end +put Alpha 0 77 +probe not afinit 0 2500 +same = true +for i ulong 6 +if ne get Af i get SnapAf i +same = false +end +end +for i ulong 4 +if ne get Ab i get SnapAb i +same = false +end +end +if ne get Alpha 0 77 +same = false +end +probe same +for bad ulong 3 +c = ulong 0 +if eq bad 1 +c = 127 +end +if eq bad 2 +c = 255 +end +probe afglyph uchar c +same = true +for i ulong 6 +if ne get Af i get SnapAf i +same = false +end +end +for i ulong 4 +if ne get Ab i get SnapAb i +same = false +end +end +for i ulong mul get Af 3 get Af 4 +if ne get Alpha i get FallbackMask i +same = false +end +end +probe same +end +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L758/independent-review/receipts/font-boundary.om b/evidence/allen-omega-L694/L758/independent-review/receipts/font-boundary.om new file mode 100644 index 00000000..0f27a91b --- /dev/null +++ b/evidence/allen-omega-L694/L758/independent-review/receipts/font-boundary.om @@ -0,0 +1,4224 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +note Stable application presentation; see PRESENTATION.md for scope and ownership. +global Ds ulong 8 +global Dt ulong 64 +global Dtext uchar 2304 +global Dsay ulong 1 +global Dm ulong 3 +global Dcode uchar 32768 +global Dstart ulong 4096 +global Dlen ulong 4096 +global Dline ulong 4096 +global Dview ulong 3 +global Din uchar 8192 +fn dscene to bool +n = get Inlen 0 +for i ulong 8192 +put Din i get In i +end +for i ulong get R 8 +put In i get Answer i +end +put Inlen 0 get R 8 +ok = scdecode +for i ulong 8192 +put In i get Din i +end +put Inlen 0 n +if not ok +ret false +end +for i ulong 8 +put Ds i get Sc i +end +for i ulong 64 +put Dt i get Things i +end +for i ulong 2304 +put Dtext i 0 +end +for i ulong get Sc 4 +put Dtext i get Stext i +end +put Dsay 0 get Sw 3 +put Dm 0 1 +ret true +end +fn dcode to bool +if or le get R 2 1 ne get R 1 0 +ret false +end +if or eq get R 6 0 ne get C 0 get R 0 +ret false +end +if not rows 80 4096 +ret false +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong get C 2 +put Dcode i get Code i +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong get View 0 +put Dstart i get Rowst i +put Dlen i get Rowlen i +put Dline i get Rowline i +end +put Dview 0 get View 0 +put Dview 1 0 +put Dview 2 get C 2 +put Dm 1 1 +ret true +end +fn dpresent to bool +if or eq get A 0 0 ne get A 2 1 +ret false +end +if or gt get R 8 159 gt get Inlen 0 8192 +ret false +end +shown = dscene +coded = dcode +if or shown coded +put Dm 2 get R 0 +ret true +end +ret false +end +fn dask now ulong to bool +if not appask now +ret false +end +b = dpresent +ret true +end +fn drecv now ulong to bool +if not appreceive now +ret false +end +b = dpresent +ret true +end +fn dreset to void +appreset +for i ulong 8 +put Ds i 0 +end +for i ulong 64 +put Dt i 0 +end +for i ulong 2304 +put Dtext i 0 +end +put Dsay 0 0 +for i ulong 3 +put Dm i 0 +put Dview i 0 +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong 8192 +put Din i 0 +end +end +note Declarative Allen glyph designs and integer sine samples, retained from +note native/kernel/ui/allen_font.c at4c7888f. No foreign executable implementation. +text Afdata "w6|w6 M3,0 L3,14 D3,20|w10 M3,0 L3,5 M7,0 L7,5|w15 M6,2 L4,20 M11,2 L9,20 M2,8 L13,8 M1,14 L12,14|w15 A8,5,5,5,-30,-270 A8,15,5,5,270,510 M8,-2 L8,22|w16 A4,4,2,3,0,360 A12,16,2,3,0,360 M13,1 L3,19|w16 M14,20 L5,9 A7,5,3,4,150,400 L3,14 A7,15,4,5,180,60 L13,11|w6 M3,0 L3,5|w9 A10,10,6,12,240,120|w9 A-1,10,6,12,-60,60|w14 M7,2 L7,10 M3,4 L11,8 M11,4 L3,8|w14 M2,12 L12,12 M7,7 L7,17|w6 M3,19 L2,23|w11 M2,13 L9,13|w6 D3,20|w12 M10,0 L2,20|w14 A7,10,5,10,0,360|w14 M3,4 L8,0 L8,20|w14 A7,6,5,6,200,400 L2,20 L12,20|w14 A7,5,5,5,200,450 A7,15,5,5,270,520|w14 M10,20 L10,0 L1,14 L13,14|w14 M12,0 L4,0 L4,9 A7,14,5,6,235,520|w14 A7,14,5,6,0,360 M10,0 L3,11|w14 M2,0 L12,0 L5,20|w14 A7,5,4,5,0,360 A7,15,5,5,0,360|w14 A7,6,5,6,0,360 M4,20 L11,9|w6 D3,8 D3,20|w6 D3,8 M3,19 L2,23|w14 M12,6 L2,12 L12,18|w14 M2,10 L12,10 M2,15 L12,15|w14 M2,6 L12,12 L2,18|w14 A7,5,5,5,190,450 L7,14 D7,20|w19 A9,12,3,4,0,360 M12,8 L12,14 A14,14,2,2,180,0 A9,11,7,9,0,-300|w16 M2,20 L8,0 L14,20 M4,13 L12,13|w15 M2,0 L2,20 M2,0 L8,0 A8,5,4,5,270,450 L2,10 M2,10 L9,10 A9,15,4,5,270,450 L2,20|w17 A9,10,7,10,45,315|w16 M2,0 L2,20 M2,0 L6,0 A6,10,8,10,270,450 L2,20|w14 M12,0 L2,0 L2,20 L12,20 M2,10 L10,10|w13 M12,0 L2,0 L2,20 M2,10 L10,10|w18 A9,10,7,10,-45,-360 M11,10 L16,10|w16 M2,0 L2,20 M14,0 L14,20 M2,10 L14,10|w6 M3,0 L3,20|w13 M10,0 L10,14 A6,14,4,6,0,180|w15 M2,0 L2,20 M13,0 L2,12 M6,8 L14,20|w13 M2,0 L2,20 L12,20|w20 M2,20 L2,0 L10,14 L18,0 L18,20|w16 M2,20 L2,0 L14,20 L14,0|w20 A10,10,8,10,0,360|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10|w20 A10,10,8,10,0,360 M12,14 L18,21|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10 M8,10 L14,20|w16 A8,5,5,5,-30,-270 A8,15,5,5,270,510|w16 M1,0 L15,0 M8,0 L8,20|w16 M2,0 L2,13 A8,13,6,7,180,0 L14,0|w16 M1,0 L8,20 L15,0|w22 M1,0 L6,20 L11,0 L16,20 L21,0|w16 M2,0 L14,20 M14,0 L2,20|w16 M1,0 L8,10 L15,0 M8,10 L8,20|w16 M2,0 L14,0 L2,20 L14,20|w9 M7,-1 L3,-1 L3,21 L7,21|w12 M2,0 L10,20|w9 M2,-1 L6,-1 L6,21 L2,21|w12 M2,8 L6,1 L10,8|w14 M1,23 L13,23|w7 M2,0 L4,4|w15 A7,14,5,6,0,360 M12,8 L12,20|w15 M2,0 L2,20 A7,14,5,6,0,360|w13 A7,14,5,6,40,320|w15 A7,14,5,6,0,360 M12,0 L12,20|w14 M2,14 L12,14 A7,14,5,6,0,-320|w11 M5,20 L5,4 A9,4,4,4,180,300 M2,8 L10,8|w15 A7,14,5,6,0,360 M12,8 L12,22 A7,22,5,5,0,150|w15 M2,0 L2,20 A7,13,5,5,180,360 L12,20|w6 M3,8 L3,20 D3,3|w7 M4,8 L4,22 A0,22,4,5,0,120 D4,3|w13 M2,0 L2,20 M11,8 L2,15 M5,13 L12,20|w6 M3,0 L3,20|w21 M2,8 L2,20 A6,12,4,4,180,360 L10,20 A14,12,4,4,180,360 L18,20|w15 M2,8 L2,20 A7,13,5,5,180,360 L12,20|w14 A7,14,5,6,0,360|w15 M2,8 L2,27 A7,14,5,6,0,360|w15 A7,14,5,6,0,360 M12,8 L12,27|w10 M2,8 L2,20 A7,13,5,5,180,290|w14 A7,11,4,3,-30,-270 A7,17,4,3,270,510|w11 M5,2 L5,17 A8,17,3,3,180,40 M2,8 L10,8|w15 M2,8 L2,15 A7,15,5,5,180,0 M12,8 L12,20|w14 M2,8 L7,20 L12,8|w20 M2,8 L6,20 L10,8 L14,20 L18,8|w14 M2,8 L12,20 M12,8 L2,20|w14 M2,8 L7,20 M12,8 L4,27|w14 M2,8 L12,8 L2,20 L12,20|w10 M8,-1 L6,0 L6,8 L4,10 L6,12 L6,20 L8,21|w6 M3,-1 L3,23|w10 M2,-1 L4,0 L4,8 L6,10 L4,12 L4,20 L2,21|w14 M2,13 L5,11 L9,14 L12,12|" +text Afsines "0 286 572 857 1143 1428 1713 1997 2280 2563 2845 3126 3406 3686 3964 4240 4516 4790 5063 5334 5604 5872 6138 6402 6664 6924 7182 7438 7692 7943 8192 8438 8682 8923 9162 9397 9630 9860 10087 10311 10531 10749 10963 11174 11381 11585 11786 11982 12176 12365 12551 12733 12911 13085 13255 13421 13583 13741 13894 14044 14189 14330 14466 14598 14726 14849 14968 15082 15191 15296 15396 15491 15582 15668 15749 15826 15897 15964 16026 16083 16135 16182 16225 16262 16294 16322 16344 16362 16374 16382 16384 " +note Handwritten bounded Allen stroke rasterizer. Legacy C is an external oracle only. +global Af ulong 6 +global Ab long 4 +global Ag long 640 +global Alpha uchar 65536 +global Asin long 91 +global Afpos ulong 2 +global Apen long 2 +global Arc long 6 +fn afsqrt value ulong to ulong +r = ulong 0 +bit = shl ulong 1 62 +while gt bit value +bit = shr bit 2 +end +while ne bit 0 +if ge value add r bit +value = sub value add r bit +r = add shr r 1 bit +else +r = shr r 1 +end +bit = shr bit 2 +end +ret r +end +fn afsin deg long to long +a = rem deg 360 +if lt a 0 +a = add a 360 +end +if le a 90 +ret get Asin ulong a +end +if le a 180 +ret get Asin ulong sub long 180 a +end +if le a 270 +ret neg get Asin ulong sub a 180 +end +ret neg get Asin ulong sub long 360 a +end +fn afcos deg long to long +ret afsin add rem deg 360 90 +end +fn afinit cap ulong wt ulong to bool +if or eq cap 0 gt cap 64 +ret false +end +if or eq wt 0 gt wt 2500 +ret false +end +for i ulong 6 +put Af i 0 +end +put Af 0 div mul cap 256 20 +put Af 1 div mul wt get Af 0 1000 +v = long 0 +slot = ulong 0 +for i ulong len Afsines +c = get Afsines i +if eq c 32 +put Asin slot v +slot = add slot 1 +v = 0 +else +v = add mul v 10 sub long c 48 +end +end +ret eq slot 91 +end +fn afpick c uchar to bool +if or lt c 32 gt c 126 +c = 63 +end +wanted = sub ulong c 32 +slot = ulong 0 +startat = ulong 0 +for i ulong len Afdata +if eq get Afdata i 124 +if eq slot wanted +put Afpos 0 startat +put Afpos 1 i +ret true +end +slot = add slot 1 +startat = add i 1 +end +end +ret false +end +fn afnum to long +p = get Afpos 0 +minus = false +if eq get Afdata p 45 +minus = true +p = add p 1 +end +v = long 0 +go = true +while and lt p get Afpos 1 go +c = get Afdata p +if and ge c 48 le c 57 +v = add mul v 10 sub long c 48 +p = add p 1 +else +go = false +end +end +if lt p get Afpos 1 +if eq get Afdata p 44 +p = add p 1 +end +end +put Afpos 0 p +if minus +ret neg v +end +ret v +end +fn afseg nx long ny long to bool +n = get Af 2 +if ge n 160 +ret false +end +at = mul n 4 +put Ag at get Apen 0 +put Ag add at 1 get Apen 1 +put Ag add at 2 nx +put Ag add at 3 ny +put Apen 0 nx +put Apen 1 ny +put Af 2 add n 1 +ret true +end +fn afpoint a long first bool to bool +s = long get Af 0 +x = mul get Arc 0 s +x = add x div mul mul get Arc 2 s afcos a 16384 +y = mul sub get Arc 1 20 s +y = add y div mul mul get Arc 3 s afsin a 16384 +if first +put Apen 0 x +put Apen 1 y +ret true +end +ret afseg x y +end +fn afarc to bool +for i ulong 6 +put Arc i afnum +end +span = sub get Arc 5 get Arc 4 +if lt span 0 +span = neg span +end +steps = div span 9 +if lt steps 2 +steps = 2 +end +for k ulong ulong add steps 1 +a = sub get Arc 5 get Arc 4 +a = add get Arc 4 div mul a long k steps +if not afpoint a eq k 0 +ret false +end +end +ret true +end +fn afcmd cmd uchar to bool +if eq cmd 32 +ret true +end +if eq cmd 119 +put Af 5 mul ulong afnum get Af 0 +ret true +end +if eq cmd 65 +ret afarc +end +x = mul afnum long get Af 0 +y = mul sub afnum 20 long get Af 0 +if or eq cmd 77 eq cmd 68 +put Apen 0 x +put Apen 1 y +end +if eq cmd 77 +ret true +end +if or eq cmd 76 eq cmd 68 +ret afseg x y +end +ret false +end +fn affloor value long to long +if ge value 0 +ret div value 256 +end +ret neg div add neg value 255 256 +end +fn afbound x long y long to void +if lt x get Ab 0 +put Ab 0 x +end +if lt y get Ab 1 +put Ab 1 y +end +if gt x get Ab 2 +put Ab 2 x +end +if gt y get Ab 3 +put Ab 3 y +end +end +fn afbox to bool +put Ab 0 get Ag 0 +put Ab 2 get Ag 0 +put Ab 1 get Ag 1 +put Ab 3 get Ag 1 +for i ulong get Af 2 +at = mul i 4 +afbound get Ag at get Ag add at 1 +afbound get Ag add at 2 get Ag add at 3 +end +pad = add long get Af 1 256 +x0 = affloor sub get Ab 0 pad +y0 = affloor sub get Ab 1 pad +x1 = add affloor add get Ab 2 pad 1 +y1 = add affloor add get Ab 3 pad 1 +put Ab 0 x0 +put Ab 1 y0 +put Af 3 ulong sub x1 x0 +put Af 4 ulong sub y1 y0 +ret le mul get Af 3 get Af 4 len Alpha +end +fn afproj qx long qy long dx long dy long to ulong +len2 = add mul dx dx mul dy dy +ex = qx +ey = qy +if ne len2 0 +t = add mul qx dx mul qy dy +if gt t 0 +if ge t len2 +ex = sub qx dx +ey = sub qy dy +else +ex = sub qx div mul dx t len2 +ey = sub qy div mul dy t len2 +end +end +end +ret ulong add mul ex ex mul ey ey +end +fn afdist slot ulong px long py long to ulong +at = mul slot 4 +dx = sub get Ag add at 2 get Ag at +dy = sub get Ag add at 3 get Ag add at 1 +qx = sub px get Ag at +qy = sub py get Ag add at 1 +ret afproj qx qy dx dy +end +fn afalpha px long py long to uchar +best = ulong 18446744073709551615 +for i ulong get Af 2 +d2 = afdist i px py +if lt d2 best +best = d2 +end +end +d = long afsqrt best +cov = sub add long get Af 1 128 d +if le cov 0 +ret 0 +end +if ge cov 256 +ret 255 +end +ret uchar div mul cov 255 256 +end +fn afrow y ulong to void +py = add mul add get Ab 1 long y 256 128 +for x ulong get Af 3 +px = add mul add get Ab 0 long x 256 128 +at = add mul y get Af 3 x +put Alpha at afalpha px py +end +end +fn afpaint to void +for y ulong get Af 4 +afrow y +end +end +fn afglyph c uchar to bool +if eq get Af 0 0 +ret false +end +if not afpick c +ret false +end +for i ulong 65536 +put Alpha i 0 +end +put Af 2 0 +put Af 3 0 +put Af 4 1 +put Af 5 0 +put Ab 0 0 +put Ab 1 0 +put Apen 0 0 +put Apen 1 0 +while lt get Afpos 0 get Afpos 1 +cmd = get Afdata get Afpos 0 +put Afpos 0 add get Afpos 0 1 +if not afcmd cmd +ret false +end +end +if eq get Af 2 0 +ret true +end +if not afbox +ret false +end +afpaint +ret true +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +note Independent L762 boundary probe; handwritten Omega assertions. +global SnapAf ulong 6 +global SnapAb long 4 +fn probe ok bool to void +check ok add get Checks 0 1 +end +fn main to int +probe not afinit 0 1 +probe not afinit 65 2500 +probe not afinit 1 0 +probe not afinit 1 2501 +probe afinit 1 1 +probe eq get Af 0 12 +probe eq get Af 1 0 +probe afglyph 32 +probe eq get Af 3 0 +probe eq get Af 4 1 +probe afinit 64 2500 +probe eq get Af 0 819 +probe eq get Af 1 2047 +for c ulong 95 +probe afglyph uchar add c 32 +probe le mul get Af 3 get Af 4 65536 +probe le get Af 2 160 +end +probe afglyph 63 +for i ulong 6 +put SnapAf i get Af i +end +for i ulong 4 +put SnapAb i get Ab i +end +put Alpha 0 77 +probe not afinit 0 2500 +same = true +for i ulong 6 +if ne get Af i get SnapAf i +same = false +end +end +for i ulong 4 +if ne get Ab i get SnapAb i +same = false +end +end +if ne get Alpha 0 77 +same = false +end +probe same +probe afglyph 0 +probe afglyph 63 +probe eq get Af 3 get SnapAf 3 +probe afglyph 127 +probe eq get Af 3 get SnapAf 3 +probe afglyph 255 +probe eq get Af 3 get SnapAf 3 +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L758/independent-review/receipts/font-core.om b/evidence/allen-omega-L694/L758/independent-review/receipts/font-core.om new file mode 100644 index 00000000..b1e69161 --- /dev/null +++ b/evidence/allen-omega-L694/L758/independent-review/receipts/font-core.om @@ -0,0 +1,4146 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +note Stable application presentation; see PRESENTATION.md for scope and ownership. +global Ds ulong 8 +global Dt ulong 64 +global Dtext uchar 2304 +global Dsay ulong 1 +global Dm ulong 3 +global Dcode uchar 32768 +global Dstart ulong 4096 +global Dlen ulong 4096 +global Dline ulong 4096 +global Dview ulong 3 +global Din uchar 8192 +fn dscene to bool +n = get Inlen 0 +for i ulong 8192 +put Din i get In i +end +for i ulong get R 8 +put In i get Answer i +end +put Inlen 0 get R 8 +ok = scdecode +for i ulong 8192 +put In i get Din i +end +put Inlen 0 n +if not ok +ret false +end +for i ulong 8 +put Ds i get Sc i +end +for i ulong 64 +put Dt i get Things i +end +for i ulong 2304 +put Dtext i 0 +end +for i ulong get Sc 4 +put Dtext i get Stext i +end +put Dsay 0 get Sw 3 +put Dm 0 1 +ret true +end +fn dcode to bool +if or le get R 2 1 ne get R 1 0 +ret false +end +if or eq get R 6 0 ne get C 0 get R 0 +ret false +end +if not rows 80 4096 +ret false +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong get C 2 +put Dcode i get Code i +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong get View 0 +put Dstart i get Rowst i +put Dlen i get Rowlen i +put Dline i get Rowline i +end +put Dview 0 get View 0 +put Dview 1 0 +put Dview 2 get C 2 +put Dm 1 1 +ret true +end +fn dpresent to bool +if or eq get A 0 0 ne get A 2 1 +ret false +end +if or gt get R 8 159 gt get Inlen 0 8192 +ret false +end +shown = dscene +coded = dcode +if or shown coded +put Dm 2 get R 0 +ret true +end +ret false +end +fn dask now ulong to bool +if not appask now +ret false +end +b = dpresent +ret true +end +fn drecv now ulong to bool +if not appreceive now +ret false +end +b = dpresent +ret true +end +fn dreset to void +appreset +for i ulong 8 +put Ds i 0 +end +for i ulong 64 +put Dt i 0 +end +for i ulong 2304 +put Dtext i 0 +end +put Dsay 0 0 +for i ulong 3 +put Dm i 0 +put Dview i 0 +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong 8192 +put Din i 0 +end +end +note Declarative Allen glyph designs and integer sine samples, retained from +note native/kernel/ui/allen_font.c at4c7888f. No foreign executable implementation. +text Afdata "w6|w6 M3,0 L3,14 D3,20|w10 M3,0 L3,5 M7,0 L7,5|w15 M6,2 L4,20 M11,2 L9,20 M2,8 L13,8 M1,14 L12,14|w15 A8,5,5,5,-30,-270 A8,15,5,5,270,510 M8,-2 L8,22|w16 A4,4,2,3,0,360 A12,16,2,3,0,360 M13,1 L3,19|w16 M14,20 L5,9 A7,5,3,4,150,400 L3,14 A7,15,4,5,180,60 L13,11|w6 M3,0 L3,5|w9 A10,10,6,12,240,120|w9 A-1,10,6,12,-60,60|w14 M7,2 L7,10 M3,4 L11,8 M11,4 L3,8|w14 M2,12 L12,12 M7,7 L7,17|w6 M3,19 L2,23|w11 M2,13 L9,13|w6 D3,20|w12 M10,0 L2,20|w14 A7,10,5,10,0,360|w14 M3,4 L8,0 L8,20|w14 A7,6,5,6,200,400 L2,20 L12,20|w14 A7,5,5,5,200,450 A7,15,5,5,270,520|w14 M10,20 L10,0 L1,14 L13,14|w14 M12,0 L4,0 L4,9 A7,14,5,6,235,520|w14 A7,14,5,6,0,360 M10,0 L3,11|w14 M2,0 L12,0 L5,20|w14 A7,5,4,5,0,360 A7,15,5,5,0,360|w14 A7,6,5,6,0,360 M4,20 L11,9|w6 D3,8 D3,20|w6 D3,8 M3,19 L2,23|w14 M12,6 L2,12 L12,18|w14 M2,10 L12,10 M2,15 L12,15|w14 M2,6 L12,12 L2,18|w14 A7,5,5,5,190,450 L7,14 D7,20|w19 A9,12,3,4,0,360 M12,8 L12,14 A14,14,2,2,180,0 A9,11,7,9,0,-300|w16 M2,20 L8,0 L14,20 M4,13 L12,13|w15 M2,0 L2,20 M2,0 L8,0 A8,5,4,5,270,450 L2,10 M2,10 L9,10 A9,15,4,5,270,450 L2,20|w17 A9,10,7,10,45,315|w16 M2,0 L2,20 M2,0 L6,0 A6,10,8,10,270,450 L2,20|w14 M12,0 L2,0 L2,20 L12,20 M2,10 L10,10|w13 M12,0 L2,0 L2,20 M2,10 L10,10|w18 A9,10,7,10,-45,-360 M11,10 L16,10|w16 M2,0 L2,20 M14,0 L14,20 M2,10 L14,10|w6 M3,0 L3,20|w13 M10,0 L10,14 A6,14,4,6,0,180|w15 M2,0 L2,20 M13,0 L2,12 M6,8 L14,20|w13 M2,0 L2,20 L12,20|w20 M2,20 L2,0 L10,14 L18,0 L18,20|w16 M2,20 L2,0 L14,20 L14,0|w20 A10,10,8,10,0,360|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10|w20 A10,10,8,10,0,360 M12,14 L18,21|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10 M8,10 L14,20|w16 A8,5,5,5,-30,-270 A8,15,5,5,270,510|w16 M1,0 L15,0 M8,0 L8,20|w16 M2,0 L2,13 A8,13,6,7,180,0 L14,0|w16 M1,0 L8,20 L15,0|w22 M1,0 L6,20 L11,0 L16,20 L21,0|w16 M2,0 L14,20 M14,0 L2,20|w16 M1,0 L8,10 L15,0 M8,10 L8,20|w16 M2,0 L14,0 L2,20 L14,20|w9 M7,-1 L3,-1 L3,21 L7,21|w12 M2,0 L10,20|w9 M2,-1 L6,-1 L6,21 L2,21|w12 M2,8 L6,1 L10,8|w14 M1,23 L13,23|w7 M2,0 L4,4|w15 A7,14,5,6,0,360 M12,8 L12,20|w15 M2,0 L2,20 A7,14,5,6,0,360|w13 A7,14,5,6,40,320|w15 A7,14,5,6,0,360 M12,0 L12,20|w14 M2,14 L12,14 A7,14,5,6,0,-320|w11 M5,20 L5,4 A9,4,4,4,180,300 M2,8 L10,8|w15 A7,14,5,6,0,360 M12,8 L12,22 A7,22,5,5,0,150|w15 M2,0 L2,20 A7,13,5,5,180,360 L12,20|w6 M3,8 L3,20 D3,3|w7 M4,8 L4,22 A0,22,4,5,0,120 D4,3|w13 M2,0 L2,20 M11,8 L2,15 M5,13 L12,20|w6 M3,0 L3,20|w21 M2,8 L2,20 A6,12,4,4,180,360 L10,20 A14,12,4,4,180,360 L18,20|w15 M2,8 L2,20 A7,13,5,5,180,360 L12,20|w14 A7,14,5,6,0,360|w15 M2,8 L2,27 A7,14,5,6,0,360|w15 A7,14,5,6,0,360 M12,8 L12,27|w10 M2,8 L2,20 A7,13,5,5,180,290|w14 A7,11,4,3,-30,-270 A7,17,4,3,270,510|w11 M5,2 L5,17 A8,17,3,3,180,40 M2,8 L10,8|w15 M2,8 L2,15 A7,15,5,5,180,0 M12,8 L12,20|w14 M2,8 L7,20 L12,8|w20 M2,8 L6,20 L10,8 L14,20 L18,8|w14 M2,8 L12,20 M12,8 L2,20|w14 M2,8 L7,20 M12,8 L4,27|w14 M2,8 L12,8 L2,20 L12,20|w10 M8,-1 L6,0 L6,8 L4,10 L6,12 L6,20 L8,21|w6 M3,-1 L3,23|w10 M2,-1 L4,0 L4,8 L6,10 L4,12 L4,20 L2,21|w14 M2,13 L5,11 L9,14 L12,12|" +text Afsines "0 286 572 857 1143 1428 1713 1997 2280 2563 2845 3126 3406 3686 3964 4240 4516 4790 5063 5334 5604 5872 6138 6402 6664 6924 7182 7438 7692 7943 8192 8438 8682 8923 9162 9397 9630 9860 10087 10311 10531 10749 10963 11174 11381 11585 11786 11982 12176 12365 12551 12733 12911 13085 13255 13421 13583 13741 13894 14044 14189 14330 14466 14598 14726 14849 14968 15082 15191 15296 15396 15491 15582 15668 15749 15826 15897 15964 16026 16083 16135 16182 16225 16262 16294 16322 16344 16362 16374 16382 16384 " +note Handwritten bounded Allen stroke rasterizer. Legacy C is an external oracle only. +global Af ulong 6 +global Ab long 4 +global Ag long 640 +global Alpha uchar 65536 +global Asin long 91 +global Afpos ulong 2 +global Apen long 2 +global Arc long 6 +fn afsqrt value ulong to ulong +r = ulong 0 +bit = shl ulong 1 62 +while gt bit value +bit = shr bit 2 +end +while ne bit 0 +if ge value add r bit +value = sub value add r bit +r = add shr r 1 bit +else +r = shr r 1 +end +bit = shr bit 2 +end +ret r +end +fn afsin deg long to long +a = rem deg 360 +if lt a 0 +a = add a 360 +end +if le a 90 +ret get Asin ulong a +end +if le a 180 +ret get Asin ulong sub long 180 a +end +if le a 270 +ret neg get Asin ulong sub a 180 +end +ret neg get Asin ulong sub long 360 a +end +fn afcos deg long to long +ret afsin add rem deg 360 90 +end +fn afinit cap ulong wt ulong to bool +if or eq cap 0 gt cap 64 +ret false +end +if or eq wt 0 gt wt 2500 +ret false +end +for i ulong 6 +put Af i 0 +end +put Af 0 div mul cap 256 20 +put Af 1 div mul wt get Af 0 1000 +v = long 0 +slot = ulong 0 +for i ulong len Afsines +c = get Afsines i +if eq c 32 +put Asin slot v +slot = add slot 1 +v = 0 +else +v = add mul v 10 sub long c 48 +end +end +ret eq slot 91 +end +fn afpick c uchar to bool +if or lt c 32 gt c 126 +c = 63 +end +wanted = sub ulong c 32 +slot = ulong 0 +startat = ulong 0 +for i ulong len Afdata +if eq get Afdata i 124 +if eq slot wanted +put Afpos 0 startat +put Afpos 1 i +ret true +end +slot = add slot 1 +startat = add i 1 +end +end +ret false +end +fn afnum to long +p = get Afpos 0 +minus = false +if eq get Afdata p 45 +minus = true +p = add p 1 +end +v = long 0 +go = true +while and lt p get Afpos 1 go +c = get Afdata p +if and ge c 48 le c 57 +v = add mul v 10 sub long c 48 +p = add p 1 +else +go = false +end +end +if lt p get Afpos 1 +if eq get Afdata p 44 +p = add p 1 +end +end +put Afpos 0 p +if minus +ret neg v +end +ret v +end +fn afseg nx long ny long to bool +n = get Af 2 +if ge n 160 +ret false +end +at = mul n 4 +put Ag at get Apen 0 +put Ag add at 1 get Apen 1 +put Ag add at 2 nx +put Ag add at 3 ny +put Apen 0 nx +put Apen 1 ny +put Af 2 add n 1 +ret true +end +fn afpoint a long first bool to bool +s = long get Af 0 +x = mul get Arc 0 s +x = add x div mul mul get Arc 2 s afcos a 16384 +y = mul sub get Arc 1 20 s +y = add y div mul mul get Arc 3 s afsin a 16384 +if first +put Apen 0 x +put Apen 1 y +ret true +end +ret afseg x y +end +fn afarc to bool +for i ulong 6 +put Arc i afnum +end +span = sub get Arc 5 get Arc 4 +if lt span 0 +span = neg span +end +steps = div span 9 +if lt steps 2 +steps = 2 +end +for k ulong ulong add steps 1 +a = sub get Arc 5 get Arc 4 +a = add get Arc 4 div mul a long k steps +if not afpoint a eq k 0 +ret false +end +end +ret true +end +fn afcmd cmd uchar to bool +if eq cmd 32 +ret true +end +if eq cmd 119 +put Af 5 mul ulong afnum get Af 0 +ret true +end +if eq cmd 65 +ret afarc +end +x = mul afnum long get Af 0 +y = mul sub afnum 20 long get Af 0 +if or eq cmd 77 eq cmd 68 +put Apen 0 x +put Apen 1 y +end +if eq cmd 77 +ret true +end +if or eq cmd 76 eq cmd 68 +ret afseg x y +end +ret false +end +fn affloor value long to long +if ge value 0 +ret div value 256 +end +ret neg div add neg value 255 256 +end +fn afbound x long y long to void +if lt x get Ab 0 +put Ab 0 x +end +if lt y get Ab 1 +put Ab 1 y +end +if gt x get Ab 2 +put Ab 2 x +end +if gt y get Ab 3 +put Ab 3 y +end +end +fn afbox to bool +put Ab 0 get Ag 0 +put Ab 2 get Ag 0 +put Ab 1 get Ag 1 +put Ab 3 get Ag 1 +for i ulong get Af 2 +at = mul i 4 +afbound get Ag at get Ag add at 1 +afbound get Ag add at 2 get Ag add at 3 +end +pad = add long get Af 1 256 +x0 = affloor sub get Ab 0 pad +y0 = affloor sub get Ab 1 pad +x1 = add affloor add get Ab 2 pad 1 +y1 = add affloor add get Ab 3 pad 1 +put Ab 0 x0 +put Ab 1 y0 +put Af 3 ulong sub x1 x0 +put Af 4 ulong sub y1 y0 +ret le mul get Af 3 get Af 4 len Alpha +end +fn afproj qx long qy long dx long dy long to ulong +len2 = add mul dx dx mul dy dy +ex = qx +ey = qy +if ne len2 0 +t = add mul qx dx mul qy dy +if gt t 0 +if ge t len2 +ex = sub qx dx +ey = sub qy dy +else +ex = sub qx div mul dx t len2 +ey = sub qy div mul dy t len2 +end +end +end +ret ulong add mul ex ex mul ey ey +end +fn afdist slot ulong px long py long to ulong +at = mul slot 4 +dx = sub get Ag add at 2 get Ag at +dy = sub get Ag add at 3 get Ag add at 1 +qx = sub px get Ag at +qy = sub py get Ag add at 1 +ret afproj qx qy dx dy +end +fn afalpha px long py long to uchar +best = ulong 18446744073709551615 +for i ulong get Af 2 +d2 = afdist i px py +if lt d2 best +best = d2 +end +end +d = long afsqrt best +cov = sub add long get Af 1 128 d +if le cov 0 +ret 0 +end +if ge cov 256 +ret 255 +end +ret uchar div mul cov 255 256 +end +fn afrow y ulong to void +py = add mul add get Ab 1 long y 256 128 +for x ulong get Af 3 +px = add mul add get Ab 0 long x 256 128 +at = add mul y get Af 3 x +put Alpha at afalpha px py +end +end +fn afpaint to void +for y ulong get Af 4 +afrow y +end +end +fn afglyph c uchar to bool +if eq get Af 0 0 +ret false +end +if not afpick c +ret false +end +for i ulong 65536 +put Alpha i 0 +end +put Af 2 0 +put Af 3 0 +put Af 4 1 +put Af 5 0 +put Ab 0 0 +put Ab 1 0 +put Apen 0 0 +put Apen 1 0 +while lt get Afpos 0 get Afpos 1 +cmd = get Afdata get Afpos 0 +put Afpos 0 add get Afpos 0 1 +if not afcmd cmd +ret false +end +end +if eq get Af 2 0 +ret true +end +if not afbox +ret false +end +afpaint +ret true +end diff --git a/evidence/allen-omega-L694/L758/independent-review/report.md b/evidence/allen-omega-L694/L758/independent-review/report.md new file mode 100644 index 00000000..ad4dcbe9 --- /dev/null +++ b/evidence/allen-omega-L694/L758/independent-review/report.md @@ -0,0 +1,38 @@ +# L758 handwritten Omega font review + +**Verdict:** no font-component defect found in the reviewed pin. This is a static-source and native-host test review, not UI/device acceptance. + +## Scope and immutable source closure + +Reviewed `native/omega/allen/font.om`, `font-data.om`, `FONT.md`, the focused font tests/output/render fixture and the small gate/build integration at `61ef587ee5d24bf862705f51bffb8039c9a2ed01` (base `4c7888f65dca209a1e2b859ba695ae308657c03e`). At closure verification, HEAD was the pin and the worktree was clean. All 26 declared compiler/test/integration sources were byte-equal to `git show :`; their SHA-256 values and the check are in `receipts/closure.log` (`CLOSURE_OK files=26`). The separate legacy reference source hash is `92d7157386e65351325d80d5036565e406145230dfb696c9804ec80888d26904`; frozen oracle hash is `0dc4abaa8c8cc1c5a79772bdd00b2d74458beac6ccfe85637069d04c77a7ff69` (436341 bytes, 294 records). This supports external-reference provenance; the C oracle is not a native construction/runtime backend. + +Pinned compiler: `~/handoffs/allen-omega-L694/omc`, SHA-256 `191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9`. Focused ELF is verified ELF64, AArch64, static EXEC, with no INTERP/NEEDED. Its hash and tool details appear in `receipts/closure.log` / `receipts/focused.sha256`. + +## Verification + +Executed the focused test build through `quiet-build` and the exact-pin `native/omega/allen/build-one.sh`, then ran its ELF: **421 emitted assertions, all `0`, exit 0**. Recounted emitted lines rather than relying on the parent summary. + +Added `probes/font-boundary.om`, handwritten seeded Omega, and compiled/run it with the same pinned build path: **308 emitted assertions, all `0`, exit 0**. It exercises the four inclusive/exclusive cap/weight boundary failures, valid extreme cap/weight settings, all 95 printable glyphs at maximum size/weight with mask-area and segment-count limits, zero-area space behavior, invalid `afinit` preserving all Af/Ab fields and a mask sentinel, and unsupported-byte fallback metric behavior. Raw probe source, concatenated executable input, ELF, output, and SHA-256s are retained under `probes/` and `receipts/`. + +Source review: invalid `afinit` inputs return before modifying state (`font.om:46-51`); valid setup uses fixed globals and initializes the 91-entry table (`:53-70`). The segment writer rejects counts at 160 (`:121-135`), mask bounds are checked against the 65536-byte alpha buffer (`:215-235`), and unsupported input maps to `?` (`:72-90`). Existing focused tests also cover full-width integer sqrt, signed trig, printable glyph rendering, maximum settings, fallback and invalid-init state preservation (`tests/font.om`). Parent evidence records exact native/oracle stream equivalence and specimen inspection; those are cited as prior evidence, not re-run as a UI acceptance claim. + +**Findings:** none, within this component scope. I did not independently compare every fallback mask byte to `?`; the parent’s frozen-oracle evidence and focused suite cover the broader mask equivalence claims. + +## Commands and receipts + +From `/home/drakestapleton/workspace/aienos-allen-omega-L694` on Spark: + +```sh +quiet-build native/omega/allen/build-one.sh ~/handoffs/L762-review/receipts/focused-font.om ~/handoffs/L762-review/receipts/focused-font.elf +~/handoffs/L762-review/receipts/focused-font.elf > ~/handoffs/L762-review/receipts/focused-font.log +quiet-build native/omega/allen/build-one.sh ~/handoffs/L762-review/receipts/font-boundary.om ~/handoffs/L762-review/receipts/font-boundary3.elf +~/handoffs/L762-review/receipts/font-boundary3.elf > ~/handoffs/L762-review/receipts/boundary.log +``` + +The exact build concatenations are preserved as `receipts/focused-font.om` and `receipts/font-boundary.om`; command output/hashes are in `receipts/focused-build.log`, `focused-font.log`, `focused.sha256`, `boundary-build.log`, `boundary.log`, and `boundary.sha256`. Source/object membership receipts: `receipts/closure.log`. + +Probe authoring had two compiler-fixture corrections, not product failures: an initial concatenation placed the check helper after the probe (`boundary-build2.log`, compiler error 3), then oversized extra global scratch arrays exceeded compiler storage (`boundary-final2-build.log`, error 13; corrected in final probe). Raw failed compile receipts are retained. The production worktree was untouched by this review; a later status check observed an unrelated concurrent modification to `native/omega/allen/tests/provider-core.om`, which was not inspected or changed. + +## Limits + +No full suite, 19-mutant rerun, provider/presentation re-review, deployment, service/agent restart, live transport, complete scene/layout, framebuffer/device, or physical iMac acceptance was performed. diff --git a/evidence/allen-omega-L694/L758/inputtail-mutant.log b/evidence/allen-omega-L694/L758/inputtail-mutant.log new file mode 100644 index 00000000..c0415908 --- /dev/null +++ b/evidence/allen-omega-L694/L758/inputtail-mutant.log @@ -0,0 +1,75 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 1 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 diff --git a/evidence/allen-omega-L694/L758/intent.log b/evidence/allen-omega-L694/L758/intent.log new file mode 100644 index 00000000..5371bd36 --- /dev/null +++ b/evidence/allen-omega-L694/L758/intent.log @@ -0,0 +1,8 @@ +501 0 +502 0 +503 0 +504 0 +505 0 +506 0 +507 0 +508 0 diff --git a/evidence/allen-omega-L694/L758/inventory.json b/evidence/allen-omega-L694/L758/inventory.json new file mode 100644 index 00000000..a11ed201 --- /dev/null +++ b/evidence/allen-omega-L694/L758/inventory.json @@ -0,0 +1,81 @@ +{ + "README.md": "01e4a8de1efc0e51aa672e34133d4714eb3dd29ae3eb6b9f342f98e6d22b6097", + "ackstop-mutant.log": "e35f80780a1c1769657287485e65ca25ab222d99277482c91900418d6dc6d433", + "appcode-mutant.log": "087522069b49d76999d8a495fccbff79cad4ff1fdf1d3ebf1e15855d6c959dc1", + "application.log": "799a91676cc7a8b0f4d027392ad8dda0e26af0501906ad906ae1ec8b1703d30a", + "autosent-mutant.log": "fd09242df722583c7e04568d177eed33aeec3b4fbc67f8d1cba666941a81bf08", + "binaries.sha256": "9729f5f5b123f81bc4bd8550de25b57d334f13a94ddb9f6c8eafc0f755f90bee", + "code.log": "f4d91fae8c90949b5538689d148384c72984c34d8f84507b499cbb75349ec390", + "context.log": "a93a138b2ffb8a544174d9bc55e3e5e8b7d0f2531f4aff76030eba22e7c7b5e0", + "contextjob-mutant.log": "4f32375d7357e7ebd07106f23fada35d235ad7756a9aba91f6a556fae4d39c3b", + "contextnote-mutant.log": "528e41cd827af033d9f5391f011aba3c9e348051a57916c0c5d52c9e263f87a5", + "courier.log": "466116a0daf08d362ded3aab678a6213671cc17e82ead4bd6fdc5dcedf1674f1", + "crc-mutant.log": "d640ebbfc3be10156ce28e7972bd9931390e4a2c18f90099997e4bd94d941835", + "edges.log": "c3c33b435c05aebcb2c86e76121ca0681bcc58c52bc1388b5a8b47258c5603ed", + "font-specimen.png": "e4e6800797c0ab91d415ce1fe5837d57def56b2246e2f9f0762feb3294f08893", + "font-specimen.ppm": "dec95182af5faa01ed739336ed32dcadd5168e6be35bef310042fe032113ee7f", + "font.log": "e740379ab582a55deec96e1e2cc0ad550b217409e78ea906b415765b522c028d", + "fontalpha-mutant.log": "4a9357c64f7baaff5d6ccce7396f34ae76c40d22b2df4e0262df3c90ba8b77f3", + "fontroot-mutant.log": "877fce5a15491776440a7318117a847f974aea016b3a2f162c8644302d02d0fc", + "framecheck-mutant.log": "80857ef43f4767086a5154d915825e2d9ab8e1dacf7382cd9cec20a6c9e945eb", + "full.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa", + "full.log": "d170c10744417686fd9a248330a3f12cce4bd025e8b3bfcc8a34499bbbe5722d", + "green2.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa", + "green2.log": "b104283bfe230886524bfa28392b62a558f2023ac3b4284b3670b6fe6f5f1757", + "hash-mutant.log": "e2900d31ceb87ff95fb84cac73a1e6aa3a0100eebaada0432ec50c2471cd437e", + "inputtail-mutant.log": "48170607e958bb62a28b6a05bf184a3fcf16b5a0ec76bed8b7fa2bcc0b9a9d67", + "intent.log": "920955281e985095ba5d24b01370dcb7fc022559df06892bfc120a9fc6a04345", + "keepalive-mutant.log": "9cf7f699f4c0a01694b4d3d557857d95fa76bdf5d7d2d58571aef3b9e66da10e", + "legacy-font.bin": "0dc4abaa8c8cc1c5a79772bdd00b2d74458beac6ccfe85637069d04c77a7ff69", + "legacy-oracle-collection.txt": "5f4223786948d65becb6fe0769af293d66f70a96b89ea3bfb96c3e5ec2330975", + "long.log": "b37fc9e675de395d9cba4c2e74ae7ea210e617927691c9f1df4896ae1bafe508", + "memory.log": "d8ad7727ab1536ed00ab2a63f0a056e4e4cc237571077c36573952a4c49c9a15", + "native-font.bin": "8a9adeeace1aa3e577a61c220d5fc66afd0c5959263f18736303432d0b44f6bb", + "oracle.json": "cdcace13b1b026ff645e1beb296f3a52bc03debcf6fc5b8e542afdcff59fedfa", + "output.om": "cc333e6cdefd18638bbe199128314f4f94bb478710ce6e53bd5e141e58f9b541", + "paint.log": "ab43be8b6b42efc70663a0e14d0b44aec7c0766bbb961af2da77d2737f78a81a", + "pendingwire-mutant.log": "6a48c141724f07b9adf2a4da28802544ab29d2d3f42fe1eacb3ef45df2d96657", + "presentation.log": "c43d43223e83f0d34b868be1fa08b0fa42386f72938a8f59e24811f84aad37e7", + "provider-bad-1.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c", + "provider-bad-1.receipt": "4a4a5cc6008f0286443686c10c17919e7e3a3e2258a6b97bf06311c9afe0dfe4", + "provider-bad-2.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c", + "provider-bad-2.receipt": "437701d7771dcdcc130e256587a9251dbeabef08feb3d518d93f7db29b32619b", + "provider-bad-3.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c", + "provider-bad-3.receipt": "cf271c014ed96ffcad97c0ddde9a784deae63b48ab54ead38a601896a2cdfa05", + "provider-bad-4.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c", + "provider-bad-4.receipt": "3be14d5117cfd9923743dc772ac727cb30372228ca81879e3cac708dc9700d9a", + "provider-bad-5.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c", + "provider-bad-5.receipt": "311ce7da405cd8858718b28b45415028dedec82003dcb862d1b5ceea26c84646", + "provider-bad-6.log": "a0cc795fae1ca892318f47133f6c48e1c8bb6aad118ff7f2b00c8e8967393435", + "provider-bad-6.receipt": "26e7d22e42e36c12f4341bf1e1838f7fa84402571f3127fb91208ac45a05f64b", + "provider-consumer.log": "d8b9c61c09b396c654162f89688f72787756206bfcc70276d6c2682c3e7710f5", + "provider-consumer.receipt": "fb092a176e79462f135ff6f1aea3e2171eada31ad629d8c498104e43b244dabb", + "provider-core.log": "fbfe365c7485671f3c8e0ccf480be062034b65360b2005530c258e1577aaec04", + "provider-fragment.log": "49c437a2551e71a10bc26bc969f55103611991adea98696503cbdb8e686d1ba3", + "provider-process.log": "d8b9c61c09b396c654162f89688f72787756206bfcc70276d6c2682c3e7710f5", + "provider-process.receipt": "fb092a176e79462f135ff6f1aea3e2171eada31ad629d8c498104e43b244dabb", + "provider-producer.log": "d8b9c61c09b396c654162f89688f72787756206bfcc70276d6c2682c3e7710f5", + "provider-producer.receipt": "b710cb935724406c7cf4e459857b58c47f6026696cc11727da2815675bfec4d9", + "provider-stream.log": "49c437a2551e71a10bc26bc969f55103611991adea98696503cbdb8e686d1ba3", + "readback-mutant.log": "c841304340c8e11f4412f33a05d63a76dfc6329270c33f30a4d5fb38c9339c61", + "red4.exit": "4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865", + "red4.log": "96201abb9793b4223e41a726757a220185b8113a9b95af58f4181c93c15bf3f8", + "red4.om": "4cbe50c32ea043232fb903e74d82a4b33cbb915d18324627ff25133f93dad915", + "red5.exit": "4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865", + "red5.log": "c0d1e14ae78c8834a3eaaf674c30e793a469a7f9f8881edeae79bc1ef684a5a5", + "red5.om": "a7030339452dc6ddfcb8de3ed40aa2072c73e2144c1b904c4612570d00e91060", + "reply.log": "32d6f801fcebf933a573005fdb8d16376c56b01c34b1004101b0c0f047216162", + "runtime.log": "3113eae822a3529bfeb10a00da4130799a2e951a77ce4d468a7e94ff5a312c51", + "scene-input.log": "613312ef2e6ad6eb62d19f9a161a65dbefd867af59a260d4dd82adef18ff88c9", + "scene.log": "bec37a817909cb5af22c3d82c962698ab0ddaf8a2c16debe86a84ea2a0889bc8", + "scenecap-mutant.log": "aaecc0a85ed361c2a5f6823a85f76ea5c8c60e3bef3d88ef225175ca7c3c090d", + "scheduler.log": "b73f09405c612284cb7eecacb51fbabe60f5f7c6ec11f504cbb76a1e4e83f948", + "session-mutant.log": "b6320567e748c4f1ab264c07c76e22f7091d6bf77c004aae67ecef4d8115e8f2", + "short.log": "b8ed8e2db46290298415a96dbb9f64580f5ff79f631cdcf3b0257f3fb836f8a2", + "source.sha256": "b6de68f80a404e082bb3a3959d5121e426fc9a8e96cead004350554dc4a2cc58", + "stale-mutant.log": "59a77d4cd8683beb2a101425071eafef48c9afba89ac8b6e10edb8ed1098b42b", + "staleview-mutant.log": "0968ca91bbecca4bf9f6dda44d115d3a162170b23ce21fa798a32a9617cd425b", + "summary.json": "53839be69f24b5f8ee5e31f3bdf408f109fd800d0b7173a8f434eb3c122ad59b", + "thinking-mutant.log": "908c76c450a2ae6643694cc1f41e2a868792bcc3e20e96c317de6fa764d7f474", + "view.log": "2d117e033fea3f325a11c5cd70be5a181eb4d7d6b08e45b5fd73447d4159550e" +} diff --git a/evidence/allen-omega-L694/L758/keepalive-mutant.log b/evidence/allen-omega-L694/L758/keepalive-mutant.log new file mode 100644 index 00000000..2e3415df --- /dev/null +++ b/evidence/allen-omega-L694/L758/keepalive-mutant.log @@ -0,0 +1,213 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 1 +19 1 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 1 +54 1 +55 1 +56 1 +57 0 +58 0 +59 1 +60 0 +61 0 +62 0 +63 0 +64 0 +65 1 +66 0 +67 0 +68 0 +69 1 +70 1 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 1 +170 0 +171 1 +172 1 +173 0 +174 1 +175 0 +176 0 +177 0 +178 1 +179 1 +180 1 +181 1 +182 1 +183 1 +184 1 +185 1 +186 1 +187 1 +188 1 +189 1 +190 1 +191 1 +192 1 +193 1 +194 1 +195 1 +196 1 +197 1 +198 0 +199 1 +200 0 +201 0 +202 1 +203 1 +204 1 +205 0 +206 1 +207 1 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 diff --git a/evidence/allen-omega-L694/L758/legacy-font.bin b/evidence/allen-omega-L694/L758/legacy-font.bin new file mode 100644 index 00000000..03ec1365 Binary files /dev/null and b/evidence/allen-omega-L694/L758/legacy-font.bin differ diff --git a/evidence/allen-omega-L694/L758/legacy-oracle-collection.txt b/evidence/allen-omega-L694/L758/legacy-oracle-collection.txt new file mode 100644 index 00000000..a6e85067 --- /dev/null +++ b/evidence/allen-omega-L694/L758/legacy-oracle-collection.txt @@ -0,0 +1,35 @@ +# External collection of unmodified legacy C oracle bytes, never Omega runtime. +from pathlib import Path +import ctypes as C, hashlib, json, re, struct, subprocess +h=Path.home(); w=h/'workspace/aienos-allen-omega-L694'; d=h/'handoffs/allen-omega-L694/L758'; p=w/'native/kernel/ui' +source=(p/'allen_font.c').read_text(); data=(w/'native/omega/allen/font-data.om').read_text() +block=source.split('glyphs[CK_AF_COUNT] = {',1)[1].split('};',1)[0] +glyphs=re.findall(r'/\*[^\n]*?\*/\s*"([^"\n]*)"',block) +omega=re.search(r'text Afdata "(.*)"',data).group(1).split('|')[:-1] +if len(glyphs)!=95 or glyphs!=omega: raise RuntimeError('glyph design transcription mismatch') +sine=source.split('sin_q[91] = {',1)[1].split('};',1)[0] +a=[int(x) for x in re.findall(r'\d+',sine)] +b=[int(x) for x in re.search(r'text Afsines "(.*)"',data).group(1).split()] +if len(a)!=91 or a!=b: raise RuntimeError('sine transcription mismatch') +lib=d/'legacy-font-reference.so' +subprocess.run(['cc','-shared','-fPIC','-O2',str(p/'allen_font.c'),'-o',str(lib)],check=True) +class Glyph(C.Structure): + _fields_=[('alpha',C.POINTER(C.c_uint8)),('w',C.c_uint16),('h',C.c_uint16),('ox',C.c_int16),('oy',C.c_int16)] +class Face(C.Structure): + _fields_=[('s256',C.c_uint32),('hw256',C.c_uint32),('pool',C.POINTER(C.c_uint8)),('pool_len',C.c_size_t),('pool_used',C.c_size_t),('g',Glyph*95)] +f=C.CDLL(str(lib)); f.ck_af_face_init.argtypes=[C.POINTER(Face),C.c_uint,C.c_uint,C.POINTER(C.c_uint8),C.c_size_t] +f.ck_af_glyph_get.argtypes=[C.POINTER(Face),C.c_char]; f.ck_af_glyph_get.restype=C.POINTER(Glyph) +f.ck_af_advance.argtypes=[C.POINTER(Face),C.c_char]; f.ck_af_advance.restype=C.c_uint32 +count=0 +with (d/'legacy-font.bin').open('wb') as out: + for cap,wt in [(14,900),(30,1250),(64,2500)]: + face=Face(); pool=(C.c_uint8*(4<<20))(); f.ck_af_face_init(C.byref(face),cap,wt,pool,len(pool)) + for code in [*range(32,127),0,127,255]: + c=bytes([code]); g=f.ck_af_glyph_get(C.byref(face),c) + if not g: raise RuntimeError('reference pool unexpectedly full') + g=g.contents; adv=f.ck_af_advance(C.byref(face),c) + out.write(struct.pack('<5Q2qQ',cap,wt,code,g.w,g.h,g.ox,g.oy,adv)) + if g.w*g.h: out.write(C.string_at(g.alpha,g.w*g.h)) + count+=1 +manifest={'reference_only':True,'records':count,'glyph_designs':len(glyphs),'sine_samples':len(a),'source_sha256':hashlib.sha256((p/'allen_font.c').read_bytes()).hexdigest(),'reference_sha256':hashlib.sha256((d/'legacy-font.bin').read_bytes()).hexdigest(),'reference_bytes':(d/'legacy-font.bin').stat().st_size,'command':'cc -shared -fPIC -O2 native/kernel/ui/allen_font.c -o /legacy-font-reference.so','scope':'Legacy external oracle only. Omega source/data handwritten; no foreign code in native construction/runtime.'} +(d/'oracle.json').write_text(json.dumps(manifest,indent=2)+'\n'); print(json.dumps(manifest,indent=2)) diff --git a/evidence/allen-omega-L694/L758/long.log b/evidence/allen-omega-L694/L758/long.log new file mode 100644 index 00000000..0a060bc8 --- /dev/null +++ b/evidence/allen-omega-L694/L758/long.log @@ -0,0 +1,292 @@ +401 0 +410 0 +411 0 +412 0 +413 0 +414 0 +415 0 +416 0 +417 0 +418 0 +419 0 +420 0 +421 0 +422 0 +423 0 +424 0 +425 0 +426 0 +427 0 +428 0 +429 0 +430 0 +431 0 +432 0 +433 0 +434 0 +435 0 +436 0 +437 0 +438 0 +439 0 +440 0 +441 0 +442 0 +443 0 +444 0 +445 0 +446 0 +447 0 +448 0 +449 0 +450 0 +451 0 +452 0 +453 0 +454 0 +455 0 +456 0 +457 0 +458 0 +459 0 +460 0 +461 0 +462 0 +463 0 +464 0 +465 0 +466 0 +467 0 +468 0 +469 0 +470 0 +471 0 +472 0 +473 0 +474 0 +475 0 +476 0 +477 0 +478 0 +479 0 +480 0 +481 0 +482 0 +483 0 +484 0 +485 0 +486 0 +487 0 +488 0 +489 0 +490 0 +491 0 +492 0 +493 0 +494 0 +495 0 +496 0 +497 0 +498 0 +499 0 +500 0 +501 0 +502 0 +503 0 +504 0 +505 0 +506 0 +507 0 +508 0 +509 0 +510 0 +511 0 +512 0 +513 0 +514 0 +515 0 +516 0 +517 0 +518 0 +519 0 +520 0 +521 0 +522 0 +523 0 +524 0 +525 0 +526 0 +527 0 +528 0 +529 0 +530 0 +531 0 +532 0 +533 0 +534 0 +535 0 +536 0 +537 0 +538 0 +539 0 +540 0 +541 0 +542 0 +543 0 +544 0 +545 0 +546 0 +547 0 +548 0 +549 0 +550 0 +402 0 +403 0 +404 0 +405 0 +406 0 +700 0 +701 0 +702 0 +703 0 +704 0 +705 0 +706 0 +707 0 +708 0 +709 0 +710 0 +711 0 +712 0 +713 0 +714 0 +715 0 +716 0 +717 0 +718 0 +719 0 +720 0 +721 0 +722 0 +723 0 +724 0 +725 0 +726 0 +727 0 +728 0 +729 0 +730 0 +731 0 +732 0 +733 0 +734 0 +735 0 +736 0 +737 0 +738 0 +739 0 +740 0 +741 0 +742 0 +743 0 +744 0 +745 0 +746 0 +747 0 +748 0 +749 0 +750 0 +751 0 +752 0 +753 0 +754 0 +755 0 +756 0 +757 0 +758 0 +759 0 +760 0 +761 0 +762 0 +763 0 +764 0 +765 0 +766 0 +767 0 +768 0 +769 0 +770 0 +771 0 +772 0 +773 0 +774 0 +775 0 +776 0 +777 0 +778 0 +779 0 +780 0 +781 0 +782 0 +783 0 +784 0 +785 0 +786 0 +787 0 +788 0 +789 0 +790 0 +791 0 +792 0 +793 0 +794 0 +795 0 +796 0 +797 0 +798 0 +799 0 +800 0 +801 0 +802 0 +803 0 +804 0 +805 0 +806 0 +807 0 +808 0 +809 0 +810 0 +811 0 +812 0 +813 0 +814 0 +815 0 +816 0 +817 0 +818 0 +819 0 +820 0 +821 0 +822 0 +823 0 +824 0 +825 0 +826 0 +827 0 +828 0 +829 0 +830 0 +831 0 +832 0 +833 0 +834 0 +835 0 +836 0 +837 0 +838 0 +839 0 +840 0 +841 0 +407 0 +408 0 +409 0 diff --git a/evidence/allen-omega-L694/L758/memory.log b/evidence/allen-omega-L694/L758/memory.log new file mode 100644 index 00000000..5928102e --- /dev/null +++ b/evidence/allen-omega-L694/L758/memory.log @@ -0,0 +1,79 @@ +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 0 +310 0 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +362 0 +363 0 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 0 +361 0 diff --git a/evidence/allen-omega-L694/L758/native-font.bin b/evidence/allen-omega-L694/L758/native-font.bin new file mode 100644 index 00000000..05747f0c Binary files /dev/null and b/evidence/allen-omega-L694/L758/native-font.bin differ diff --git a/evidence/allen-omega-L694/L758/oracle.json b/evidence/allen-omega-L694/L758/oracle.json new file mode 100644 index 00000000..85f6679c --- /dev/null +++ b/evidence/allen-omega-L694/L758/oracle.json @@ -0,0 +1,11 @@ +{ + "reference_only": true, + "records": 294, + "glyph_designs": 95, + "sine_samples": 91, + "source_sha256": "92d7157386e65351325d80d5036565e406145230dfb696c9804ec80888d26904", + "reference_sha256": "0dc4abaa8c8cc1c5a79772bdd00b2d74458beac6ccfe85637069d04c77a7ff69", + "reference_bytes": 436341, + "command": "cc -shared -fPIC -O2 native/kernel/ui/allen_font.c -o /legacy-font-reference.so", + "scope": "Legacy external oracle only. Omega source/data handwritten; no foreign code in native construction/runtime." +} diff --git a/evidence/allen-omega-L694/L758/output.om b/evidence/allen-omega-L694/L758/output.om new file mode 100644 index 00000000..6d178e67 --- /dev/null +++ b/evidence/allen-omega-L694/L758/output.om @@ -0,0 +1,4222 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +note Stable application presentation; see PRESENTATION.md for scope and ownership. +global Ds ulong 8 +global Dt ulong 64 +global Dtext uchar 2304 +global Dsay ulong 1 +global Dm ulong 3 +global Dcode uchar 32768 +global Dstart ulong 4096 +global Dlen ulong 4096 +global Dline ulong 4096 +global Dview ulong 3 +global Din uchar 8192 +fn dscene to bool +n = get Inlen 0 +for i ulong 8192 +put Din i get In i +end +for i ulong get R 8 +put In i get Answer i +end +put Inlen 0 get R 8 +ok = scdecode +for i ulong 8192 +put In i get Din i +end +put Inlen 0 n +if not ok +ret false +end +for i ulong 8 +put Ds i get Sc i +end +for i ulong 64 +put Dt i get Things i +end +for i ulong 2304 +put Dtext i 0 +end +for i ulong get Sc 4 +put Dtext i get Stext i +end +put Dsay 0 get Sw 3 +put Dm 0 1 +ret true +end +fn dcode to bool +if or le get R 2 1 ne get R 1 0 +ret false +end +if or eq get R 6 0 ne get C 0 get R 0 +ret false +end +if not rows 80 4096 +ret false +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong get C 2 +put Dcode i get Code i +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong get View 0 +put Dstart i get Rowst i +put Dlen i get Rowlen i +put Dline i get Rowline i +end +put Dview 0 get View 0 +put Dview 1 0 +put Dview 2 get C 2 +put Dm 1 1 +ret true +end +fn dpresent to bool +if or eq get A 0 0 ne get A 2 1 +ret false +end +if or gt get R 8 159 gt get Inlen 0 8192 +ret false +end +shown = dscene +coded = dcode +if or shown coded +put Dm 2 get R 0 +ret true +end +ret false +end +fn dask now ulong to bool +if not appask now +ret false +end +b = dpresent +ret true +end +fn drecv now ulong to bool +if not appreceive now +ret false +end +b = dpresent +ret true +end +fn dreset to void +appreset +for i ulong 8 +put Ds i 0 +end +for i ulong 64 +put Dt i 0 +end +for i ulong 2304 +put Dtext i 0 +end +put Dsay 0 0 +for i ulong 3 +put Dm i 0 +put Dview i 0 +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong 8192 +put Din i 0 +end +end +note Declarative Allen glyph designs and integer sine samples, retained from +note native/kernel/ui/allen_font.c at4c7888f. No foreign executable implementation. +text Afdata "w6|w6 M3,0 L3,14 D3,20|w10 M3,0 L3,5 M7,0 L7,5|w15 M6,2 L4,20 M11,2 L9,20 M2,8 L13,8 M1,14 L12,14|w15 A8,5,5,5,-30,-270 A8,15,5,5,270,510 M8,-2 L8,22|w16 A4,4,2,3,0,360 A12,16,2,3,0,360 M13,1 L3,19|w16 M14,20 L5,9 A7,5,3,4,150,400 L3,14 A7,15,4,5,180,60 L13,11|w6 M3,0 L3,5|w9 A10,10,6,12,240,120|w9 A-1,10,6,12,-60,60|w14 M7,2 L7,10 M3,4 L11,8 M11,4 L3,8|w14 M2,12 L12,12 M7,7 L7,17|w6 M3,19 L2,23|w11 M2,13 L9,13|w6 D3,20|w12 M10,0 L2,20|w14 A7,10,5,10,0,360|w14 M3,4 L8,0 L8,20|w14 A7,6,5,6,200,400 L2,20 L12,20|w14 A7,5,5,5,200,450 A7,15,5,5,270,520|w14 M10,20 L10,0 L1,14 L13,14|w14 M12,0 L4,0 L4,9 A7,14,5,6,235,520|w14 A7,14,5,6,0,360 M10,0 L3,11|w14 M2,0 L12,0 L5,20|w14 A7,5,4,5,0,360 A7,15,5,5,0,360|w14 A7,6,5,6,0,360 M4,20 L11,9|w6 D3,8 D3,20|w6 D3,8 M3,19 L2,23|w14 M12,6 L2,12 L12,18|w14 M2,10 L12,10 M2,15 L12,15|w14 M2,6 L12,12 L2,18|w14 A7,5,5,5,190,450 L7,14 D7,20|w19 A9,12,3,4,0,360 M12,8 L12,14 A14,14,2,2,180,0 A9,11,7,9,0,-300|w16 M2,20 L8,0 L14,20 M4,13 L12,13|w15 M2,0 L2,20 M2,0 L8,0 A8,5,4,5,270,450 L2,10 M2,10 L9,10 A9,15,4,5,270,450 L2,20|w17 A9,10,7,10,45,315|w16 M2,0 L2,20 M2,0 L6,0 A6,10,8,10,270,450 L2,20|w14 M12,0 L2,0 L2,20 L12,20 M2,10 L10,10|w13 M12,0 L2,0 L2,20 M2,10 L10,10|w18 A9,10,7,10,-45,-360 M11,10 L16,10|w16 M2,0 L2,20 M14,0 L14,20 M2,10 L14,10|w6 M3,0 L3,20|w13 M10,0 L10,14 A6,14,4,6,0,180|w15 M2,0 L2,20 M13,0 L2,12 M6,8 L14,20|w13 M2,0 L2,20 L12,20|w20 M2,20 L2,0 L10,14 L18,0 L18,20|w16 M2,20 L2,0 L14,20 L14,0|w20 A10,10,8,10,0,360|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10|w20 A10,10,8,10,0,360 M12,14 L18,21|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10 M8,10 L14,20|w16 A8,5,5,5,-30,-270 A8,15,5,5,270,510|w16 M1,0 L15,0 M8,0 L8,20|w16 M2,0 L2,13 A8,13,6,7,180,0 L14,0|w16 M1,0 L8,20 L15,0|w22 M1,0 L6,20 L11,0 L16,20 L21,0|w16 M2,0 L14,20 M14,0 L2,20|w16 M1,0 L8,10 L15,0 M8,10 L8,20|w16 M2,0 L14,0 L2,20 L14,20|w9 M7,-1 L3,-1 L3,21 L7,21|w12 M2,0 L10,20|w9 M2,-1 L6,-1 L6,21 L2,21|w12 M2,8 L6,1 L10,8|w14 M1,23 L13,23|w7 M2,0 L4,4|w15 A7,14,5,6,0,360 M12,8 L12,20|w15 M2,0 L2,20 A7,14,5,6,0,360|w13 A7,14,5,6,40,320|w15 A7,14,5,6,0,360 M12,0 L12,20|w14 M2,14 L12,14 A7,14,5,6,0,-320|w11 M5,20 L5,4 A9,4,4,4,180,300 M2,8 L10,8|w15 A7,14,5,6,0,360 M12,8 L12,22 A7,22,5,5,0,150|w15 M2,0 L2,20 A7,13,5,5,180,360 L12,20|w6 M3,8 L3,20 D3,3|w7 M4,8 L4,22 A0,22,4,5,0,120 D4,3|w13 M2,0 L2,20 M11,8 L2,15 M5,13 L12,20|w6 M3,0 L3,20|w21 M2,8 L2,20 A6,12,4,4,180,360 L10,20 A14,12,4,4,180,360 L18,20|w15 M2,8 L2,20 A7,13,5,5,180,360 L12,20|w14 A7,14,5,6,0,360|w15 M2,8 L2,27 A7,14,5,6,0,360|w15 A7,14,5,6,0,360 M12,8 L12,27|w10 M2,8 L2,20 A7,13,5,5,180,290|w14 A7,11,4,3,-30,-270 A7,17,4,3,270,510|w11 M5,2 L5,17 A8,17,3,3,180,40 M2,8 L10,8|w15 M2,8 L2,15 A7,15,5,5,180,0 M12,8 L12,20|w14 M2,8 L7,20 L12,8|w20 M2,8 L6,20 L10,8 L14,20 L18,8|w14 M2,8 L12,20 M12,8 L2,20|w14 M2,8 L7,20 M12,8 L4,27|w14 M2,8 L12,8 L2,20 L12,20|w10 M8,-1 L6,0 L6,8 L4,10 L6,12 L6,20 L8,21|w6 M3,-1 L3,23|w10 M2,-1 L4,0 L4,8 L6,10 L4,12 L4,20 L2,21|w14 M2,13 L5,11 L9,14 L12,12|" +text Afsines "0 286 572 857 1143 1428 1713 1997 2280 2563 2845 3126 3406 3686 3964 4240 4516 4790 5063 5334 5604 5872 6138 6402 6664 6924 7182 7438 7692 7943 8192 8438 8682 8923 9162 9397 9630 9860 10087 10311 10531 10749 10963 11174 11381 11585 11786 11982 12176 12365 12551 12733 12911 13085 13255 13421 13583 13741 13894 14044 14189 14330 14466 14598 14726 14849 14968 15082 15191 15296 15396 15491 15582 15668 15749 15826 15897 15964 16026 16083 16135 16182 16225 16262 16294 16322 16344 16362 16374 16382 16384 " +note Handwritten bounded Allen stroke rasterizer. Legacy C is an external oracle only. +global Af ulong 6 +global Ab long 4 +global Ag long 640 +global Alpha uchar 65536 +global Asin long 91 +global Afpos ulong 2 +global Apen long 2 +global Arc long 6 +fn afsqrt value ulong to ulong +r = ulong 0 +bit = shl ulong 1 62 +while gt bit value +bit = shr bit 2 +end +while ne bit 0 +if ge value add r bit +value = sub value add r bit +r = add shr r 1 bit +else +r = shr r 1 +end +bit = shr bit 2 +end +ret r +end +fn afsin deg long to long +a = rem deg 360 +if lt a 0 +a = add a 360 +end +if le a 90 +ret get Asin ulong a +end +if le a 180 +ret get Asin ulong sub long 180 a +end +if le a 270 +ret neg get Asin ulong sub a 180 +end +ret neg get Asin ulong sub long 360 a +end +fn afcos deg long to long +ret afsin add rem deg 360 90 +end +fn afinit cap ulong wt ulong to bool +if or eq cap 0 gt cap 64 +ret false +end +if or eq wt 0 gt wt 2500 +ret false +end +for i ulong 6 +put Af i 0 +end +put Af 0 div mul cap 256 20 +put Af 1 div mul wt get Af 0 1000 +v = long 0 +slot = ulong 0 +for i ulong len Afsines +c = get Afsines i +if eq c 32 +put Asin slot v +slot = add slot 1 +v = 0 +else +v = add mul v 10 sub long c 48 +end +end +ret eq slot 91 +end +fn afpick c uchar to bool +if or lt c 32 gt c 126 +c = 63 +end +wanted = sub ulong c 32 +slot = ulong 0 +startat = ulong 0 +for i ulong len Afdata +if eq get Afdata i 124 +if eq slot wanted +put Afpos 0 startat +put Afpos 1 i +ret true +end +slot = add slot 1 +startat = add i 1 +end +end +ret false +end +fn afnum to long +p = get Afpos 0 +minus = false +if eq get Afdata p 45 +minus = true +p = add p 1 +end +v = long 0 +go = true +while and lt p get Afpos 1 go +c = get Afdata p +if and ge c 48 le c 57 +v = add mul v 10 sub long c 48 +p = add p 1 +else +go = false +end +end +if lt p get Afpos 1 +if eq get Afdata p 44 +p = add p 1 +end +end +put Afpos 0 p +if minus +ret neg v +end +ret v +end +fn afseg nx long ny long to bool +n = get Af 2 +if ge n 160 +ret false +end +at = mul n 4 +put Ag at get Apen 0 +put Ag add at 1 get Apen 1 +put Ag add at 2 nx +put Ag add at 3 ny +put Apen 0 nx +put Apen 1 ny +put Af 2 add n 1 +ret true +end +fn afpoint a long first bool to bool +s = long get Af 0 +x = mul get Arc 0 s +x = add x div mul mul get Arc 2 s afcos a 16384 +y = mul sub get Arc 1 20 s +y = add y div mul mul get Arc 3 s afsin a 16384 +if first +put Apen 0 x +put Apen 1 y +ret true +end +ret afseg x y +end +fn afarc to bool +for i ulong 6 +put Arc i afnum +end +span = sub get Arc 5 get Arc 4 +if lt span 0 +span = neg span +end +steps = div span 9 +if lt steps 2 +steps = 2 +end +for k ulong ulong add steps 1 +a = sub get Arc 5 get Arc 4 +a = add get Arc 4 div mul a long k steps +if not afpoint a eq k 0 +ret false +end +end +ret true +end +fn afcmd cmd uchar to bool +if eq cmd 32 +ret true +end +if eq cmd 119 +put Af 5 mul ulong afnum get Af 0 +ret true +end +if eq cmd 65 +ret afarc +end +x = mul afnum long get Af 0 +y = mul sub afnum 20 long get Af 0 +if or eq cmd 77 eq cmd 68 +put Apen 0 x +put Apen 1 y +end +if eq cmd 77 +ret true +end +if or eq cmd 76 eq cmd 68 +ret afseg x y +end +ret false +end +fn affloor value long to long +if ge value 0 +ret div value 256 +end +ret neg div add neg value 255 256 +end +fn afbound x long y long to void +if lt x get Ab 0 +put Ab 0 x +end +if lt y get Ab 1 +put Ab 1 y +end +if gt x get Ab 2 +put Ab 2 x +end +if gt y get Ab 3 +put Ab 3 y +end +end +fn afbox to bool +put Ab 0 get Ag 0 +put Ab 2 get Ag 0 +put Ab 1 get Ag 1 +put Ab 3 get Ag 1 +for i ulong get Af 2 +at = mul i 4 +afbound get Ag at get Ag add at 1 +afbound get Ag add at 2 get Ag add at 3 +end +pad = add long get Af 1 256 +x0 = affloor sub get Ab 0 pad +y0 = affloor sub get Ab 1 pad +x1 = add affloor add get Ab 2 pad 1 +y1 = add affloor add get Ab 3 pad 1 +put Ab 0 x0 +put Ab 1 y0 +put Af 3 ulong sub x1 x0 +put Af 4 ulong sub y1 y0 +ret le mul get Af 3 get Af 4 len Alpha +end +fn afproj qx long qy long dx long dy long to ulong +len2 = add mul dx dx mul dy dy +ex = qx +ey = qy +if ne len2 0 +t = add mul qx dx mul qy dy +if gt t 0 +if ge t len2 +ex = sub qx dx +ey = sub qy dy +else +ex = sub qx div mul dx t len2 +ey = sub qy div mul dy t len2 +end +end +end +ret ulong add mul ex ex mul ey ey +end +fn afdist slot ulong px long py long to ulong +at = mul slot 4 +dx = sub get Ag add at 2 get Ag at +dy = sub get Ag add at 3 get Ag add at 1 +qx = sub px get Ag at +qy = sub py get Ag add at 1 +ret afproj qx qy dx dy +end +fn afalpha px long py long to uchar +best = ulong 18446744073709551615 +for i ulong get Af 2 +d2 = afdist i px py +if lt d2 best +best = d2 +end +end +d = long afsqrt best +cov = sub add long get Af 1 128 d +if le cov 0 +ret 0 +end +if ge cov 256 +ret 255 +end +ret uchar div mul cov 255 256 +end +fn afrow y ulong to void +py = add mul add get Ab 1 long y 256 128 +for x ulong get Af 3 +px = add mul add get Ab 0 long x 256 128 +at = add mul y get Af 3 x +put Alpha at afalpha px py +end +end +fn afpaint to void +for y ulong get Af 4 +afrow y +end +end +fn afglyph c uchar to bool +if eq get Af 0 0 +ret false +end +if not afpick c +ret false +end +for i ulong 65536 +put Alpha i 0 +end +put Af 2 0 +put Af 3 0 +put Af 4 1 +put Af 5 0 +put Ab 0 0 +put Ab 1 0 +put Apen 0 0 +put Apen 1 0 +while lt get Afpos 0 get Afpos 1 +cmd = get Afdata get Afpos 0 +put Afpos 0 add get Afpos 0 1 +if not afcmd cmd +ret false +end +end +if eq get Af 2 0 +ret true +end +if not afbox +ret false +end +afpaint +ret true +end +note Native glyph stream for byte comparison with the external legacy oracle. +fn afword v ulong to void +for i ulong 8 +emitb uchar and shr v mul i 8 255 +end +end +fn afhead to bool +p = ulong 0 +while lt p get Outlen 0 +n = write 1 Outb p sub get Outlen 0 p +if le n 0 +ret false +end +p = add p ulong n +end +ret true +end +fn afemit cap ulong wt ulong c uchar to bool +if not afglyph c +ret false +end +outreset +afword cap +afword wt +afword ulong c +afword get Af 3 +afword get Af 4 +afword ulong get Ab 0 +afword ulong get Ab 1 +afword get Af 5 +if not afhead +ret false +end +size = mul get Af 3 get Af 4 +p = ulong 0 +while lt p size +n = write 1 Alpha p sub size p +if le n 0 +ret false +end +p = add p ulong n +end +ret true +end +fn main to int +for mode ulong 3 +cap = ulong 14 +wt = ulong 900 +if eq mode 1 +cap = 30 +wt = 1250 +end +if eq mode 2 +cap = 64 +wt = 2500 +end +if not afinit cap wt +ret 1 +end +for i ulong 95 +if not afemit cap wt uchar add i 32 +ret 1 +end +end +if not afemit cap wt 0 +ret 1 +end +if not afemit cap wt 127 +ret 1 +end +if not afemit cap wt 255 +ret 1 +end +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L758/paint.log b/evidence/allen-omega-L694/L758/paint.log new file mode 100644 index 00000000..281a5bd2 --- /dev/null +++ b/evidence/allen-omega-L694/L758/paint.log @@ -0,0 +1,11 @@ +1101 0 +1102 0 +1103 0 +1104 0 +1105 0 +1106 0 +1107 0 +1108 0 +1109 0 +1110 0 +1111 0 diff --git a/evidence/allen-omega-L694/L758/pendingwire-mutant.log b/evidence/allen-omega-L694/L758/pendingwire-mutant.log new file mode 100644 index 00000000..48fb2008 --- /dev/null +++ b/evidence/allen-omega-L694/L758/pendingwire-mutant.log @@ -0,0 +1,182 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 1 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 diff --git a/evidence/allen-omega-L694/L758/presentation.log b/evidence/allen-omega-L694/L758/presentation.log new file mode 100644 index 00000000..84fd2470 --- /dev/null +++ b/evidence/allen-omega-L694/L758/presentation.log @@ -0,0 +1,75 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 diff --git a/evidence/allen-omega-L694/L758/provider-bad-1.log b/evidence/allen-omega-L694/L758/provider-bad-1.log new file mode 100644 index 00000000..7da8e511 --- /dev/null +++ b/evidence/allen-omega-L694/L758/provider-bad-1.log @@ -0,0 +1,5 @@ +1 0 +2 0 +3 0 +4 0 +5 0 diff --git a/evidence/allen-omega-L694/L758/provider-bad-1.receipt b/evidence/allen-omega-L694/L758/provider-bad-1.receipt new file mode 100644 index 00000000..2b29860a --- /dev/null +++ b/evidence/allen-omega-L694/L758/provider-bad-1.receipt @@ -0,0 +1,4 @@ +1 +65 +0 +0 diff --git a/evidence/allen-omega-L694/L758/provider-bad-2.log b/evidence/allen-omega-L694/L758/provider-bad-2.log new file mode 100644 index 00000000..7da8e511 --- /dev/null +++ b/evidence/allen-omega-L694/L758/provider-bad-2.log @@ -0,0 +1,5 @@ +1 0 +2 0 +3 0 +4 0 +5 0 diff --git a/evidence/allen-omega-L694/L758/provider-bad-2.receipt b/evidence/allen-omega-L694/L758/provider-bad-2.receipt new file mode 100644 index 00000000..9ba12cca --- /dev/null +++ b/evidence/allen-omega-L694/L758/provider-bad-2.receipt @@ -0,0 +1,4 @@ +2 +65 +0 +0 diff --git a/evidence/allen-omega-L694/L758/provider-bad-3.log b/evidence/allen-omega-L694/L758/provider-bad-3.log new file mode 100644 index 00000000..7da8e511 --- /dev/null +++ b/evidence/allen-omega-L694/L758/provider-bad-3.log @@ -0,0 +1,5 @@ +1 0 +2 0 +3 0 +4 0 +5 0 diff --git a/evidence/allen-omega-L694/L758/provider-bad-3.receipt b/evidence/allen-omega-L694/L758/provider-bad-3.receipt new file mode 100644 index 00000000..199cc204 --- /dev/null +++ b/evidence/allen-omega-L694/L758/provider-bad-3.receipt @@ -0,0 +1,4 @@ +3 +65 +0 +0 diff --git a/evidence/allen-omega-L694/L758/provider-bad-4.log b/evidence/allen-omega-L694/L758/provider-bad-4.log new file mode 100644 index 00000000..7da8e511 --- /dev/null +++ b/evidence/allen-omega-L694/L758/provider-bad-4.log @@ -0,0 +1,5 @@ +1 0 +2 0 +3 0 +4 0 +5 0 diff --git a/evidence/allen-omega-L694/L758/provider-bad-4.receipt b/evidence/allen-omega-L694/L758/provider-bad-4.receipt new file mode 100644 index 00000000..26a81c4a --- /dev/null +++ b/evidence/allen-omega-L694/L758/provider-bad-4.receipt @@ -0,0 +1,4 @@ +4 +65 +0 +0 diff --git a/evidence/allen-omega-L694/L758/provider-bad-5.log b/evidence/allen-omega-L694/L758/provider-bad-5.log new file mode 100644 index 00000000..7da8e511 --- /dev/null +++ b/evidence/allen-omega-L694/L758/provider-bad-5.log @@ -0,0 +1,5 @@ +1 0 +2 0 +3 0 +4 0 +5 0 diff --git a/evidence/allen-omega-L694/L758/provider-bad-5.receipt b/evidence/allen-omega-L694/L758/provider-bad-5.receipt new file mode 100644 index 00000000..d79f5995 --- /dev/null +++ b/evidence/allen-omega-L694/L758/provider-bad-5.receipt @@ -0,0 +1,4 @@ +5 +65 +0 +0 diff --git a/evidence/allen-omega-L694/L758/provider-bad-6.log b/evidence/allen-omega-L694/L758/provider-bad-6.log new file mode 100644 index 00000000..3f9cc45d --- /dev/null +++ b/evidence/allen-omega-L694/L758/provider-bad-6.log @@ -0,0 +1,17 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 diff --git a/evidence/allen-omega-L694/L758/provider-bad-6.receipt b/evidence/allen-omega-L694/L758/provider-bad-6.receipt new file mode 100644 index 00000000..d0b7cd17 Binary files /dev/null and b/evidence/allen-omega-L694/L758/provider-bad-6.receipt differ diff --git a/evidence/allen-omega-L694/L758/provider-consumer.log b/evidence/allen-omega-L694/L758/provider-consumer.log new file mode 100644 index 00000000..9c0592e2 --- /dev/null +++ b/evidence/allen-omega-L694/L758/provider-consumer.log @@ -0,0 +1,3 @@ +1 0 +2 0 +3 0 diff --git a/evidence/allen-omega-L694/L758/provider-consumer.receipt b/evidence/allen-omega-L694/L758/provider-consumer.receipt new file mode 100644 index 00000000..31d93b9d Binary files /dev/null and b/evidence/allen-omega-L694/L758/provider-consumer.receipt differ diff --git a/evidence/allen-omega-L694/L758/provider-core.log b/evidence/allen-omega-L694/L758/provider-core.log new file mode 100644 index 00000000..88d1b135 --- /dev/null +++ b/evidence/allen-omega-L694/L758/provider-core.log @@ -0,0 +1,100 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 diff --git a/evidence/allen-omega-L694/L758/provider-fragment.log b/evidence/allen-omega-L694/L758/provider-fragment.log new file mode 100644 index 00000000..d91084d1 --- /dev/null +++ b/evidence/allen-omega-L694/L758/provider-fragment.log @@ -0,0 +1,292 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 +183 0 +184 0 +185 0 +186 0 +187 0 +188 0 +189 0 +190 0 +191 0 +192 0 +193 0 +194 0 +195 0 +196 0 +197 0 +198 0 +199 0 +200 0 +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 +225 0 +226 0 +227 0 +228 0 +229 0 +230 0 +231 0 +232 0 +233 0 +234 0 +235 0 +236 0 +237 0 +238 0 +239 0 +240 0 +241 0 +242 0 +243 0 +244 0 +245 0 +246 0 +247 0 +248 0 +249 0 +250 0 +251 0 +252 0 +253 0 +254 0 +255 0 +256 0 +257 0 +258 0 +259 0 +260 0 +261 0 +262 0 +263 0 +264 0 +265 0 +266 0 +267 0 +268 0 +269 0 +270 0 +271 0 +272 0 +273 0 +274 0 +275 0 +276 0 +277 0 +278 0 +279 0 +280 0 +281 0 +282 0 +283 0 +284 0 +285 0 +286 0 +287 0 +288 0 +289 0 +290 0 +291 0 +292 0 diff --git a/evidence/allen-omega-L694/L758/provider-process.log b/evidence/allen-omega-L694/L758/provider-process.log new file mode 100644 index 00000000..9c0592e2 --- /dev/null +++ b/evidence/allen-omega-L694/L758/provider-process.log @@ -0,0 +1,3 @@ +1 0 +2 0 +3 0 diff --git a/evidence/allen-omega-L694/L758/provider-process.receipt b/evidence/allen-omega-L694/L758/provider-process.receipt new file mode 100644 index 00000000..31d93b9d Binary files /dev/null and b/evidence/allen-omega-L694/L758/provider-process.receipt differ diff --git a/evidence/allen-omega-L694/L758/provider-producer.log b/evidence/allen-omega-L694/L758/provider-producer.log new file mode 100644 index 00000000..9c0592e2 --- /dev/null +++ b/evidence/allen-omega-L694/L758/provider-producer.log @@ -0,0 +1,3 @@ +1 0 +2 0 +3 0 diff --git a/evidence/allen-omega-L694/L758/provider-producer.receipt b/evidence/allen-omega-L694/L758/provider-producer.receipt new file mode 100644 index 00000000..0967800c --- /dev/null +++ b/evidence/allen-omega-L694/L758/provider-producer.receipt @@ -0,0 +1,4 @@ +7 +0 +0 +0 diff --git a/evidence/allen-omega-L694/L758/provider-stream.log b/evidence/allen-omega-L694/L758/provider-stream.log new file mode 100644 index 00000000..d91084d1 --- /dev/null +++ b/evidence/allen-omega-L694/L758/provider-stream.log @@ -0,0 +1,292 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 +183 0 +184 0 +185 0 +186 0 +187 0 +188 0 +189 0 +190 0 +191 0 +192 0 +193 0 +194 0 +195 0 +196 0 +197 0 +198 0 +199 0 +200 0 +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 +225 0 +226 0 +227 0 +228 0 +229 0 +230 0 +231 0 +232 0 +233 0 +234 0 +235 0 +236 0 +237 0 +238 0 +239 0 +240 0 +241 0 +242 0 +243 0 +244 0 +245 0 +246 0 +247 0 +248 0 +249 0 +250 0 +251 0 +252 0 +253 0 +254 0 +255 0 +256 0 +257 0 +258 0 +259 0 +260 0 +261 0 +262 0 +263 0 +264 0 +265 0 +266 0 +267 0 +268 0 +269 0 +270 0 +271 0 +272 0 +273 0 +274 0 +275 0 +276 0 +277 0 +278 0 +279 0 +280 0 +281 0 +282 0 +283 0 +284 0 +285 0 +286 0 +287 0 +288 0 +289 0 +290 0 +291 0 +292 0 diff --git a/evidence/allen-omega-L694/L758/readback-mutant.log b/evidence/allen-omega-L694/L758/readback-mutant.log new file mode 100644 index 00000000..268002ad --- /dev/null +++ b/evidence/allen-omega-L694/L758/readback-mutant.log @@ -0,0 +1,79 @@ +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 0 +310 0 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 1 +339 1 +340 0 +341 0 +342 0 +343 0 +344 1 +345 0 +346 0 +347 0 +348 0 +349 1 +350 1 +351 0 +352 0 +362 0 +363 0 +353 1 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 1 +361 0 diff --git a/evidence/allen-omega-L694/L758/red4.exit b/evidence/allen-omega-L694/L758/red4.exit new file mode 100644 index 00000000..d00491fd --- /dev/null +++ b/evidence/allen-omega-L694/L758/red4.exit @@ -0,0 +1 @@ +1 diff --git a/evidence/allen-omega-L694/L758/red4.log b/evidence/allen-omega-L694/L758/red4.log new file mode 100644 index 00000000..9baad483 --- /dev/null +++ b/evidence/allen-omega-L694/L758/red4.log @@ -0,0 +1,412 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 1 +7 1 +8 1 +9 0 +10 1 +11 1 +12 1 +13 1 +14 0 +15 1 +16 1 +17 1 +18 1 +19 1 +20 1 +21 0 +22 0 +23 1 +24 1 +25 1 +26 0 +27 1 +28 1 +29 1 +30 0 +31 1 +32 1 +33 1 +34 0 +35 1 +36 1 +37 1 +38 0 +39 1 +40 1 +41 1 +42 0 +43 1 +44 1 +45 1 +46 0 +47 1 +48 1 +49 1 +50 0 +51 1 +52 1 +53 1 +54 0 +55 1 +56 1 +57 1 +58 0 +59 1 +60 1 +61 1 +62 0 +63 1 +64 1 +65 1 +66 0 +67 1 +68 1 +69 1 +70 0 +71 1 +72 1 +73 1 +74 0 +75 1 +76 1 +77 1 +78 0 +79 1 +80 1 +81 1 +82 0 +83 1 +84 1 +85 1 +86 0 +87 1 +88 1 +89 1 +90 0 +91 1 +92 1 +93 1 +94 0 +95 1 +96 1 +97 1 +98 0 +99 1 +100 1 +101 1 +102 0 +103 1 +104 1 +105 1 +106 0 +107 1 +108 1 +109 1 +110 0 +111 1 +112 1 +113 1 +114 0 +115 1 +116 1 +117 1 +118 0 +119 1 +120 1 +121 1 +122 0 +123 1 +124 1 +125 1 +126 0 +127 1 +128 1 +129 1 +130 0 +131 1 +132 1 +133 1 +134 0 +135 1 +136 1 +137 1 +138 0 +139 1 +140 1 +141 1 +142 0 +143 1 +144 1 +145 1 +146 0 +147 1 +148 1 +149 1 +150 0 +151 1 +152 1 +153 1 +154 0 +155 1 +156 1 +157 1 +158 0 +159 1 +160 1 +161 1 +162 0 +163 1 +164 1 +165 1 +166 0 +167 1 +168 1 +169 1 +170 0 +171 1 +172 1 +173 1 +174 0 +175 1 +176 1 +177 1 +178 0 +179 1 +180 1 +181 1 +182 0 +183 1 +184 1 +185 1 +186 0 +187 1 +188 1 +189 1 +190 0 +191 1 +192 1 +193 1 +194 0 +195 1 +196 1 +197 1 +198 0 +199 1 +200 1 +201 1 +202 0 +203 1 +204 1 +205 1 +206 0 +207 1 +208 1 +209 1 +210 0 +211 1 +212 1 +213 1 +214 0 +215 1 +216 1 +217 1 +218 0 +219 1 +220 1 +221 1 +222 0 +223 1 +224 1 +225 1 +226 0 +227 1 +228 1 +229 1 +230 0 +231 1 +232 1 +233 1 +234 0 +235 1 +236 1 +237 1 +238 0 +239 1 +240 1 +241 1 +242 0 +243 1 +244 1 +245 1 +246 0 +247 1 +248 1 +249 1 +250 0 +251 1 +252 1 +253 1 +254 0 +255 1 +256 1 +257 1 +258 0 +259 1 +260 1 +261 1 +262 0 +263 1 +264 1 +265 1 +266 0 +267 1 +268 1 +269 1 +270 0 +271 1 +272 1 +273 1 +274 0 +275 1 +276 1 +277 1 +278 0 +279 1 +280 1 +281 1 +282 0 +283 1 +284 1 +285 1 +286 0 +287 1 +288 1 +289 1 +290 0 +291 1 +292 1 +293 1 +294 0 +295 1 +296 1 +297 1 +298 0 +299 1 +300 1 +301 1 +302 0 +303 1 +304 1 +305 1 +306 0 +307 1 +308 1 +309 1 +310 0 +311 1 +312 1 +313 1 +314 0 +315 1 +316 1 +317 1 +318 0 +319 1 +320 1 +321 1 +322 0 +323 1 +324 1 +325 1 +326 0 +327 1 +328 1 +329 1 +330 0 +331 1 +332 1 +333 1 +334 0 +335 1 +336 1 +337 1 +338 0 +339 1 +340 1 +341 1 +342 0 +343 1 +344 1 +345 1 +346 0 +347 1 +348 1 +349 1 +350 0 +351 1 +352 1 +353 1 +354 0 +355 1 +356 1 +357 1 +358 0 +359 1 +360 1 +361 1 +362 0 +363 1 +364 1 +365 1 +366 0 +367 1 +368 1 +369 1 +370 0 +371 1 +372 1 +373 1 +374 0 +375 1 +376 1 +377 1 +378 0 +379 1 +380 1 +381 1 +382 0 +383 1 +384 1 +385 1 +386 0 +387 1 +388 1 +389 1 +390 0 +391 1 +392 1 +393 1 +394 0 +395 1 +396 1 +397 1 +398 0 +399 1 +400 1 +401 0 +402 1 +403 1 +404 0 +405 0 +406 0 +407 0 +408 1 +409 1 +410 0 +411 1 +412 1 diff --git a/evidence/allen-omega-L694/L758/red4.om b/evidence/allen-omega-L694/L758/red4.om new file mode 100644 index 00000000..25f581d5 --- /dev/null +++ b/evidence/allen-omega-L694/L758/red4.om @@ -0,0 +1,3955 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +note Stable application presentation; see PRESENTATION.md for scope and ownership. +global Ds ulong 8 +global Dt ulong 64 +global Dtext uchar 2304 +global Dsay ulong 1 +global Dm ulong 3 +global Dcode uchar 32768 +global Dstart ulong 4096 +global Dlen ulong 4096 +global Dline ulong 4096 +global Dview ulong 3 +global Din uchar 8192 +fn dscene to bool +n = get Inlen 0 +for i ulong 8192 +put Din i get In i +end +for i ulong get R 8 +put In i get Answer i +end +put Inlen 0 get R 8 +ok = scdecode +for i ulong 8192 +put In i get Din i +end +put Inlen 0 n +if not ok +ret false +end +for i ulong 8 +put Ds i get Sc i +end +for i ulong 64 +put Dt i get Things i +end +for i ulong 2304 +put Dtext i 0 +end +for i ulong get Sc 4 +put Dtext i get Stext i +end +put Dsay 0 get Sw 3 +put Dm 0 1 +ret true +end +fn dcode to bool +if or le get R 2 1 ne get R 1 0 +ret false +end +if or eq get R 6 0 ne get C 0 get R 0 +ret false +end +if not rows 80 4096 +ret false +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong get C 2 +put Dcode i get Code i +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong get View 0 +put Dstart i get Rowst i +put Dlen i get Rowlen i +put Dline i get Rowline i +end +put Dview 0 get View 0 +put Dview 1 0 +put Dview 2 get C 2 +put Dm 1 1 +ret true +end +fn dpresent to bool +if or eq get A 0 0 ne get A 2 1 +ret false +end +if or gt get R 8 159 gt get Inlen 0 8192 +ret false +end +shown = dscene +coded = dcode +if or shown coded +put Dm 2 get R 0 +ret true +end +ret false +end +fn dask now ulong to bool +if not appask now +ret false +end +b = dpresent +ret true +end +fn drecv now ulong to bool +if not appreceive now +ret false +end +b = dpresent +ret true +end +fn dreset to void +appreset +for i ulong 8 +put Ds i 0 +end +for i ulong 64 +put Dt i 0 +end +for i ulong 2304 +put Dtext i 0 +end +put Dsay 0 0 +for i ulong 3 +put Dm i 0 +put Dview i 0 +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong 8192 +put Din i 0 +end +end +note Declarative Allen glyph designs and integer sine samples, retained from +note native/kernel/ui/allen_font.c at4c7888f. No foreign executable implementation. +text Afdata "w6|w6 M3,0 L3,14 D3,20|w10 M3,0 L3,5 M7,0 L7,5|w15 M6,2 L4,20 M11,2 L9,20 M2,8 L13,8 M1,14 L12,14|w15 A8,5,5,5,-30,-270 A8,15,5,5,270,510 M8,-2 L8,22|w16 A4,4,2,3,0,360 A12,16,2,3,0,360 M13,1 L3,19|w16 M14,20 L5,9 A7,5,3,4,150,400 L3,14 A7,15,4,5,180,60 L13,11|w6 M3,0 L3,5|w9 A10,10,6,12,240,120|w9 A-1,10,6,12,-60,60|w14 M7,2 L7,10 M3,4 L11,8 M11,4 L3,8|w14 M2,12 L12,12 M7,7 L7,17|w6 M3,19 L2,23|w11 M2,13 L9,13|w6 D3,20|w12 M10,0 L2,20|w14 A7,10,5,10,0,360|w14 M3,4 L8,0 L8,20|w14 A7,6,5,6,200,400 L2,20 L12,20|w14 A7,5,5,5,200,450 A7,15,5,5,270,520|w14 M10,20 L10,0 L1,14 L13,14|w14 M12,0 L4,0 L4,9 A7,14,5,6,235,520|w14 A7,14,5,6,0,360 M10,0 L3,11|w14 M2,0 L12,0 L5,20|w14 A7,5,4,5,0,360 A7,15,5,5,0,360|w14 A7,6,5,6,0,360 M4,20 L11,9|w6 D3,8 D3,20|w6 D3,8 M3,19 L2,23|w14 M12,6 L2,12 L12,18|w14 M2,10 L12,10 M2,15 L12,15|w14 M2,6 L12,12 L2,18|w14 A7,5,5,5,190,450 L7,14 D7,20|w19 A9,12,3,4,0,360 M12,8 L12,14 A14,14,2,2,180,0 A9,11,7,9,0,-300|w16 M2,20 L8,0 L14,20 M4,13 L12,13|w15 M2,0 L2,20 M2,0 L8,0 A8,5,4,5,270,450 L2,10 M2,10 L9,10 A9,15,4,5,270,450 L2,20|w17 A9,10,7,10,45,315|w16 M2,0 L2,20 M2,0 L6,0 A6,10,8,10,270,450 L2,20|w14 M12,0 L2,0 L2,20 L12,20 M2,10 L10,10|w13 M12,0 L2,0 L2,20 M2,10 L10,10|w18 A9,10,7,10,-45,-360 M11,10 L16,10|w16 M2,0 L2,20 M14,0 L14,20 M2,10 L14,10|w6 M3,0 L3,20|w13 M10,0 L10,14 A6,14,4,6,0,180|w15 M2,0 L2,20 M13,0 L2,12 M6,8 L14,20|w13 M2,0 L2,20 L12,20|w20 M2,20 L2,0 L10,14 L18,0 L18,20|w16 M2,20 L2,0 L14,20 L14,0|w20 A10,10,8,10,0,360|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10|w20 A10,10,8,10,0,360 M12,14 L18,21|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10 M8,10 L14,20|w16 A8,5,5,5,-30,-270 A8,15,5,5,270,510|w16 M1,0 L15,0 M8,0 L8,20|w16 M2,0 L2,13 A8,13,6,7,180,0 L14,0|w16 M1,0 L8,20 L15,0|w22 M1,0 L6,20 L11,0 L16,20 L21,0|w16 M2,0 L14,20 M14,0 L2,20|w16 M1,0 L8,10 L15,0 M8,10 L8,20|w16 M2,0 L14,0 L2,20 L14,20|w9 M7,-1 L3,-1 L3,21 L7,21|w12 M2,0 L10,20|w9 M2,-1 L6,-1 L6,21 L2,21|w12 M2,8 L6,1 L10,8|w14 M1,23 L13,23|w7 M2,0 L4,4|w15 A7,14,5,6,0,360 M12,8 L12,20|w15 M2,0 L2,20 A7,14,5,6,0,360|w13 A7,14,5,6,40,320|w15 A7,14,5,6,0,360 M12,0 L12,20|w14 M2,14 L12,14 A7,14,5,6,0,-320|w11 M5,20 L5,4 A9,4,4,4,180,300 M2,8 L10,8|w15 A7,14,5,6,0,360 M12,8 L12,22 A7,22,5,5,0,150|w15 M2,0 L2,20 A7,13,5,5,180,360 L12,20|w6 M3,8 L3,20 D3,3|w7 M4,8 L4,22 A0,22,4,5,0,120 D4,3|w13 M2,0 L2,20 M11,8 L2,15 M5,13 L12,20|w6 M3,0 L3,20|w21 M2,8 L2,20 A6,12,4,4,180,360 L10,20 A14,12,4,4,180,360 L18,20|w15 M2,8 L2,20 A7,13,5,5,180,360 L12,20|w14 A7,14,5,6,0,360|w15 M2,8 L2,27 A7,14,5,6,0,360|w15 A7,14,5,6,0,360 M12,8 L12,27|w10 M2,8 L2,20 A7,13,5,5,180,290|w14 A7,11,4,3,-30,-270 A7,17,4,3,270,510|w11 M5,2 L5,17 A8,17,3,3,180,40 M2,8 L10,8|w15 M2,8 L2,15 A7,15,5,5,180,0 M12,8 L12,20|w14 M2,8 L7,20 L12,8|w20 M2,8 L6,20 L10,8 L14,20 L18,8|w14 M2,8 L12,20 M12,8 L2,20|w14 M2,8 L7,20 M12,8 L4,27|w14 M2,8 L12,8 L2,20 L12,20|w10 M8,-1 L6,0 L6,8 L4,10 L6,12 L6,20 L8,21|w6 M3,-1 L3,23|w10 M2,-1 L4,0 L4,8 L6,10 L4,12 L4,20 L2,21|w14 M2,13 L5,11 L9,14 L12,12|" +text Afsines "0 286 572 857 1143 1428 1713 1997 2280 2563 2845 3126 3406 3686 3964 4240 4516 4790 5063 5334 5604 5872 6138 6402 6664 6924 7182 7438 7692 7943 8192 8438 8682 8923 9162 9397 9630 9860 10087 10311 10531 10749 10963 11174 11381 11585 11786 11982 12176 12365 12551 12733 12911 13085 13255 13421 13583 13741 13894 14044 14189 14330 14466 14598 14726 14849 14968 15082 15191 15296 15396 15491 15582 15668 15749 15826 15897 15964 16026 16083 16135 16182 16225 16262 16294 16322 16344 16362 16374 16382 16384 " +global Af ulong 6 +global Ab long 4 +global Ag long 640 +global Alpha uchar 65536 +global Asin long 91 +global Afpos ulong 2 +global Apen long 2 +global Arc long 6 +fn afsqrt value ulong to ulong +ret 0 +end +fn afsin deg long to long +ret 0 +end +fn afcos deg long to long +ret 0 +end +fn afinit cap ulong wt ulong to bool +ret false +end +fn afglyph c uchar to bool +ret false +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +global Oldmask uchar 65536 +global Oldmeta ulong 6 +fn test ok bool to void +check ok add get Checks 0 1 +end +fn asym to bool +w = get Af 3 +for y ulong get Af 4 +at = mul y w +for x ulong w +a = long get Alpha add at x +mirror = add at sub sub w 1 x +b = long get Alpha mirror +d = sub a b +if gt d 40 +ret false +end +if lt d -40 +ret false +end +end +end +ret true +end +fn main to int +test not afglyph 65 +test not afinit 0 1250 +test not afinit 65 1250 +test not afinit 30 0 +test not afinit 30 2501 +test afinit 30 1250 +test eq get Af 0 384 +test eq get Af 1 480 +test eq afsqrt 0 0 +test eq afsqrt 15 3 +test eq afsqrt 16 4 +test eq afsqrt 18446744073709551615 4294967295 +test eq afsqrt mul ulong 1000000007 1000000007 1000000007 +test eq afsin 0 0 +test eq afsin 90 16384 +test eq afsin -90 -16384 +test eq afsin 450 16384 +test eq afcos 180 -16384 +for c ulong 95 +test afglyph uchar add c 32 +test gt get Af 5 0 +test le mul get Af 3 get Af 4 len Alpha +if eq c 0 +test eq get Af 3 0 +test eq get Af 4 1 +else +ink = ulong 0 +for i ulong mul get Af 3 get Af 4 +if gt get Alpha i 128 +ink = add ink 1 +end +end +test ge ink 4 +end +end +test afglyph 111 +test asym +test afglyph 63 +for i ulong mul get Af 3 get Af 4 +put Oldmask i get Alpha i +end +for i ulong 6 +put Oldmeta i get Af i +end +test afglyph 0 +same = true +for i ulong 6 +if ne get Oldmeta i get Af i +same = false +end +end +for i ulong mul get Af 3 get Af 4 +if ne get Oldmask i get Alpha i +same = false +end +end +test same +test not afinit 999 1250 +test eq get Af 0 get Oldmeta 0 +test eq get Af 3 get Oldmeta 3 +test afinit 64 2500 +test afglyph 87 +test le mul get Af 3 get Af 4 len Alpha +test afinit 1 1 +test afglyph 65 +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L758/red5.exit b/evidence/allen-omega-L694/L758/red5.exit new file mode 100644 index 00000000..d00491fd --- /dev/null +++ b/evidence/allen-omega-L694/L758/red5.exit @@ -0,0 +1 @@ +1 diff --git a/evidence/allen-omega-L694/L758/red5.log b/evidence/allen-omega-L694/L758/red5.log new file mode 100644 index 00000000..40744aef --- /dev/null +++ b/evidence/allen-omega-L694/L758/red5.log @@ -0,0 +1,421 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 1 +7 1 +8 1 +9 0 +10 1 +11 1 +12 1 +13 1 +14 0 +15 1 +16 1 +17 1 +18 1 +19 1 +20 1 +21 0 +22 0 +23 1 +24 1 +25 1 +26 0 +27 1 +28 1 +29 1 +30 0 +31 1 +32 1 +33 1 +34 0 +35 1 +36 1 +37 1 +38 0 +39 1 +40 1 +41 1 +42 0 +43 1 +44 1 +45 1 +46 0 +47 1 +48 1 +49 1 +50 0 +51 1 +52 1 +53 1 +54 0 +55 1 +56 1 +57 1 +58 0 +59 1 +60 1 +61 1 +62 0 +63 1 +64 1 +65 1 +66 0 +67 1 +68 1 +69 1 +70 0 +71 1 +72 1 +73 1 +74 0 +75 1 +76 1 +77 1 +78 0 +79 1 +80 1 +81 1 +82 0 +83 1 +84 1 +85 1 +86 0 +87 1 +88 1 +89 1 +90 0 +91 1 +92 1 +93 1 +94 0 +95 1 +96 1 +97 1 +98 0 +99 1 +100 1 +101 1 +102 0 +103 1 +104 1 +105 1 +106 0 +107 1 +108 1 +109 1 +110 0 +111 1 +112 1 +113 1 +114 0 +115 1 +116 1 +117 1 +118 0 +119 1 +120 1 +121 1 +122 0 +123 1 +124 1 +125 1 +126 0 +127 1 +128 1 +129 1 +130 0 +131 1 +132 1 +133 1 +134 0 +135 1 +136 1 +137 1 +138 0 +139 1 +140 1 +141 1 +142 0 +143 1 +144 1 +145 1 +146 0 +147 1 +148 1 +149 1 +150 0 +151 1 +152 1 +153 1 +154 0 +155 1 +156 1 +157 1 +158 0 +159 1 +160 1 +161 1 +162 0 +163 1 +164 1 +165 1 +166 0 +167 1 +168 1 +169 1 +170 0 +171 1 +172 1 +173 1 +174 0 +175 1 +176 1 +177 1 +178 0 +179 1 +180 1 +181 1 +182 0 +183 1 +184 1 +185 1 +186 0 +187 1 +188 1 +189 1 +190 0 +191 1 +192 1 +193 1 +194 0 +195 1 +196 1 +197 1 +198 0 +199 1 +200 1 +201 1 +202 0 +203 1 +204 1 +205 1 +206 0 +207 1 +208 1 +209 1 +210 0 +211 1 +212 1 +213 1 +214 0 +215 1 +216 1 +217 1 +218 0 +219 1 +220 1 +221 1 +222 0 +223 1 +224 1 +225 1 +226 0 +227 1 +228 1 +229 1 +230 0 +231 1 +232 1 +233 1 +234 0 +235 1 +236 1 +237 1 +238 0 +239 1 +240 1 +241 1 +242 0 +243 1 +244 1 +245 1 +246 0 +247 1 +248 1 +249 1 +250 0 +251 1 +252 1 +253 1 +254 0 +255 1 +256 1 +257 1 +258 0 +259 1 +260 1 +261 1 +262 0 +263 1 +264 1 +265 1 +266 0 +267 1 +268 1 +269 1 +270 0 +271 1 +272 1 +273 1 +274 0 +275 1 +276 1 +277 1 +278 0 +279 1 +280 1 +281 1 +282 0 +283 1 +284 1 +285 1 +286 0 +287 1 +288 1 +289 1 +290 0 +291 1 +292 1 +293 1 +294 0 +295 1 +296 1 +297 1 +298 0 +299 1 +300 1 +301 1 +302 0 +303 1 +304 1 +305 1 +306 0 +307 1 +308 1 +309 1 +310 0 +311 1 +312 1 +313 1 +314 0 +315 1 +316 1 +317 1 +318 0 +319 1 +320 1 +321 1 +322 0 +323 1 +324 1 +325 1 +326 0 +327 1 +328 1 +329 1 +330 0 +331 1 +332 1 +333 1 +334 0 +335 1 +336 1 +337 1 +338 0 +339 1 +340 1 +341 1 +342 0 +343 1 +344 1 +345 1 +346 0 +347 1 +348 1 +349 1 +350 0 +351 1 +352 1 +353 1 +354 0 +355 1 +356 1 +357 1 +358 0 +359 1 +360 1 +361 1 +362 0 +363 1 +364 1 +365 1 +366 0 +367 1 +368 1 +369 1 +370 0 +371 1 +372 1 +373 1 +374 0 +375 1 +376 1 +377 1 +378 0 +379 1 +380 1 +381 1 +382 0 +383 1 +384 1 +385 1 +386 0 +387 1 +388 1 +389 1 +390 0 +391 1 +392 1 +393 1 +394 0 +395 1 +396 1 +397 1 +398 0 +399 1 +400 1 +401 0 +402 1 +403 1 +404 0 +405 0 +406 0 +407 0 +408 1 +409 1 +410 0 +411 1 +412 1 +413 1 +414 1 +415 0 +416 0 +417 1 +418 1 +419 1 +420 1 +421 0 diff --git a/evidence/allen-omega-L694/L758/red5.om b/evidence/allen-omega-L694/L758/red5.om new file mode 100644 index 00000000..5891021e --- /dev/null +++ b/evidence/allen-omega-L694/L758/red5.om @@ -0,0 +1,3977 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +note Stable application presentation; see PRESENTATION.md for scope and ownership. +global Ds ulong 8 +global Dt ulong 64 +global Dtext uchar 2304 +global Dsay ulong 1 +global Dm ulong 3 +global Dcode uchar 32768 +global Dstart ulong 4096 +global Dlen ulong 4096 +global Dline ulong 4096 +global Dview ulong 3 +global Din uchar 8192 +fn dscene to bool +n = get Inlen 0 +for i ulong 8192 +put Din i get In i +end +for i ulong get R 8 +put In i get Answer i +end +put Inlen 0 get R 8 +ok = scdecode +for i ulong 8192 +put In i get Din i +end +put Inlen 0 n +if not ok +ret false +end +for i ulong 8 +put Ds i get Sc i +end +for i ulong 64 +put Dt i get Things i +end +for i ulong 2304 +put Dtext i 0 +end +for i ulong get Sc 4 +put Dtext i get Stext i +end +put Dsay 0 get Sw 3 +put Dm 0 1 +ret true +end +fn dcode to bool +if or le get R 2 1 ne get R 1 0 +ret false +end +if or eq get R 6 0 ne get C 0 get R 0 +ret false +end +if not rows 80 4096 +ret false +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong get C 2 +put Dcode i get Code i +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong get View 0 +put Dstart i get Rowst i +put Dlen i get Rowlen i +put Dline i get Rowline i +end +put Dview 0 get View 0 +put Dview 1 0 +put Dview 2 get C 2 +put Dm 1 1 +ret true +end +fn dpresent to bool +if or eq get A 0 0 ne get A 2 1 +ret false +end +if or gt get R 8 159 gt get Inlen 0 8192 +ret false +end +shown = dscene +coded = dcode +if or shown coded +put Dm 2 get R 0 +ret true +end +ret false +end +fn dask now ulong to bool +if not appask now +ret false +end +b = dpresent +ret true +end +fn drecv now ulong to bool +if not appreceive now +ret false +end +b = dpresent +ret true +end +fn dreset to void +appreset +for i ulong 8 +put Ds i 0 +end +for i ulong 64 +put Dt i 0 +end +for i ulong 2304 +put Dtext i 0 +end +put Dsay 0 0 +for i ulong 3 +put Dm i 0 +put Dview i 0 +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong 8192 +put Din i 0 +end +end +note Declarative Allen glyph designs and integer sine samples, retained from +note native/kernel/ui/allen_font.c at4c7888f. No foreign executable implementation. +text Afdata "w6|w6 M3,0 L3,14 D3,20|w10 M3,0 L3,5 M7,0 L7,5|w15 M6,2 L4,20 M11,2 L9,20 M2,8 L13,8 M1,14 L12,14|w15 A8,5,5,5,-30,-270 A8,15,5,5,270,510 M8,-2 L8,22|w16 A4,4,2,3,0,360 A12,16,2,3,0,360 M13,1 L3,19|w16 M14,20 L5,9 A7,5,3,4,150,400 L3,14 A7,15,4,5,180,60 L13,11|w6 M3,0 L3,5|w9 A10,10,6,12,240,120|w9 A-1,10,6,12,-60,60|w14 M7,2 L7,10 M3,4 L11,8 M11,4 L3,8|w14 M2,12 L12,12 M7,7 L7,17|w6 M3,19 L2,23|w11 M2,13 L9,13|w6 D3,20|w12 M10,0 L2,20|w14 A7,10,5,10,0,360|w14 M3,4 L8,0 L8,20|w14 A7,6,5,6,200,400 L2,20 L12,20|w14 A7,5,5,5,200,450 A7,15,5,5,270,520|w14 M10,20 L10,0 L1,14 L13,14|w14 M12,0 L4,0 L4,9 A7,14,5,6,235,520|w14 A7,14,5,6,0,360 M10,0 L3,11|w14 M2,0 L12,0 L5,20|w14 A7,5,4,5,0,360 A7,15,5,5,0,360|w14 A7,6,5,6,0,360 M4,20 L11,9|w6 D3,8 D3,20|w6 D3,8 M3,19 L2,23|w14 M12,6 L2,12 L12,18|w14 M2,10 L12,10 M2,15 L12,15|w14 M2,6 L12,12 L2,18|w14 A7,5,5,5,190,450 L7,14 D7,20|w19 A9,12,3,4,0,360 M12,8 L12,14 A14,14,2,2,180,0 A9,11,7,9,0,-300|w16 M2,20 L8,0 L14,20 M4,13 L12,13|w15 M2,0 L2,20 M2,0 L8,0 A8,5,4,5,270,450 L2,10 M2,10 L9,10 A9,15,4,5,270,450 L2,20|w17 A9,10,7,10,45,315|w16 M2,0 L2,20 M2,0 L6,0 A6,10,8,10,270,450 L2,20|w14 M12,0 L2,0 L2,20 L12,20 M2,10 L10,10|w13 M12,0 L2,0 L2,20 M2,10 L10,10|w18 A9,10,7,10,-45,-360 M11,10 L16,10|w16 M2,0 L2,20 M14,0 L14,20 M2,10 L14,10|w6 M3,0 L3,20|w13 M10,0 L10,14 A6,14,4,6,0,180|w15 M2,0 L2,20 M13,0 L2,12 M6,8 L14,20|w13 M2,0 L2,20 L12,20|w20 M2,20 L2,0 L10,14 L18,0 L18,20|w16 M2,20 L2,0 L14,20 L14,0|w20 A10,10,8,10,0,360|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10|w20 A10,10,8,10,0,360 M12,14 L18,21|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10 M8,10 L14,20|w16 A8,5,5,5,-30,-270 A8,15,5,5,270,510|w16 M1,0 L15,0 M8,0 L8,20|w16 M2,0 L2,13 A8,13,6,7,180,0 L14,0|w16 M1,0 L8,20 L15,0|w22 M1,0 L6,20 L11,0 L16,20 L21,0|w16 M2,0 L14,20 M14,0 L2,20|w16 M1,0 L8,10 L15,0 M8,10 L8,20|w16 M2,0 L14,0 L2,20 L14,20|w9 M7,-1 L3,-1 L3,21 L7,21|w12 M2,0 L10,20|w9 M2,-1 L6,-1 L6,21 L2,21|w12 M2,8 L6,1 L10,8|w14 M1,23 L13,23|w7 M2,0 L4,4|w15 A7,14,5,6,0,360 M12,8 L12,20|w15 M2,0 L2,20 A7,14,5,6,0,360|w13 A7,14,5,6,40,320|w15 A7,14,5,6,0,360 M12,0 L12,20|w14 M2,14 L12,14 A7,14,5,6,0,-320|w11 M5,20 L5,4 A9,4,4,4,180,300 M2,8 L10,8|w15 A7,14,5,6,0,360 M12,8 L12,22 A7,22,5,5,0,150|w15 M2,0 L2,20 A7,13,5,5,180,360 L12,20|w6 M3,8 L3,20 D3,3|w7 M4,8 L4,22 A0,22,4,5,0,120 D4,3|w13 M2,0 L2,20 M11,8 L2,15 M5,13 L12,20|w6 M3,0 L3,20|w21 M2,8 L2,20 A6,12,4,4,180,360 L10,20 A14,12,4,4,180,360 L18,20|w15 M2,8 L2,20 A7,13,5,5,180,360 L12,20|w14 A7,14,5,6,0,360|w15 M2,8 L2,27 A7,14,5,6,0,360|w15 A7,14,5,6,0,360 M12,8 L12,27|w10 M2,8 L2,20 A7,13,5,5,180,290|w14 A7,11,4,3,-30,-270 A7,17,4,3,270,510|w11 M5,2 L5,17 A8,17,3,3,180,40 M2,8 L10,8|w15 M2,8 L2,15 A7,15,5,5,180,0 M12,8 L12,20|w14 M2,8 L7,20 L12,8|w20 M2,8 L6,20 L10,8 L14,20 L18,8|w14 M2,8 L12,20 M12,8 L2,20|w14 M2,8 L7,20 M12,8 L4,27|w14 M2,8 L12,8 L2,20 L12,20|w10 M8,-1 L6,0 L6,8 L4,10 L6,12 L6,20 L8,21|w6 M3,-1 L3,23|w10 M2,-1 L4,0 L4,8 L6,10 L4,12 L4,20 L2,21|w14 M2,13 L5,11 L9,14 L12,12|" +text Afsines "0 286 572 857 1143 1428 1713 1997 2280 2563 2845 3126 3406 3686 3964 4240 4516 4790 5063 5334 5604 5872 6138 6402 6664 6924 7182 7438 7692 7943 8192 8438 8682 8923 9162 9397 9630 9860 10087 10311 10531 10749 10963 11174 11381 11585 11786 11982 12176 12365 12551 12733 12911 13085 13255 13421 13583 13741 13894 14044 14189 14330 14466 14598 14726 14849 14968 15082 15191 15296 15396 15491 15582 15668 15749 15826 15897 15964 16026 16083 16135 16182 16225 16262 16294 16322 16344 16362 16374 16382 16384 " +global Af ulong 6 +global Ab long 4 +global Ag long 640 +global Alpha uchar 65536 +global Asin long 91 +global Afpos ulong 2 +global Apen long 2 +global Arc long 6 +fn afsqrt value ulong to ulong +ret 0 +end +fn afsin deg long to long +ret 0 +end +fn afcos deg long to long +ret 0 +end +fn afinit cap ulong wt ulong to bool +ret false +end +fn afglyph c uchar to bool +ret false +end +fn afalpha px long py long to uchar +ret 0 +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +global Oldmask uchar 65536 +global Oldmeta ulong 6 +fn test ok bool to void +check ok add get Checks 0 1 +end +fn asym to bool +w = get Af 3 +for y ulong get Af 4 +at = mul y w +for x ulong w +a = long get Alpha add at x +mirror = add at sub sub w 1 x +b = long get Alpha mirror +d = sub a b +if gt d 40 +ret false +end +if lt d -40 +ret false +end +end +end +ret true +end +fn main to int +test not afglyph 65 +test not afinit 0 1250 +test not afinit 65 1250 +test not afinit 30 0 +test not afinit 30 2501 +test afinit 30 1250 +test eq get Af 0 384 +test eq get Af 1 480 +test eq afsqrt 0 0 +test eq afsqrt 15 3 +test eq afsqrt 16 4 +test eq afsqrt 18446744073709551615 4294967295 +test eq afsqrt mul ulong 1000000007 1000000007 1000000007 +test eq afsin 0 0 +test eq afsin 90 16384 +test eq afsin -90 -16384 +test eq afsin 450 16384 +test eq afcos 180 -16384 +for c ulong 95 +test afglyph uchar add c 32 +test gt get Af 5 0 +test le mul get Af 3 get Af 4 len Alpha +if eq c 0 +test eq get Af 3 0 +test eq get Af 4 1 +else +ink = ulong 0 +for i ulong mul get Af 3 get Af 4 +if gt get Alpha i 128 +ink = add ink 1 +end +end +test ge ink 4 +end +end +test afglyph 111 +test asym +test afglyph 63 +for i ulong mul get Af 3 get Af 4 +put Oldmask i get Alpha i +end +for i ulong 6 +put Oldmeta i get Af i +end +test afglyph 0 +same = true +for i ulong 6 +if ne get Oldmeta i get Af i +same = false +end +end +for i ulong mul get Af 3 get Af 4 +if ne get Oldmask i get Alpha i +same = false +end +end +test same +test not afinit 999 1250 +test eq get Af 0 get Oldmeta 0 +test eq get Af 3 get Oldmeta 3 +test afinit 64 2500 +test afglyph 87 +test le mul get Af 3 get Af 4 len Alpha +test afinit 1 1 +test afglyph 65 +note Independent analytic coverage for round-capped strokes and zero-length dots. +put Af 2 1 +put Af 1 128 +put Ag 0 0 +put Ag 1 0 +put Ag 2 512 +put Ag 3 0 +test eq afalpha 256 0 255 +test eq afalpha 256 128 127 +test eq afalpha 256 256 0 +test eq afalpha 768 0 0 +test eq afalpha -128 0 127 +put Ag 0 512 +put Ag 2 0 +test eq afalpha 256 128 127 +put Ag 0 0 +test eq afalpha 0 0 255 +test eq afalpha 0 128 127 +test eq afalpha 0 256 0 +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L758/reply.log b/evidence/allen-omega-L694/L758/reply.log new file mode 100644 index 00000000..d11a72ad --- /dev/null +++ b/evidence/allen-omega-L694/L758/reply.log @@ -0,0 +1,15 @@ +801 0 +802 0 +803 0 +804 0 +805 0 +806 0 +807 0 +808 0 +809 0 +810 0 +811 0 +812 0 +813 0 +814 0 +815 0 diff --git a/evidence/allen-omega-L694/L758/runtime.log b/evidence/allen-omega-L694/L758/runtime.log new file mode 100644 index 00000000..5168e6f3 --- /dev/null +++ b/evidence/allen-omega-L694/L758/runtime.log @@ -0,0 +1,28 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 diff --git a/evidence/allen-omega-L694/L758/scene-input.log b/evidence/allen-omega-L694/L758/scene-input.log new file mode 100644 index 00000000..edd8e122 --- /dev/null +++ b/evidence/allen-omega-L694/L758/scene-input.log @@ -0,0 +1,63 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 diff --git a/evidence/allen-omega-L694/L758/scene.log b/evidence/allen-omega-L694/L758/scene.log new file mode 100644 index 00000000..44a4b2b1 --- /dev/null +++ b/evidence/allen-omega-L694/L758/scene.log @@ -0,0 +1,14 @@ +1001 0 +1002 0 +1003 0 +1004 0 +1005 0 +1006 0 +1007 0 +1008 0 +1009 0 +1010 0 +1011 0 +1012 0 +1013 0 +1014 0 diff --git a/evidence/allen-omega-L694/L758/scenecap-mutant.log b/evidence/allen-omega-L694/L758/scenecap-mutant.log new file mode 100644 index 00000000..502843ec --- /dev/null +++ b/evidence/allen-omega-L694/L758/scenecap-mutant.log @@ -0,0 +1,63 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 1 +60 0 +61 0 +62 1 +63 1 diff --git a/evidence/allen-omega-L694/L758/scheduler.log b/evidence/allen-omega-L694/L758/scheduler.log new file mode 100644 index 00000000..1d8ffd12 --- /dev/null +++ b/evidence/allen-omega-L694/L758/scheduler.log @@ -0,0 +1,213 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 +183 0 +184 0 +185 0 +186 0 +187 0 +188 0 +189 0 +190 0 +191 0 +192 0 +193 0 +194 0 +195 0 +196 0 +197 0 +198 0 +199 0 +200 0 +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 diff --git a/evidence/allen-omega-L694/L758/session-mutant.log b/evidence/allen-omega-L694/L758/session-mutant.log new file mode 100644 index 00000000..9ce7ef78 --- /dev/null +++ b/evidence/allen-omega-L694/L758/session-mutant.log @@ -0,0 +1,24 @@ +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 1 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 diff --git a/evidence/allen-omega-L694/L758/short.log b/evidence/allen-omega-L694/L758/short.log new file mode 100644 index 00000000..a9da2dc8 --- /dev/null +++ b/evidence/allen-omega-L694/L758/short.log @@ -0,0 +1,20 @@ +401 0 +410 0 +411 0 +412 0 +413 0 +414 0 +402 0 +403 0 +404 0 +405 0 +406 0 +700 0 +701 0 +702 0 +703 0 +704 0 +705 0 +407 0 +408 0 +409 0 diff --git a/evidence/allen-omega-L694/L758/source.sha256 b/evidence/allen-omega-L694/L758/source.sha256 new file mode 100644 index 00000000..0ae53003 --- /dev/null +++ b/evidence/allen-omega-L694/L758/source.sha256 @@ -0,0 +1,62 @@ +56936108de0087499bb62a117a275f27b01d7bfb05eb8f6250f13ab8783e1095 native/omega/allen/application.om +184f4270c72c4eca6a7afdd28b70a608f2e237980b12c8a7bfc2c7d2c3e625b9 native/omega/allen/base.om +795ca28627a19f1088de0f23277e79cdac921ff88451c606c7b655ce0f2e8a5b native/omega/allen/build-one.sh +4d2235ac5d6b237695b1c3112f70ebdfa0cebafa2ec8e691e4be4de37a62199b native/omega/allen/code.om +75e86e193346a5548e596c84fa7d65aaeefd69f9979a648e0bf53f0f97cd9eb4 native/omega/allen/context.om +76ee9cdeaac036905c76dfa29f42bf5a78d1259ad1656adfaa24916c3b93550d native/omega/allen/courier.om +f8c559b449c81159172d3e08f185e1fcd9ac446ab594420d07221ca68ffa87d5 native/omega/allen/font-data.om +79e5c778e31f9753553ade367c7de2a5a2521bef7247672cab7498f3ba32d9e6 native/omega/allen/FONT.md +c62f5a799b601315e61b05283295810a084d1adcc06b5bddc34010f3b344b915 native/omega/allen/font.om +b861dbdc9ef3a29157c10500767de69d2a1f5478d0bcdbbfd767bd5d69e587e2 native/omega/allen/gate.sh +9d71a653870eeef678f95df04db9c38aedaadd06e7c74bf3e5d9fde6e28f82f8 native/omega/allen/golden.sh +06087bc573ebb876a0ed80f6025c592fb4b1d23335169c3da402824fd1482c35 native/omega/allen/intent.om +4bc37c95d553364c5d2925d8ff9e8a53b1a61974513e6f492f77b7ebb05bbda4 native/omega/allen/main.om +068292abd04d3a61b063fc5380b22a56c4235a87915c219ebf3b37d16d7bc9c7 native/omega/allen/memory.om +b4d7b6e6cd680d2ba1eec2978b0cbb81ffc63035b73f5c3726bdad97a7b6aa04 native/omega/allen/paint.om +6afdb75311c0fbc5293034ac3ba315c231439c694750f6d8c3a1996cd34abff3 native/omega/allen/PRESENTATION.md +d3e3004fb587f75514c638b8b723c996303f664a74b653a6fc674f4600288d41 native/omega/allen/presentation.om +330b31b81a60f3dc553b87316d2fa1c3df9106af5fe7975911ba00b8c356f626 native/omega/allen/provider-core.om +258b9c1f6a7447540c9a8b8cbf2176165ab3e5d80e9528e0b06c37ea745490c1 native/omega/allen/PROVIDER.md +ef0d5dcc14b68bf4ee24468db703fd7dc98ffd982e045c719d42a78e442546ba native/omega/allen/provider.om +9d1603537e0c39cbc0949d724144168daa32875c2cfee435e64633fb7483ab4b native/omega/allen/README.md +e50a7f673aaee92aba4a3aec303aa93b071121c09ad05d4ad1dcc2deb9706dcc native/omega/allen/reply.om +5b01eae03204d08f6d207ef29f2ba09a1d9f249f1738f68f151214675a4ff2ed native/omega/allen/runtime.om +c16d61dbcb81f7ef8196c937929a53e47de3de0015e5d663bcd8e49b3cb05002 native/omega/allen/scene-input.om +c8d4a437b41538cc1eeb62a2029c6993d41e5ef90cc7b26c8e1c92bc98ec57d3 native/omega/allen/scene.om +615dff78462a715153b3d891b2cfe146c318d3a0a26ae1aaa642484f965c12df native/omega/allen/scheduler.om +f4e6bb5571a0700febdecfc6209ae1c088eab50a82bce4d8a10179408e3abb5f native/omega/allen/tests/application.om +f085198549d1c235a97574ff6f6560ce82217611f4051fc3dbbc8286aab6d536 native/omega/allen/tests/check.om +b76438a85257bd95768115047be286c107e3723628a16a0541870732d0849a42 native/omega/allen/tests/code.om +c61bb0ca8f70114e6fd180e9f9a48ec4d2f927152269c11bfc9df55dc13bc1bc native/omega/allen/tests/context.om +98105e1c30626f54da07940fe0415637730b7e112ea39ba2aae1f2d648993373 native/omega/allen/tests/courier.om +f524aab74657dc2e9e4330bf42bc05ef01ce3e8f08a05c80371be0c0a33764d3 native/omega/allen/tests/edges.om +a2e8bcde92d522216a4fa99559dd3bcba096aea86127364587dadcc2bfb585af native/omega/allen/tests/fixture.om +9c293d9f46e8815d96701ef9084deb34c24269d65677682a7be731e589e260bc native/omega/allen/tests/font-mutants.om +cf836ead7ced76a528bd2df1738a2255d9b37b4ab51702d593488bc94726f75a native/omega/allen/tests/font.om +7ef1280488f17ac3001876ca8f1d9a48e202f8fb3305d974e6cd33166458f8eb native/omega/allen/tests/font-output.om +a3e64c2054a9c83daacc8bd86ce5df0395014eb0ac2e237e63ade12dfb1a6bd8 native/omega/allen/tests/font-render.om +c9ef2bee7cbd1c072c6045d62c55f3bdd938901e91792cee72ea57fb8f25a198 native/omega/allen/tests/golden.om +8ba742d85ea510586f3cf86661bc0f28c5d99b59981c2d3fb220705efad24564 native/omega/allen/tests/intent.om +861d9af698b021056cceb6c00ae3458558db415963fe832d3fca7da55731cf7b native/omega/allen/tests/memory.om +13e4db7436165783c6aad48497ffe89fa6e5ba3de928e66a766c29e1e817fcf5 native/omega/allen/tests/paint.om +a36e1168fb5b19f5d1b444c6e0d171a6b55a0ffd7e1920438304afd0415d09ba native/omega/allen/tests/presentation-mutants.om +b051af93057752c3d361e1aa5a4dc31bd0853e09d2d2a213d82a282f5709f641 native/omega/allen/tests/presentation.om +e6d232d92d74d88423cebbbbfc6e403ea9b865b80c909e1d23087001d905035a native/omega/allen/tests/probe.om +4b942849652c81ee775b6089e2696c059de934d7fd0ff2a81ae380b2b39ffbfe native/omega/allen/tests/provider-core.om +b98923bd7df278ed0cd8a46c90d90fda296e27c8d60afdd4848ed86dba8221cc native/omega/allen/tests/provider-input.om +37480ca89922dea787a7acb72835a0109b3549461791e7499789ed25932b397c native/omega/allen/tests/provider-mutants.om +d1b1338b2cabe207c1cd9a4bd92b11f51502c29af4b754e2b39fac06d80b28ed native/omega/allen/tests/provider-output.om +8616252944ac2f2903427a6cbf165137087addf3eff169f05f6801d38dac0962 native/omega/allen/tests/provider-process.om +8fbc8a0517900efd771a994686356416a0fea5e20cfd9bc26c787850398113df native/omega/allen/tests/render.om +094a5e833bae7dfd3b013e3f015f143e9d7bd3efe9b9c896a7f58b09e1ec14b8 native/omega/allen/tests/reply.om +bab9b0e853aa4b62918353a5d1625a3171deebfb639e599fe9751b5a61a3df62 native/omega/allen/tests/runtime.om +c5847b4ea0c7df81691fadf9af2f258ad02d3fa588a400448f6d34d7819570b4 native/omega/allen/tests/scene-input.om +b9c84d9a58658589137764fe60209d8320550dd8ed99fa6026df65ba48737e4f native/omega/allen/tests/scene.om +bf984fa9cf63ddb569147afc2a028ccdafdbeae2067125cf35d658e5d00f4c94 native/omega/allen/tests/scheduler.om +521fff50f312b64801017b1349d9a31dac6eac50eb989d93d2dbac4e100f5007 native/omega/allen/tests/stdio-overflow.om +89aee5326b428147ea6da9aa739b6679e214ed114ae5f41d3b70299cf864092c native/omega/allen/tests/view.om +0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0 native/omega/allen/vendor/OMEGA-LICENSE +b234738e8ce81b3d67586deb41fdaab4543169d4b69e86fd3dc28a08432ab5fc native/omega/allen/vendor/PROVENANCE.md +992ec4a4957271b442740598136887a5c610effcd8ae9fb9480a006a4f181097 native/omega/allen/vendor/sha256-core.om +0781cdcec18570a57afbe3be4a6717dd2d1fa4c887b49a3e4cb542b594f8a041 native/omega/allen/vendor/sha256.om +abbefd2f7dc48f2ac28b9526f5c2e5b369da4b7c5e84dde6e6a3cd20bd5687ac native/omega/allen/view.om diff --git a/evidence/allen-omega-L694/L758/stale-mutant.log b/evidence/allen-omega-L694/L758/stale-mutant.log new file mode 100644 index 00000000..ac2e3d09 --- /dev/null +++ b/evidence/allen-omega-L694/L758/stale-mutant.log @@ -0,0 +1,28 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 1 +7 1 +8 1 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 diff --git a/evidence/allen-omega-L694/L758/staleview-mutant.log b/evidence/allen-omega-L694/L758/staleview-mutant.log new file mode 100644 index 00000000..c0c96c65 --- /dev/null +++ b/evidence/allen-omega-L694/L758/staleview-mutant.log @@ -0,0 +1,75 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 1 +35 1 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 diff --git a/evidence/allen-omega-L694/L758/summary.json b/evidence/allen-omega-L694/L758/summary.json new file mode 100644 index 00000000..521809be --- /dev/null +++ b/evidence/allen-omega-L694/L758/summary.json @@ -0,0 +1,63 @@ +{ + "base": "4c7888f65dca209a1e2b859ba695ae308657c03e", + "checks": { + "runtime": 28, + "code": 23, + "courier": 24, + "scheduler": 213, + "application": 182, + "provider-core": 100, + "memory": 79, + "context": 142, + "intent": 8, + "reply": 15, + "view": 13, + "scene": 14, + "scene-input": 63, + "paint": 11, + "edges": 352, + "short": 20, + "long": 292, + "provider-stream": 292, + "provider-fragment": 292, + "provider-process": 3, + "provider-consumer": 3, + "provider-producer": 3, + "provider-bad-1": 5, + "provider-bad-2": 5, + "provider-bad-3": 5, + "provider-bad-4": 5, + "provider-bad-5": 5, + "provider-bad-6": 17, + "presentation": 75, + "font": 421 + }, + "total_checks": 2710, + "compiled_rejected_mutants": { + "inputtail-mutant": 1, + "session-mutant": 1, + "appcode-mutant": 3, + "contextjob-mutant": 36, + "readback-mutant": 7, + "staleview-mutant": 2, + "fontroot-mutant": 11, + "fontalpha-mutant": 2, + "hash-mutant": 2, + "contextnote-mutant": 5, + "autosent-mutant": 8, + "thinking-mutant": 6, + "pendingwire-mutant": 1, + "scenecap-mutant": 3, + "crc-mutant": 2, + "ackstop-mutant": 27, + "stale-mutant": 3, + "framecheck-mutant": 4, + "keepalive-mutant": 40 + }, + "font_records": 294, + "font_bytes": 436341, + "font_sha256": "0dc4abaa8c8cc1c5a79772bdd00b2d74458beac6ccfe85637069d04c77a7ff69", + "specimen_ppm_sha256": "dec95182af5faa01ed739336ed32dcadd5168e6be35bef310042fe032113ee7f", + "compiler_sha256": "191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9", + "scope": "Native host font component; full UI/layout/device/live/iMac NOT_RUN" +} diff --git a/evidence/allen-omega-L694/L758/thinking-mutant.log b/evidence/allen-omega-L694/L758/thinking-mutant.log new file mode 100644 index 00000000..74b41a12 --- /dev/null +++ b/evidence/allen-omega-L694/L758/thinking-mutant.log @@ -0,0 +1,63 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 1 +15 1 +16 0 +17 0 +18 0 +19 1 +20 1 +21 1 +22 1 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 diff --git a/evidence/allen-omega-L694/L758/view.log b/evidence/allen-omega-L694/L758/view.log new file mode 100644 index 00000000..8b194f11 --- /dev/null +++ b/evidence/allen-omega-L694/L758/view.log @@ -0,0 +1,13 @@ +901 0 +902 0 +903 0 +904 0 +905 0 +906 0 +907 0 +908 0 +909 0 +910 0 +911 0 +912 0 +913 0 diff --git a/evidence/allen-omega-L694/L763/README.md b/evidence/allen-omega-L694/L763/README.md new file mode 100644 index 00000000..0459d4db --- /dev/null +++ b/evidence/allen-omega-L694/L763/README.md @@ -0,0 +1,17 @@ +# L763 executable provider/presentation attachment + +ASK/RECV/RESET now call dask/drecv/dreset. Presentation definitions precede the +provider in the seed concatenation. Input/output framing remains version1 and +byte-identical to L758's real normal and fragmented entry runs. New native prdo +assertions expose retained scene/code state, malformed and semantic refusal +isolation, pending-wire preservation and reset. Unchanged provider:24 failures +among136 assertions,exit1. Three-call attachment:136/136. All combined native +gates and22 compiled mutants pass; exact row counts are in summary.json. The +three new Omega-constructed mutants individually bypass ASK,RECV or RESET. + +Reproduce with `quiet-build native/omega/allen/gate.sh /absolute/fresh/output`. +Host orchestration compiles, wires and compares; new behavioral assertions and +mutation construction are Omega. The renderer still must consume D* buffers: +this change supplies neither pixels nor actual device/network/storage backends. +Independent review of this attachment is pending. The separate font review is +published under L758/independent-review and does not certify this new dispatch. diff --git a/evidence/allen-omega-L694/L763/ackstop-mutant.log b/evidence/allen-omega-L694/L763/ackstop-mutant.log new file mode 100644 index 00000000..5d0598cb --- /dev/null +++ b/evidence/allen-omega-L694/L763/ackstop-mutant.log @@ -0,0 +1,213 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 1 +65 1 +66 0 +67 0 +68 0 +69 1 +70 1 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 1 +165 0 +166 0 +167 0 +168 0 +169 1 +170 0 +171 1 +172 1 +173 0 +174 1 +175 0 +176 0 +177 0 +178 1 +179 0 +180 1 +181 0 +182 1 +183 0 +184 1 +185 0 +186 1 +187 0 +188 1 +189 0 +190 1 +191 0 +192 1 +193 0 +194 1 +195 1 +196 1 +197 1 +198 0 +199 1 +200 0 +201 0 +202 1 +203 1 +204 1 +205 0 +206 1 +207 1 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 diff --git a/evidence/allen-omega-L694/L763/appcode-mutant.log b/evidence/allen-omega-L694/L763/appcode-mutant.log new file mode 100644 index 00000000..c9c50601 --- /dev/null +++ b/evidence/allen-omega-L694/L763/appcode-mutant.log @@ -0,0 +1,182 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 1 +76 1 +77 1 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 diff --git a/evidence/allen-omega-L694/L763/application.log b/evidence/allen-omega-L694/L763/application.log new file mode 100644 index 00000000..2e8a428d --- /dev/null +++ b/evidence/allen-omega-L694/L763/application.log @@ -0,0 +1,182 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 diff --git a/evidence/allen-omega-L694/L763/autosent-mutant.log b/evidence/allen-omega-L694/L763/autosent-mutant.log new file mode 100644 index 00000000..6b9b9f3a --- /dev/null +++ b/evidence/allen-omega-L694/L763/autosent-mutant.log @@ -0,0 +1,136 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 1 +51 0 +52 0 +53 1 +54 1 +55 0 +56 1 +57 0 +58 1 +59 0 +60 0 +61 0 +62 1 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 1 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 1 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 diff --git a/evidence/allen-omega-L694/L763/binaries.sha256 b/evidence/allen-omega-L694/L763/binaries.sha256 new file mode 100644 index 00000000..074f6355 --- /dev/null +++ b/evidence/allen-omega-L694/L763/binaries.sha256 @@ -0,0 +1,54 @@ +1ec8ee3cae7f12c5bc6c70e7db8620b5c0e35a995badd6ed5127dfcd2bcd1a34 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/provider-display-mutants +ef1a108242bf2d963f2f93d057eb0efb1776f3510824ba517f96bfeacb96689f /home/drakestapleton/handoffs/allen-omega-L694/L763/full/provider-core +8df1aa6f0286d1676d8a8f1862586c94c08d092f56ccf0aa623e1769626ccdbc /home/drakestapleton/handoffs/allen-omega-L694/L763/full/scheduler +71a2937774ff546659cff960d47f54319e86ff779ad9910ea02fb00fda050823 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/readback-mutant +c61300f3dab3af927a83e725cf98b77dd10a2f7743c08952d7e02a9879faedf7 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/font-render +8bf7269290ffc0127996ab465f9c1054d3c1dafe6ec392f1154a10184551a5db /home/drakestapleton/handoffs/allen-omega-L694/L763/full/view +25fd37be15b3ec92c9257f4123f953524a43a0be5f86983a5283646a6911b11a /home/drakestapleton/handoffs/allen-omega-L694/L763/full/contextnote-mutant +f423950efbb8ef94a93c858bb19491a9522105f486c4bd2b9d933a32bc6682f8 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/font +b0d00466da64cba6b5ac71ae8dd9a599acb1c03ddbd66c8c732e1be0f34867d6 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/allen +61c64aaf5aabb89a116e55f4105bb2e991aebb328dcdb58298fae6a5af35592d /home/drakestapleton/handoffs/allen-omega-L694/L763/full/reply +c14e68cb12ccf18879b9d61cd4c2d5ed2fb4eaa45b9069d9ad0da102d7e5dde9 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/thinking-mutant +53f05625250617f62c6df5b5f6c6773375e1cf470f7b4077741ebe985bf33d9f /home/drakestapleton/handoffs/allen-omega-L694/L763/full/inputtail-mutant +3e00b01a876f0033dc1b8cbc70e62835fd4cac7ffef48d78903d4f35659d3e42 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/ackstop-mutant +6f4e108fc12db3e95b069670c0bc606c73438d8162bf1eaf1e6a758a12565eb8 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/hash-mutant +dd2c6b0fe146386a43d350de94206be7e806e578b8e2e582f594765738d75e91 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/golden +c5477e4898070cc29cb2ec41df3b435c99eeec149327bb714ce8b0e4f9475aa6 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/session-mutant +ef499aa5d7bd0afb25ee742de319a90f1e9e414e9bb75eed1fc8fb26df0f8aac /home/drakestapleton/handoffs/allen-omega-L694/L763/full/scene-input +5f60d27d81afd48f83a1dd803986676e8cb8be363af7c6d21bf1e184e9f4c9f7 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/intent +72985ec83bad7aed1c1593ac1379154b34965765b9888502a16dd996115f294e /home/drakestapleton/handoffs/allen-omega-L694/L763/full/provider-input +aafc97eda7823f4653518db7b5a568a7b3d7fa58c6259293af934827ea50082a /home/drakestapleton/handoffs/allen-omega-L694/L763/full/rawask-mutant +34c901cfb34adcbba1212045f9209a5fb3f385b9011c116be8bf8be9ed173f41 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/font-mutants +5e232b22df0b515b7fc96bcd9e85ab1011b1778ec43439942b0d78e3bd782519 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/fixture +4021dd66d7ec338426210bf2f0d139c1225e3cc2e3207fbfd4b0e1bbba9fa8ca /home/drakestapleton/handoffs/allen-omega-L694/L763/full/provider +7885d6dffd0b6810c197c2ec35bbd8c311e5579fe0db98442220e0966d147b60 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/context +0251c5ea72fc5e24c102a9d64a3651913e5a2e15c6464c3844df1044892ffca5 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/staleview-mutant +322432e423eb8a6e77299833fb74ad1ad88b55343d84efa718f9139d2cbee32d /home/drakestapleton/handoffs/allen-omega-L694/L763/full/runtime +6c2e4af2a56193428b18860ad837998e97ef7630412dc4c3d0b43fc40f443d77 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/code +52ffd81fe79089c4e03accba53621f9f90c52d6ae2be6e33fdd0f09e42c07642 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/provider-mutants +8077cc463bf73f332679736412a1ddf1fd400f3905a5ea98fbe858db8601291e /home/drakestapleton/handoffs/allen-omega-L694/L763/full/edges +a389d7dd2f8de1f6d69d888c3ddec7e0fa293ed8eec0504b43d35d2ca79e2463 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/presentation-mutants +d9a547d7307fb68081dce6e9a28914dba9876acf3882be598db4c35e425ae38f /home/drakestapleton/handoffs/allen-omega-L694/L763/full/appcode-mutant +ce57ddf83634a696cc5992db397609fd34d25e76ccf11c511f9507b015ccc5b2 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/render +154cea536c380b71913a6f11a18a0b572c4cca7b62146a16f722b4b650008a8e /home/drakestapleton/handoffs/allen-omega-L694/L763/full/rawrecv-mutant +0be61adc5267f441504ee254d02df7b7b81a3fa41ccf6b39eeb409ff63cbc422 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/stale-mutant +b44d34cb7967d3268b6329a8ff28fdea0ffa3d8828ec10aecbe6d3747091d2b6 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/courier +3f2a500a3f1ed557d8d85909989239d92aeac640d83979cdbdba8f8d84229ab5 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/scene +8f034c096fe64c9126f2b56102725ffbe744ee2c3f034aae018a8a0031236256 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/presentation +e56682a4e44021d5e4a067661fc8487caf6bf3385ff7281e277dae9e32f90504 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/pendingwire-mutant +c0b59bf542e138bab5ebdefbcd3ed1c847651d4c245f717c73ac7464e52b483e /home/drakestapleton/handoffs/allen-omega-L694/L763/full/font-output +b10b181d5b8ed7b5e5fd1aa9130df2984555ad61cea089d21af467900da8dc2e /home/drakestapleton/handoffs/allen-omega-L694/L763/full/framecheck-mutant +ff6ad15f3c5ecf8324b84de510796a5e4dd5f52fcd6127138528b5db8dbdc240 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/scenecap-mutant +642848f0927421b4a0e81ad93e9183a1fbeec0ddd44f8d44dd1b37f132331efd /home/drakestapleton/handoffs/allen-omega-L694/L763/full/fontroot-mutant +595b1c61db6f56ae228db770b4ff806905156ddca37951e009674c9e9f7c395d /home/drakestapleton/handoffs/allen-omega-L694/L763/full/contextjob-mutant +ab17527c65b822c0b0bb8fd2874b5932adb67d6c3fe05de6edc6850f04789121 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/paint +7b3e0f79b27550418b3a8599cdc75c748b73f8188791cb6637b4fc620c32ab6d /home/drakestapleton/handoffs/allen-omega-L694/L763/full/crc-mutant +c28b1df1974c032a70fd56a22eca3cceea0987840f7531f5589e308ad9d10119 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/autosent-mutant +a4bb2c03c3b161776d47962b015381c761c46bd55d3ba8eb18ba63a713abaf6d /home/drakestapleton/handoffs/allen-omega-L694/L763/full/provider-output +71f99242bcad6ede239b240602470fcf3d5da3267eb47a1ad522241958222367 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/stdio-overflow-input +cbc5606e902084c44352e3012dfac569e49d999502fb3e257e16263f3ddb5fc3 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/keepalive-mutant +0c6789d6a8ff1be8a44d603ad4c99ff95eae1c1f32a4544f9ebff676beed3d73 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/provider-process +d58ba602764de22eddc69f93660e3523f20563c03338f80ca268f0a015043848 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/memory +4ecc21031c9035e61bbfd1f50f405bc5ef23a67e57d19adcc458089dc68f05bb /home/drakestapleton/handoffs/allen-omega-L694/L763/full/fontalpha-mutant +d51d367e98d402e99884ea89962508abbaa2b35bf8f38d9521b3f51dfaf68b05 /home/drakestapleton/handoffs/allen-omega-L694/L763/full/application +925064aa966d2823e4f8deb4a3e7ec5208a31f4cf581628120121e5364c70f3a /home/drakestapleton/handoffs/allen-omega-L694/L763/full/rawreset-mutant diff --git a/evidence/allen-omega-L694/L763/code.log b/evidence/allen-omega-L694/L763/code.log new file mode 100644 index 00000000..e7e197b7 --- /dev/null +++ b/evidence/allen-omega-L694/L763/code.log @@ -0,0 +1,23 @@ +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 diff --git a/evidence/allen-omega-L694/L763/context.log b/evidence/allen-omega-L694/L763/context.log new file mode 100644 index 00000000..df62cddb --- /dev/null +++ b/evidence/allen-omega-L694/L763/context.log @@ -0,0 +1,142 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 diff --git a/evidence/allen-omega-L694/L763/contextjob-mutant.log b/evidence/allen-omega-L694/L763/contextjob-mutant.log new file mode 100644 index 00000000..3432d4b2 --- /dev/null +++ b/evidence/allen-omega-L694/L763/contextjob-mutant.log @@ -0,0 +1,142 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 1 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 1 +72 1 +73 1 +74 1 +75 1 +76 1 +77 0 +78 0 +79 1 +80 1 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 1 +88 1 +89 0 +90 1 +91 0 +92 1 +93 0 +94 1 +95 0 +96 1 +97 0 +98 1 +99 0 +100 1 +101 0 +102 1 +103 0 +104 1 +105 0 +106 1 +107 0 +108 1 +109 1 +110 1 +111 1 +112 1 +113 1 +114 1 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 1 +123 0 +124 1 +125 0 +126 1 +127 0 +128 1 +129 0 +130 1 +131 0 +132 1 +133 0 +134 1 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 1 +142 1 diff --git a/evidence/allen-omega-L694/L763/contextnote-mutant.log b/evidence/allen-omega-L694/L763/contextnote-mutant.log new file mode 100644 index 00000000..b5c08759 --- /dev/null +++ b/evidence/allen-omega-L694/L763/contextnote-mutant.log @@ -0,0 +1,142 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 1 +38 1 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 1 +47 0 +48 1 +49 0 +50 0 +51 0 +52 0 +53 0 +54 1 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 diff --git a/evidence/allen-omega-L694/L763/courier.log b/evidence/allen-omega-L694/L763/courier.log new file mode 100644 index 00000000..8402df49 --- /dev/null +++ b/evidence/allen-omega-L694/L763/courier.log @@ -0,0 +1,24 @@ +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 diff --git a/evidence/allen-omega-L694/L763/crc-mutant.log b/evidence/allen-omega-L694/L763/crc-mutant.log new file mode 100644 index 00000000..a0d90bd4 --- /dev/null +++ b/evidence/allen-omega-L694/L763/crc-mutant.log @@ -0,0 +1,23 @@ +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 1 +117 1 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 diff --git a/evidence/allen-omega-L694/L763/edges.log b/evidence/allen-omega-L694/L763/edges.log new file mode 100644 index 00000000..e8d0deea --- /dev/null +++ b/evidence/allen-omega-L694/L763/edges.log @@ -0,0 +1,352 @@ +1201 0 +1202 0 +1203 0 +1204 0 +1205 0 +1206 0 +1207 0 +1208 0 +1209 0 +1210 0 +1211 0 +1212 0 +1213 0 +1214 0 +1220 0 +1221 0 +1222 0 +1223 0 +1224 0 +1225 0 +1226 0 +1227 0 +1228 0 +1229 0 +1230 0 +1231 0 +1232 0 +1233 0 +1234 0 +1235 0 +1236 0 +1237 0 +1238 0 +1239 0 +1240 0 +1241 0 +1242 0 +1243 0 +1244 0 +1245 0 +1246 0 +1247 0 +1248 0 +1249 0 +1250 0 +1251 0 +1252 0 +1253 0 +1254 0 +1255 0 +1256 0 +1257 0 +1258 0 +1259 0 +1260 0 +1261 0 +1262 0 +1301 0 +1302 0 +1303 0 +1304 0 +1305 0 +1306 0 +1310 0 +1311 0 +1312 0 +1313 0 +1314 0 +1315 0 +1316 0 +1317 0 +1318 0 +1319 0 +1320 0 +1321 0 +1322 0 +1323 0 +1324 0 +1325 0 +1326 0 +1327 0 +1328 0 +1329 0 +1330 0 +1331 0 +1332 0 +1333 0 +1334 0 +1335 0 +1336 0 +1337 0 +1338 0 +1339 0 +1340 0 +1341 0 +1342 0 +1343 0 +1344 0 +1345 0 +1346 0 +1347 0 +1348 0 +1349 0 +1350 0 +1351 0 +1352 0 +1353 0 +1354 0 +1355 0 +1356 0 +1357 0 +1358 0 +1359 0 +1360 0 +1361 0 +1362 0 +1363 0 +1364 0 +1365 0 +1366 0 +1367 0 +1368 0 +1369 0 +1370 0 +1371 0 +1372 0 +1373 0 +1374 0 +1375 0 +1376 0 +1377 0 +1378 0 +1379 0 +1380 0 +1381 0 +1382 0 +1383 0 +1384 0 +1385 0 +1386 0 +1387 0 +1388 0 +1389 0 +1390 0 +1391 0 +1392 0 +1393 0 +1394 0 +1395 0 +1396 0 +1397 0 +1398 0 +1399 0 +1400 0 +1401 0 +1402 0 +1403 0 +1404 0 +1405 0 +1406 0 +1407 0 +1408 0 +1409 0 +1410 0 +1411 0 +1412 0 +1413 0 +1414 0 +1415 0 +1416 0 +1417 0 +1418 0 +1419 0 +1420 0 +1421 0 +1422 0 +1423 0 +1424 0 +1425 0 +1426 0 +1427 0 +1428 0 +1429 0 +1430 0 +1431 0 +1432 0 +1433 0 +1434 0 +1435 0 +1436 0 +1437 0 +1438 0 +1439 0 +1440 0 +1441 0 +1442 0 +1443 0 +1444 0 +1445 0 +1446 0 +1447 0 +1448 0 +1449 0 +1450 0 +1451 0 +1452 0 +1453 0 +1454 0 +1455 0 +1456 0 +1457 0 +1458 0 +1459 0 +1460 0 +1461 0 +1462 0 +1463 0 +1464 0 +1465 0 +1466 0 +1467 0 +1468 0 +1469 0 +1470 0 +1471 0 +1472 0 +1473 0 +1474 0 +1475 0 +1476 0 +1477 0 +1478 0 +1479 0 +1480 0 +1481 0 +1482 0 +1483 0 +1484 0 +1485 0 +1486 0 +1487 0 +1488 0 +1489 0 +1490 0 +1491 0 +1492 0 +1493 0 +1494 0 +1495 0 +1496 0 +1497 0 +1498 0 +1499 0 +1500 0 +1501 0 +1502 0 +1503 0 +1504 0 +1505 0 +1506 0 +1507 0 +1508 0 +1509 0 +1510 0 +1511 0 +1512 0 +1513 0 +1514 0 +1515 0 +1516 0 +1517 0 +1518 0 +1519 0 +1520 0 +1521 0 +1522 0 +1523 0 +1524 0 +1525 0 +1526 0 +1527 0 +1528 0 +1529 0 +1530 0 +1531 0 +1532 0 +1533 0 +1534 0 +1535 0 +1536 0 +1537 0 +1538 0 +1539 0 +1540 0 +1541 0 +1542 0 +1543 0 +1544 0 +1545 0 +1546 0 +1547 0 +1548 0 +1549 0 +1550 0 +1551 0 +1552 0 +1553 0 +1554 0 +1555 0 +1556 0 +1557 0 +1558 0 +1559 0 +1560 0 +1561 0 +1562 0 +1563 0 +1564 0 +1565 0 +1570 0 +1571 0 +1572 0 +1575 0 +1573 0 +1574 0 +1600 0 +1601 0 +1602 0 +1603 0 +1604 0 +1605 0 +1606 0 +1607 0 +1610 0 +1611 0 +1612 0 +1613 0 +1614 0 +1615 0 +1616 0 +1617 0 +1701 0 +1702 0 +1703 0 +1704 0 +1705 0 +1706 0 +1707 0 +1708 0 +1709 0 +1710 0 +1711 0 diff --git a/evidence/allen-omega-L694/L763/font.log b/evidence/allen-omega-L694/L763/font.log new file mode 100644 index 00000000..1f885320 --- /dev/null +++ b/evidence/allen-omega-L694/L763/font.log @@ -0,0 +1,421 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 +183 0 +184 0 +185 0 +186 0 +187 0 +188 0 +189 0 +190 0 +191 0 +192 0 +193 0 +194 0 +195 0 +196 0 +197 0 +198 0 +199 0 +200 0 +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 +225 0 +226 0 +227 0 +228 0 +229 0 +230 0 +231 0 +232 0 +233 0 +234 0 +235 0 +236 0 +237 0 +238 0 +239 0 +240 0 +241 0 +242 0 +243 0 +244 0 +245 0 +246 0 +247 0 +248 0 +249 0 +250 0 +251 0 +252 0 +253 0 +254 0 +255 0 +256 0 +257 0 +258 0 +259 0 +260 0 +261 0 +262 0 +263 0 +264 0 +265 0 +266 0 +267 0 +268 0 +269 0 +270 0 +271 0 +272 0 +273 0 +274 0 +275 0 +276 0 +277 0 +278 0 +279 0 +280 0 +281 0 +282 0 +283 0 +284 0 +285 0 +286 0 +287 0 +288 0 +289 0 +290 0 +291 0 +292 0 +293 0 +294 0 +295 0 +296 0 +297 0 +298 0 +299 0 +300 0 +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 0 +310 0 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +361 0 +362 0 +363 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 0 +380 0 +381 0 +382 0 +383 0 +384 0 +385 0 +386 0 +387 0 +388 0 +389 0 +390 0 +391 0 +392 0 +393 0 +394 0 +395 0 +396 0 +397 0 +398 0 +399 0 +400 0 +401 0 +402 0 +403 0 +404 0 +405 0 +406 0 +407 0 +408 0 +409 0 +410 0 +411 0 +412 0 +413 0 +414 0 +415 0 +416 0 +417 0 +418 0 +419 0 +420 0 +421 0 diff --git a/evidence/allen-omega-L694/L763/fontalpha-mutant.log b/evidence/allen-omega-L694/L763/fontalpha-mutant.log new file mode 100644 index 00000000..4dba5479 --- /dev/null +++ b/evidence/allen-omega-L694/L763/fontalpha-mutant.log @@ -0,0 +1,421 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 +183 0 +184 0 +185 0 +186 0 +187 0 +188 0 +189 0 +190 0 +191 0 +192 0 +193 0 +194 0 +195 0 +196 0 +197 0 +198 0 +199 0 +200 0 +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 +225 0 +226 0 +227 0 +228 0 +229 0 +230 0 +231 0 +232 0 +233 0 +234 0 +235 0 +236 0 +237 0 +238 0 +239 0 +240 0 +241 0 +242 0 +243 0 +244 0 +245 0 +246 0 +247 0 +248 0 +249 0 +250 0 +251 0 +252 0 +253 0 +254 0 +255 0 +256 0 +257 0 +258 0 +259 0 +260 0 +261 0 +262 0 +263 0 +264 0 +265 0 +266 0 +267 0 +268 0 +269 0 +270 0 +271 0 +272 0 +273 0 +274 0 +275 0 +276 0 +277 0 +278 0 +279 0 +280 0 +281 0 +282 0 +283 0 +284 0 +285 0 +286 0 +287 0 +288 0 +289 0 +290 0 +291 0 +292 0 +293 0 +294 0 +295 0 +296 0 +297 0 +298 0 +299 0 +300 0 +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 0 +310 0 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +361 0 +362 0 +363 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 0 +380 0 +381 0 +382 0 +383 0 +384 0 +385 0 +386 0 +387 0 +388 0 +389 0 +390 0 +391 0 +392 0 +393 0 +394 0 +395 0 +396 0 +397 0 +398 0 +399 0 +400 0 +401 0 +402 0 +403 0 +404 0 +405 0 +406 0 +407 0 +408 0 +409 0 +410 0 +411 0 +412 0 +413 1 +414 0 +415 0 +416 0 +417 0 +418 0 +419 1 +420 0 +421 0 diff --git a/evidence/allen-omega-L694/L763/fontroot-mutant.log b/evidence/allen-omega-L694/L763/fontroot-mutant.log new file mode 100644 index 00000000..326cd397 --- /dev/null +++ b/evidence/allen-omega-L694/L763/fontroot-mutant.log @@ -0,0 +1,421 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 1 +11 1 +12 1 +13 1 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 +183 0 +184 0 +185 0 +186 0 +187 0 +188 0 +189 0 +190 0 +191 0 +192 0 +193 0 +194 0 +195 0 +196 0 +197 0 +198 0 +199 0 +200 0 +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 +225 0 +226 0 +227 0 +228 0 +229 0 +230 0 +231 0 +232 0 +233 0 +234 0 +235 0 +236 0 +237 0 +238 0 +239 0 +240 0 +241 0 +242 0 +243 0 +244 0 +245 0 +246 0 +247 0 +248 0 +249 0 +250 0 +251 0 +252 0 +253 0 +254 0 +255 0 +256 0 +257 0 +258 0 +259 0 +260 0 +261 0 +262 0 +263 0 +264 0 +265 0 +266 0 +267 0 +268 0 +269 0 +270 0 +271 0 +272 0 +273 0 +274 0 +275 0 +276 0 +277 0 +278 0 +279 0 +280 0 +281 0 +282 0 +283 0 +284 0 +285 0 +286 0 +287 0 +288 0 +289 0 +290 0 +291 0 +292 0 +293 0 +294 0 +295 0 +296 0 +297 0 +298 0 +299 0 +300 0 +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 0 +310 0 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +361 0 +362 0 +363 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 0 +380 0 +381 0 +382 0 +383 0 +384 0 +385 0 +386 0 +387 0 +388 0 +389 0 +390 0 +391 0 +392 0 +393 0 +394 0 +395 0 +396 0 +397 0 +398 0 +399 0 +400 0 +401 0 +402 0 +403 0 +404 0 +405 0 +406 0 +407 0 +408 0 +409 0 +410 0 +411 0 +412 0 +413 0 +414 1 +415 1 +416 1 +417 1 +418 1 +419 0 +420 1 +421 1 diff --git a/evidence/allen-omega-L694/L763/framecheck-mutant.log b/evidence/allen-omega-L694/L763/framecheck-mutant.log new file mode 100644 index 00000000..2849aedb --- /dev/null +++ b/evidence/allen-omega-L694/L763/framecheck-mutant.log @@ -0,0 +1,136 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 1 +7 1 +8 1 +9 1 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 diff --git a/evidence/allen-omega-L694/L763/full.exit b/evidence/allen-omega-L694/L763/full.exit new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/L763/full.exit @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/L763/full.log b/evidence/allen-omega-L694/L763/full.log new file mode 100644 index 00000000..1dca57a3 --- /dev/null +++ b/evidence/allen-omega-L694/L763/full.log @@ -0,0 +1,55 @@ +runtime compile=0 native-exit=0 +code compile=0 native-exit=0 +courier compile=0 native-exit=0 +scheduler compile=0 native-exit=0 +application compile=0 native-exit=0 +provider-core compile=0 native-exit=0 +presentation compile=0 native-exit=0 +font compile=0 native-exit=0 +memory compile=0 native-exit=0 +context compile=0 native-exit=0 +intent compile=0 native-exit=0 +reply compile=0 native-exit=0 +view compile=0 native-exit=0 +scene compile=0 native-exit=0 +scene-input compile=0 native-exit=0 +paint compile=0 native-exit=0 +edges compile=0 native-exit=0 +fixture compile=0 native-exit=0 +golden compile=0 native-exit=0 +render compile=0 native-exit=0 +font-output compile=0 native-exit=0 +font-render compile=0 native-exit=0 +font native masks match frozen external legacy oracle +stdio native-exit=0 golden-cmp=0 +stdio overflow native-exit=65 no-later-command=PASS +provider malformed mode=1 exit=65 no-later-command=PASS +provider malformed mode=2 exit=65 no-later-command=PASS +provider malformed mode=3 exit=65 no-later-command=PASS +provider malformed mode=4 exit=65 no-later-command=PASS +provider malformed mode=5 exit=65 no-later-command=PASS +provider malformed mode=6 exit=65 no-later-command=PASS +provider native-exit=0 fragmented-pipe=0 output-verifier=0 +stale mutant compile=0 rejected-exit=3 +crc mutant compile=0 rejected-exit=2 +hash mutant compile=0 rejected-exit=2 +readback mutant compile=0 rejected-exit=7 +session mutant compile=0 rejected-exit=1 +keepalive mutant compile=0 rejected-exit=40 +ackstop mutant compile=0 rejected-exit=27 +pendingwire mutant compile=0 rejected-exit=1 +appcode mutant compile=0 rejected-exit=3 +thinking mutant compile=0 rejected-exit=6 +scenecap mutant compile=0 rejected-exit=3 +contextnote mutant compile=0 rejected-exit=5 +contextjob mutant compile=0 rejected-exit=36 +autosent mutant compile=0 rejected-exit=1 +framecheck mutant compile=0 rejected-exit=1 +staleview mutant compile=0 rejected-exit=1 +inputtail mutant compile=0 rejected-exit=1 +fontroot mutant compile=0 rejected-exit=1 +fontalpha mutant compile=0 rejected-exit=1 +rawask mutant compile=0 rejected-exit=1 +rawrecv mutant compile=0 rejected-exit=1 +rawreset mutant compile=0 rejected-exit=1 +ALLEN_OMEGA_HOST: PASS; target=NOT_RUN; live=NOT_RUN diff --git a/evidence/allen-omega-L694/L763/green.exit b/evidence/allen-omega-L694/L763/green.exit new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/L763/green.exit @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/L763/green.log b/evidence/allen-omega-L694/L763/green.log new file mode 100644 index 00000000..1f06fc57 --- /dev/null +++ b/evidence/allen-omega-L694/L763/green.log @@ -0,0 +1,136 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 diff --git a/evidence/allen-omega-L694/L763/hash-mutant.log b/evidence/allen-omega-L694/L763/hash-mutant.log new file mode 100644 index 00000000..c75cfefb --- /dev/null +++ b/evidence/allen-omega-L694/L763/hash-mutant.log @@ -0,0 +1,79 @@ +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 1 +310 1 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +362 0 +363 0 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 0 +361 0 diff --git a/evidence/allen-omega-L694/L763/independent-review/closure-membership.status b/evidence/allen-omega-L694/L763/independent-review/closure-membership.status new file mode 100644 index 00000000..3e2ebeca --- /dev/null +++ b/evidence/allen-omega-L694/L763/independent-review/closure-membership.status @@ -0,0 +1 @@ +tracked_om_sh=57 manifest_om_sh=63 missing=0 extra=6 diff --git a/evidence/allen-omega-L694/L763/independent-review/closure.log b/evidence/allen-omega-L694/L763/independent-review/closure.log new file mode 100644 index 00000000..8b4133ba --- /dev/null +++ b/evidence/allen-omega-L694/L763/independent-review/closure.log @@ -0,0 +1,67 @@ +pin=92b405477cfdff40dda25c5afcac5b65cb04122a +base=61ef587ee5d24bf862705f51bffb8039c9a2ed01 +191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9 /home/drakestapleton/handoffs/allen-omega-L694/omc +OK native/omega/allen/application.om 56936108de0087499bb62a117a275f27b01d7bfb05eb8f6250f13ab8783e1095 +OK native/omega/allen/base.om 184f4270c72c4eca6a7afdd28b70a608f2e237980b12c8a7bfc2c7d2c3e625b9 +OK native/omega/allen/build-one.sh 795ca28627a19f1088de0f23277e79cdac921ff88451c606c7b655ce0f2e8a5b +OK native/omega/allen/code.om 4d2235ac5d6b237695b1c3112f70ebdfa0cebafa2ec8e691e4be4de37a62199b +OK native/omega/allen/context.om 75e86e193346a5548e596c84fa7d65aaeefd69f9979a648e0bf53f0f97cd9eb4 +OK native/omega/allen/courier.om 76ee9cdeaac036905c76dfa29f42bf5a78d1259ad1656adfaa24916c3b93550d +OK native/omega/allen/font-data.om f8c559b449c81159172d3e08f185e1fcd9ac446ab594420d07221ca68ffa87d5 +OK native/omega/allen/FONT.md 79e5c778e31f9753553ade367c7de2a5a2521bef7247672cab7498f3ba32d9e6 +OK native/omega/allen/font.om c62f5a799b601315e61b05283295810a084d1adcc06b5bddc34010f3b344b915 +OK native/omega/allen/gate.sh 58afa9d254f16e3840857001d804c68b7e29b528ef562f1c8bf0341861b425df +OK native/omega/allen/golden.sh 9d71a653870eeef678f95df04db9c38aedaadd06e7c74bf3e5d9fde6e28f82f8 +OK native/omega/allen/intent.om 06087bc573ebb876a0ed80f6025c592fb4b1d23335169c3da402824fd1482c35 +OK native/omega/allen/main.om 4bc37c95d553364c5d2925d8ff9e8a53b1a61974513e6f492f77b7ebb05bbda4 +OK native/omega/allen/memory.om 068292abd04d3a61b063fc5380b22a56c4235a87915c219ebf3b37d16d7bc9c7 +OK native/omega/allen/paint.om b4d7b6e6cd680d2ba1eec2978b0cbb81ffc63035b73f5c3726bdad97a7b6aa04 +OK native/omega/allen/PRESENTATION.md 6afdb75311c0fbc5293034ac3ba315c231439c694750f6d8c3a1996cd34abff3 +OK native/omega/allen/presentation.om d3e3004fb587f75514c638b8b723c996303f664a74b653a6fc674f4600288d41 +OK native/omega/allen/provider-core.om c8a04b1d5f95c36500e7b2f475e169148c6ac76a677b1ca3da38f217fe2a501e +OK native/omega/allen/PROVIDER.md f96b8b9074b4802b1cb52545db7ced1b5a64bf75ad756d532a8fc4e16c7107cd +OK native/omega/allen/provider.om ef0d5dcc14b68bf4ee24468db703fd7dc98ffd982e045c719d42a78e442546ba +OK native/omega/allen/README.md 259c4a50465c0932955e86f5d5c0fbf6c1f863097ea499a91aa583fa01eaf003 +OK native/omega/allen/reply.om e50a7f673aaee92aba4a3aec303aa93b071121c09ad05d4ad1dcc2deb9706dcc +OK native/omega/allen/runtime.om 5b01eae03204d08f6d207ef29f2ba09a1d9f249f1738f68f151214675a4ff2ed +OK native/omega/allen/scene-input.om c16d61dbcb81f7ef8196c937929a53e47de3de0015e5d663bcd8e49b3cb05002 +OK native/omega/allen/scene.om c8d4a437b41538cc1eeb62a2029c6993d41e5ef90cc7b26c8e1c92bc98ec57d3 +OK native/omega/allen/scheduler.om 615dff78462a715153b3d891b2cfe146c318d3a0a26ae1aaa642484f965c12df +OK native/omega/allen/tests/application.om f4e6bb5571a0700febdecfc6209ae1c088eab50a82bce4d8a10179408e3abb5f +OK native/omega/allen/tests/check.om f085198549d1c235a97574ff6f6560ce82217611f4051fc3dbbc8286aab6d536 +OK native/omega/allen/tests/code.om b76438a85257bd95768115047be286c107e3723628a16a0541870732d0849a42 +OK native/omega/allen/tests/context.om c61bb0ca8f70114e6fd180e9f9a48ec4d2f927152269c11bfc9df55dc13bc1bc +OK native/omega/allen/tests/courier.om 98105e1c30626f54da07940fe0415637730b7e112ea39ba2aae1f2d648993373 +OK native/omega/allen/tests/edges.om f524aab74657dc2e9e4330bf42bc05ef01ce3e8f08a05c80371be0c0a33764d3 +OK native/omega/allen/tests/fixture.om a2e8bcde92d522216a4fa99559dd3bcba096aea86127364587dadcc2bfb585af +OK native/omega/allen/tests/font-mutants.om 9c293d9f46e8815d96701ef9084deb34c24269d65677682a7be731e589e260bc +OK native/omega/allen/tests/font.om cf836ead7ced76a528bd2df1738a2255d9b37b4ab51702d593488bc94726f75a +OK native/omega/allen/tests/font-output.om 7ef1280488f17ac3001876ca8f1d9a48e202f8fb3305d974e6cd33166458f8eb +OK native/omega/allen/tests/font-render.om a3e64c2054a9c83daacc8bd86ce5df0395014eb0ac2e237e63ade12dfb1a6bd8 +OK native/omega/allen/tests/golden.om c9ef2bee7cbd1c072c6045d62c55f3bdd938901e91792cee72ea57fb8f25a198 +OK native/omega/allen/tests/intent.om 8ba742d85ea510586f3cf86661bc0f28c5d99b59981c2d3fb220705efad24564 +OK native/omega/allen/tests/memory.om 861d9af698b021056cceb6c00ae3458558db415963fe832d3fca7da55731cf7b +OK native/omega/allen/tests/paint.om 13e4db7436165783c6aad48497ffe89fa6e5ba3de928e66a766c29e1e817fcf5 +OK native/omega/allen/tests/presentation-mutants.om a36e1168fb5b19f5d1b444c6e0d171a6b55a0ffd7e1920438304afd0415d09ba +OK native/omega/allen/tests/presentation.om b051af93057752c3d361e1aa5a4dc31bd0853e09d2d2a213d82a282f5709f641 +OK native/omega/allen/tests/probe.om e6d232d92d74d88423cebbbbfc6e403ea9b865b80c909e1d23087001d905035a +OK native/omega/allen/tests/provider-core.om ebc300f5c8737543acec6397bf7a82000594e13c424df20e203ea7ab09da46c4 +OK native/omega/allen/tests/provider-display-mutants.om 0c611ef5d6fe9c5d951fa8886e6425a4cb538c308d99f2723634f253d755cbbb +OK native/omega/allen/tests/provider-input.om b98923bd7df278ed0cd8a46c90d90fda296e27c8d60afdd4848ed86dba8221cc +OK native/omega/allen/tests/provider-mutants.om 37480ca89922dea787a7acb72835a0109b3549461791e7499789ed25932b397c +OK native/omega/allen/tests/provider-output.om d1b1338b2cabe207c1cd9a4bd92b11f51502c29af4b754e2b39fac06d80b28ed +OK native/omega/allen/tests/provider-process.om 8616252944ac2f2903427a6cbf165137087addf3eff169f05f6801d38dac0962 +OK native/omega/allen/tests/render.om 8fbc8a0517900efd771a994686356416a0fea5e20cfd9bc26c787850398113df +OK native/omega/allen/tests/reply.om 094a5e833bae7dfd3b013e3f015f143e9d7bd3efe9b9c896a7f58b09e1ec14b8 +OK native/omega/allen/tests/runtime.om bab9b0e853aa4b62918353a5d1625a3171deebfb639e599fe9751b5a61a3df62 +OK native/omega/allen/tests/scene-input.om c5847b4ea0c7df81691fadf9af2f258ad02d3fa588a400448f6d34d7819570b4 +OK native/omega/allen/tests/scene.om b9c84d9a58658589137764fe60209d8320550dd8ed99fa6026df65ba48737e4f +OK native/omega/allen/tests/scheduler.om bf984fa9cf63ddb569147afc2a028ccdafdbeae2067125cf35d658e5d00f4c94 +OK native/omega/allen/tests/stdio-overflow.om 521fff50f312b64801017b1349d9a31dac6eac50eb989d93d2dbac4e100f5007 +OK native/omega/allen/tests/view.om 89aee5326b428147ea6da9aa739b6679e214ed114ae5f41d3b70299cf864092c +OK native/omega/allen/vendor/OMEGA-LICENSE 0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0 +OK native/omega/allen/vendor/PROVENANCE.md b234738e8ce81b3d67586deb41fdaab4543169d4b69e86fd3dc28a08432ab5fc +OK native/omega/allen/vendor/sha256-core.om 992ec4a4957271b442740598136887a5c610effcd8ae9fb9480a006a4f181097 +OK native/omega/allen/vendor/sha256.om 0781cdcec18570a57afbe3be4a6717dd2d1fa4c887b49a3e4cb542b594f8a041 +OK native/omega/allen/view.om abbefd2f7dc48f2ac28b9526f5c2e5b369da4b7c5e84dde6e6a3cd20bd5687ac +closure_files=63 closure_rc=0 diff --git a/evidence/allen-omega-L694/L763/independent-review/final-receipts.sha256 b/evidence/allen-omega-L694/L763/independent-review/final-receipts.sha256 new file mode 100644 index 00000000..192c38bc --- /dev/null +++ b/evidence/allen-omega-L694/L763/independent-review/final-receipts.sha256 @@ -0,0 +1,16 @@ +36ef969350082ec14c3ab0e3e8396f5588eab28055802901ef08b3ddab92541b report.md +aa6c0dda358b55999b81350b893dede9fbbe1b43ba0d794480b3720ae0ebfbba lifecycle-v3.om +db32a876b46a90be0fc4c5181dfc4af0420aff2b5a4dd323765cd4d9eaf76222 run/provider-focus.om +ef1a108242bf2d963f2f93d057eb0efb1776f3510824ba517f96bfeacb96689f run/provider-focus +7cf0d9627d797238980dd2af938c370dbd0e36326ddb3dbf9edd0ef8174ba1e3 run/provider-focus.build.log +3eb3f819d84ee4b044ca462072cbbe83714e75b7574d0ab3beedb4cc1de8c408 run/provider-focus.log +5bd44701d8bd97ee04e63ae58f3dac0718e67e0766437498662ed51bd9996cf4 run/lifecycle-v3.om +c1b25a69bab4ea86076dab5b37f48a4431c87e2a8752791fe50c96da0d720c64 run/lifecycle-v3 +e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 run/lifecycle-v3.build.log +8ebec9aeab32e4e47f9749d0e0c5979863f447625b089e2514d73bdd64b2824c run/lifecycle-v3.log +9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa run/lifecycle-v3.exit +acd672fdc4ae3434fa8d7bdb313803c85b98522e23fb6493457fee925800f2c0 closure.log +3c77337e62de279a74cab288aa5760dba52a16e92143c60c9052e865c7211b23 closure-membership.status +903e98ff244024c7eeb589dae5f237be9e9e0ef8155c5b97629a499c38cbb880 lifecycle-v3.status +305b12af3f8e5d1087778b7fe423221c30f7be784eaa348536d9563d6935e230 source-hashes.sha256 +0df81acc47911c4b91a63cb12fdc0ab770b1eb59f40f9edd135f1c6aafffcf3a lifecycle-v3.sha256 diff --git a/evidence/allen-omega-L694/L763/independent-review/inventory.json b/evidence/allen-omega-L694/L763/independent-review/inventory.json new file mode 100644 index 00000000..bdb0ee0f --- /dev/null +++ b/evidence/allen-omega-L694/L763/independent-review/inventory.json @@ -0,0 +1,29 @@ +{ + "closure-membership.status": "3c77337e62de279a74cab288aa5760dba52a16e92143c60c9052e865c7211b23", + "closure.log": "acd672fdc4ae3434fa8d7bdb313803c85b98522e23fb6493457fee925800f2c0", + "final-receipts.sha256": "9f679e79d7955c61a34ca78851aa85f1e87c1f11d6a59233f17119da258774c4", + "lifecycle-v2.om": "11050bfc0e21df08db82ca8cab6e250b4caa1101e9af995867defbef7dca367a", + "lifecycle-v3-membership-attempt.status": "23e1f780abe26af21a8df0306803216eb2e21952475948f6c60afabeb57c0522", + "lifecycle-v3.om": "aa6c0dda358b55999b81350b893dede9fbbe1b43ba0d794480b3720ae0ebfbba", + "lifecycle-v3.sha256": "0df81acc47911c4b91a63cb12fdc0ab770b1eb59f40f9edd135f1c6aafffcf3a", + "lifecycle-v3.status": "903e98ff244024c7eeb589dae5f237be9e9e0ef8155c5b97629a499c38cbb880", + "lifecycle.om": "c63a7f914e441d4f9922a1791504fa97f042796193f501b2cb55fb442cc7e95c", + "parent-lifecycle.log": "bb85bc20bd2cc8180cef56ceb8dcc6d3813ab1961ab1e1a392615a0267e250b5", + "parent-verification.json": "9b24679773d6d6f46099484053d335f22cc8003fef6cff68c725adbc4193ef89", + "report.md": "36ef969350082ec14c3ab0e3e8396f5588eab28055802901ef08b3ddab92541b", + "report.sha256": "79763adf7a65bacb3d450a55e0caf514ed8da0f7171b30775cf8d5b23082ebcc", + "run/core-v3.om": "378767e9204c21eafd904290d8863e96b7701300c272dd70ffd63b02946841a9", + "run/core.om": "378767e9204c21eafd904290d8863e96b7701300c272dd70ffd63b02946841a9", + "run/lifecycle-v3.build.log": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "run/lifecycle-v3.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa", + "run/lifecycle-v3.log": "8ebec9aeab32e4e47f9749d0e0c5979863f447625b089e2514d73bdd64b2824c", + "run/lifecycle-v3.om": "5bd44701d8bd97ee04e63ae58f3dac0718e67e0766437498662ed51bd9996cf4", + "run/lifecycle.build.log": "7cf0d9627d797238980dd2af938c370dbd0e36326ddb3dbf9edd0ef8174ba1e3", + "run/lifecycle.log": "e5e6b0de629ec0aba4bed6a6cbe49d12138a9270be027189ba82bc75ea4af186", + "run/lifecycle.om": "71a4550da9c7556d613f2703b0885a29048d0fdd0e28dea959082300ab1546f8", + "run/provider-focus.build.log": "7cf0d9627d797238980dd2af938c370dbd0e36326ddb3dbf9edd0ef8174ba1e3", + "run/provider-focus.log": "3eb3f819d84ee4b044ca462072cbbe83714e75b7574d0ab3beedb4cc1de8c408", + "run/provider-focus.om": "db32a876b46a90be0fc4c5181dfc4af0420aff2b5a4dd323765cd4d9eaf76222", + "run.sha256": "dda63c506c55fe0300da967fcf505eeb4c5ad856ead6a77e5e55353f1b03b91b", + "source-hashes.sha256": "305b12af3f8e5d1087778b7fe423221c30f7be784eaa348536d9563d6935e230" +} diff --git a/evidence/allen-omega-L694/L763/independent-review/lifecycle-v2.om b/evidence/allen-omega-L694/L763/independent-review/lifecycle-v2.om new file mode 100644 index 00000000..af317ce9 --- /dev/null +++ b/evidence/allen-omega-L694/L763/independent-review/lifecycle-v2.om @@ -0,0 +1,117 @@ +note Independent L764 provider attachment lifecycle probe; handwritten Omega assertions. +text Lmagic "ALNPRV01" +text Lhi "hi" +text Lreply "SAY 1 1/1 hello" +global Lchecks ulong 1 +global Lfails ulong 1 +global Lheld uchar 8192 +fn lcheck ok bool to void +put Lchecks 0 add get Lchecks 0 1 +if not ok +put Lfails 0 add get Lfails 0 1 +end +end +fn lhword off ulong v ulong to void +for i ulong 8 +put Ph add off i uchar and shr v mul i 8 255 +end +end +fn lframe op ulong now ulong arg ulong size ulong to void +for i ulong 8 +put Ph i get Lmagic i +end +lhword 8 op +lhword 16 now +lhword 24 arg +lhword 32 size +end +fn lstatus to ulong +v = ulong 0 +for i ulong 8 +v = or v shl ulong get Pout add 16 i mul i 8 +end +ret v +end +fn lreceive part ulong size ulong to void +note Construct an actual courier LINE payload through existing packet logic. +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Lheld i get Outb i +end +put Inlen 0 size +b = packet 2 get Q 1 part 0 0 +size = get Outlen 0 +for i ulong size +put Pb i get Outb i +end +for i ulong n +put Outb i get Lheld i +end +put Outlen 0 n +put Err 0 e +lframe 5 4294967297 0 size +end +fn main to int +lframe 1 4294967296 77 0 +lcheck prdo +lcheck eq lstatus 1 +lframe 2 4294967297 0 len Lhi +for i ulong len Lhi +put Pb i get Lhi i +end +lcheck prdo +lcheck eq lstatus 1 +lframe 3 4294967297 1 0 +lcheck prdo +lcheck eq lstatus 3 +lframe 4 4294967297 1 0 +lcheck prdo +for i ulong len Lreply +put In i get Lreply i +end +lreceive 1 len Lreply +lcheck prdo +lcheck eq lstatus 1 +lcheck eq get Dm 0 1 +lcheck eq get Dm 2 1 +lcheck eq get Dtext get Dsay 0 104 +lframe 6 0 0 0 +lcheck prdo +lcheck eq lstatus 1 +lcheck eq get Dm 0 1 +lcheck eq get Dm 2 1 +lcheck eq get Dtext get Dsay 0 104 +lframe 1 4294967296 88 0 +lcheck prdo +lcheck eq lstatus 0 +lcheck eq get Dm 2 1 +lframe 3 4294967296 1 0 +lcheck prdo +lcheck eq lstatus 0 +lcheck eq get Dm 0 1 +lcheck eq get Dtext get Dsay 0 104 +lframe 7 0 0 0 +lcheck prdo +lcheck eq lstatus 1 +lcheck eq get Dm 0 0 +lcheck eq get Dm 1 0 +lcheck eq get Dm 2 0 +lcheck eq get Dtext get Dsay 0 0 +if ne get Lfails 0 0 +outreset +emitn get Lchecks 0 +emitb 32 +emitn get Lfails 0 +emitb 10 +w = write 1 Outb 0 get Outlen 0 +ret 1 +end +outreset +emitn get Lchecks 0 +emitb 32 +emitn get Lfails 0 +emitb 10 +w = write 1 Outb 0 get Outlen 0 +ret 0 +end diff --git a/evidence/allen-omega-L694/L763/independent-review/lifecycle-v3-membership-attempt.status b/evidence/allen-omega-L694/L763/independent-review/lifecycle-v3-membership-attempt.status new file mode 100644 index 00000000..03434830 --- /dev/null +++ b/evidence/allen-omega-L694/L763/independent-review/lifecycle-v3-membership-attempt.status @@ -0,0 +1,3 @@ +module_build=0 module_exit=0 +source_membership_missing=57 +source_membership_extra=0 diff --git a/evidence/allen-omega-L694/L763/independent-review/lifecycle-v3.om b/evidence/allen-omega-L694/L763/independent-review/lifecycle-v3.om new file mode 100644 index 00000000..ccfbefc9 --- /dev/null +++ b/evidence/allen-omega-L694/L763/independent-review/lifecycle-v3.om @@ -0,0 +1,125 @@ +note Independent L764 provider attachment lifecycle probe; handwritten Omega assertions. +text Lmagic "ALNPRV01" +text Lhi "hi" +text Lreply "SAY 1 1/1 hello" +global Lchecks ulong 1 +global Lfails ulong 1 +global Lheld uchar 8192 +fn lcheck ok bool to void +put Lchecks 0 add get Lchecks 0 1 +if not ok +put Lfails 0 add get Lfails 0 1 +end +end +fn lhword off ulong v ulong to void +for i ulong 8 +put Ph add off i uchar and shr v mul i 8 255 +end +end +fn lframe op ulong now ulong arg ulong size ulong to void +for i ulong 8 +put Ph i get Lmagic i +end +lhword 8 op +lhword 16 now +lhword 24 arg +lhword 32 size +end +fn lstatus to ulong +v = ulong 0 +for i ulong 8 +v = or v shl ulong get Pout add 16 i mul i 8 +end +ret v +end +fn lreceive part ulong size ulong to void +note Construct an actual courier LINE payload through existing packet logic. +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Lheld i get Outb i +end +put Inlen 0 size +b = packet 2 get Q 1 part 0 0 +size = get Outlen 0 +for i ulong size +put Pb i get Outb i +end +for i ulong n +put Outb i get Lheld i +end +put Outlen 0 n +put Err 0 e +lframe 5 4294967297 0 size +end +fn main to int +lframe 1 4294967296 77 0 +lcheck prdo +lcheck eq lstatus 1 +lframe 2 4294967297 0 len Lhi +for i ulong len Lhi +put Pb i get Lhi i +end +lcheck prdo +lcheck eq lstatus 1 +lframe 3 4294967297 1 0 +lcheck prdo +lcheck eq lstatus 3 +lframe 4 4294967297 1 0 +lcheck prdo +for i ulong len Lreply +put In i get Lreply i +end +lreceive 1 len Lreply +lcheck prdo +lcheck eq lstatus 1 +lcheck eq get Dm 0 1 +lcheck eq get Dm 2 1 +lcheck eq get Dtext get Dsay 0 104 +lframe 6 0 0 0 +lcheck prdo +lcheck eq lstatus 1 +lcheck eq get Dm 0 1 +lcheck eq get Dm 2 1 +lcheck eq get Dtext get Dsay 0 104 +lframe 1 4294967296 88 0 +lcheck prdo +lcheck eq lstatus 0 +lcheck eq get Dm 2 1 +lframe 3 4294967296 1 0 +lcheck prdo +lcheck eq lstatus 0 +lcheck eq get Dm 0 1 +lcheck eq get Dtext get Dsay 0 104 +lframe 5 4294967297 0 65 +for i ulong 65 +put Pb i 0 +end +lcheck prdo +lcheck eq lstatus 0 +lcheck eq get Dm 2 1 +lcheck eq get Dtext get Dsay 0 104 +lframe 7 0 0 0 +lcheck prdo +lcheck eq lstatus 1 +lcheck eq get Dm 0 0 +lcheck eq get Dm 1 0 +lcheck eq get Dm 2 0 +lcheck eq get Dtext get Dsay 0 0 +if ne get Lfails 0 0 +outreset +emitn get Lchecks 0 +emitb 32 +emitn get Lfails 0 +emitb 10 +w = write 1 Outb 0 get Outlen 0 +ret 1 +end +outreset +emitn get Lchecks 0 +emitb 32 +emitn get Lfails 0 +emitb 10 +w = write 1 Outb 0 get Outlen 0 +ret 0 +end diff --git a/evidence/allen-omega-L694/L763/independent-review/lifecycle-v3.sha256 b/evidence/allen-omega-L694/L763/independent-review/lifecycle-v3.sha256 new file mode 100644 index 00000000..6583fbc9 --- /dev/null +++ b/evidence/allen-omega-L694/L763/independent-review/lifecycle-v3.sha256 @@ -0,0 +1,9 @@ +aa6c0dda358b55999b81350b893dede9fbbe1b43ba0d794480b3720ae0ebfbba /home/drakestapleton/handoffs/L764-review/lifecycle-v3.om +5bd44701d8bd97ee04e63ae58f3dac0718e67e0766437498662ed51bd9996cf4 /home/drakestapleton/handoffs/L764-review/run/lifecycle-v3.om +c1b25a69bab4ea86076dab5b37f48a4431c87e2a8752791fe50c96da0d720c64 /home/drakestapleton/handoffs/L764-review/run/lifecycle-v3 +e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 /home/drakestapleton/handoffs/L764-review/run/lifecycle-v3.build.log +8ebec9aeab32e4e47f9749d0e0c5979863f447625b089e2514d73bdd64b2824c /home/drakestapleton/handoffs/L764-review/run/lifecycle-v3.log +9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa /home/drakestapleton/handoffs/L764-review/run/lifecycle-v3.exit +acd672fdc4ae3434fa8d7bdb313803c85b98522e23fb6493457fee925800f2c0 /home/drakestapleton/handoffs/L764-review/closure.log +357bf1e00c1964d3a7aefd9efd47b75984803f5847d60e8749af0d523ef19360 /home/drakestapleton/handoffs/L764-review/closure-missing.txt +e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 /home/drakestapleton/handoffs/L764-review/closure-extra.txt diff --git a/evidence/allen-omega-L694/L763/independent-review/lifecycle-v3.status b/evidence/allen-omega-L694/L763/independent-review/lifecycle-v3.status new file mode 100644 index 00000000..d4c1f3a0 --- /dev/null +++ b/evidence/allen-omega-L694/L763/independent-review/lifecycle-v3.status @@ -0,0 +1,3 @@ +module_build=0 module_exit=0 +focused_build=0 focused_exec=0 assertions=136 failures=0 +source_membership=57/57 tracked_om_sh_present manifest_entries=63/63 git_and_export_hashes_match extra_manifest_non_om_sh=6 diff --git a/evidence/allen-omega-L694/L763/independent-review/lifecycle.om b/evidence/allen-omega-L694/L763/independent-review/lifecycle.om new file mode 100644 index 00000000..c39370c5 --- /dev/null +++ b/evidence/allen-omega-L694/L763/independent-review/lifecycle.om @@ -0,0 +1,105 @@ +note Independent L764 provider attachment lifecycle probe; handwritten Omega assertions. +text Lmagic "ALNPRV01" +text Lhi "hi" +text Lreply "SAY 1 1/1 hello" +global Lchecks ulong 1 +global Lfails ulong 1 +global Lheld uchar 8192 +fn lcheck ok bool to void +put Lchecks 0 add get Lchecks 0 1 +if not ok +put Lfails 0 add get Lfails 0 1 +end +end +fn lhword off ulong v ulong to void +for i ulong 8 +put Ph add off i uchar and shr v mul i 8 255 +end +end +fn lframe op ulong now ulong arg ulong size ulong to void +for i ulong 8 +put Ph i get Lmagic i +end +lhword 8 op +lhword 16 now +lhword 24 arg +lhword 32 size +end +fn lstatus to ulong +v = ulong 0 +for i ulong 8 +v = or v shl ulong get Pout add 16 i mul i 8 +end +ret v +end +fn lreceive part ulong size ulong to void +note Construct an actual courier LINE payload through existing packet logic. +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Lheld i get Outb i +end +put Inlen 0 size +b = packet 2 get Q 1 part 0 0 +size = get Outlen 0 +for i ulong size +put Pb i get Outb i +end +for i ulong n +put Outb i get Lheld i +end +put Outlen 0 n +put Err 0 e +lframe 5 4294967297 0 size +end +fn main to int +lframe 1 4294967296 77 0 +lcheck prdo +lcheck eq lstatus 1 +lframe 2 4294967297 0 len Lhi +for i ulong len Lhi +put Pb i get Lhi i +end +lcheck prdo +lcheck eq lstatus 1 +lframe 3 4294967297 1 0 +lcheck prdo +lcheck eq lstatus 3 +lframe 4 4294967297 1 0 +lcheck prdo +for i ulong len Lreply +put In i get Lreply i +end +lreceive 1 len Lreply +lcheck prdo +lcheck eq lstatus 1 +lcheck eq get Dm 0 1 +lcheck eq get Dm 2 1 +lcheck eq get Dtext get Dsay 0 104 +lframe 6 0 0 0 +lcheck prdo +lcheck eq lstatus 1 +lcheck eq get Dm 0 1 +lcheck eq get Dm 2 1 +lcheck eq get Dtext get Dsay 0 104 +lframe 1 4294967296 88 0 +lcheck prdo +lcheck eq lstatus 0 +lcheck eq get Dm 2 1 +lframe 3 4294967296 1 0 +lcheck prdo +lcheck eq lstatus 0 +lcheck eq get Dm 0 1 +lcheck eq get Dtext get Dsay 0 104 +lframe 7 0 0 0 +lcheck prdo +lcheck eq lstatus 1 +lcheck eq get Dm 0 0 +lcheck eq get Dm 1 0 +lcheck eq get Dm 2 0 +lcheck eq get Dtext get Dsay 0 0 +if ne get Lfails 0 0 +ret 1 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L763/independent-review/parent-lifecycle.log b/evidence/allen-omega-L694/L763/independent-review/parent-lifecycle.log new file mode 100644 index 00000000..cce2b75b --- /dev/null +++ b/evidence/allen-omega-L694/L763/independent-review/parent-lifecycle.log @@ -0,0 +1 @@ +34 0 diff --git a/evidence/allen-omega-L694/L763/independent-review/parent-verification.json b/evidence/allen-omega-L694/L763/independent-review/parent-verification.json new file mode 100644 index 00000000..fa848be2 --- /dev/null +++ b/evidence/allen-omega-L694/L763/independent-review/parent-verification.json @@ -0,0 +1,10 @@ +{ + "pin": "92b405477cfdff40dda25c5afcac5b65cb04122a", + "source_files": 63, + "focused_checks": 136, + "independent_checks": 34, + "parent_binary_sha256": "c1b25a69bab4ea86076dab5b37f48a4431c87e2a8752791fe50c96da0d720c64", + "report_sha256": "36ef969350082ec14c3ab0e3e8396f5588eab28055802901ef08b3ddab92541b", + "findings": "none in scoped provider/presentation attachment", + "scope": "host only" +} diff --git a/evidence/allen-omega-L694/L763/independent-review/report.md b/evidence/allen-omega-L694/L763/independent-review/report.md new file mode 100644 index 00000000..ff285540 --- /dev/null +++ b/evidence/allen-omega-L694/L763/independent-review/report.md @@ -0,0 +1,29 @@ +# L764 independent provider/presentation review + +**Verdict: no scoped source defect found.** Review is against exact HEAD `92b405477cfdff40dda25c5afcac5b65cb04122a` with base `61ef587ee5d24bf862705f51bffb8039c9a2ed01`. The production checkout remained clean and unchanged. + +## Source review + +- Reviewed the narrow six-file delta: `PROVIDER.md`, `README.md`, `gate.sh`, `provider-core.om`, `tests/provider-core.om`, and `tests/provider-display-mutants.om`. `git diff --check` is clean. +- `provider-core.om:205-211` keeps CANCEL on `appcancel`, uses `dreset` for RESET; `:213-214` refuses invalid clock before stateful dispatch; `:231-243` selects `dask` for ASK and `drecv` for RECV, returning refusal before `prevent`/accepted status when either call refuses. The call order preserves the existing provider frame and output semantics. +- `gate.sh:10-14` places `presentation.om` before `provider-core.om` for seed definition-before-use. Gate additions at `:138-153` create three separate Omega mutants, each bypassing one attachment call. +- Read `PROVIDER.md` and `PRESENTATION.md`. The expected contract is retained D* projection only on admitted events; CANCEL retains state, RESET clears it, and code snapshots are independent of reusable assembly storage. No new wire operation/record or pixel/device claim is introduced. + +## Independent verification + +- Exported `native/omega/allen` from the exact Git object into `~/handoffs/L764-review/export`. Recomputed all 63 entries in the L763 source manifest from Git blobs and the export. All hashes match. Membership comparison confirms all 57 tracked `.om`/`.sh` source/build files under the component tree are in the manifest; six remaining manifest entries are other file types. Source receipt: `closure.log`. +- Rebuilt the focused provider-core Omega test from the exported source using the exact pinned compiler (SHA-256 `191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9`). Build returned 0; produced nonempty AArch64 ELF64 `EXEC`; executed 136 assertions, 0 failures, exit 0. +- Authored and ran a separate seeded-Omega lifecycle probe. It covers BOOT/ASK/POLL/SENT/RECV display projection, CANCEL retention, duplicate BOOT refusal, clock refusal, malformed RECV refusal with last-good display retained, and RESET clearing retained metadata/text. Build returned 0; produced nonempty AArch64 ELF64 `EXEC`; probe output `34 0`, exit 0. + +## Raw receipts and hashes + +All paths below are under `~/handoffs/L764-review/` on Spark. + +- Closure: `closure.log` SHA-256 `acd672fdc4ae3434fa8d7bdb313803c85b98522e23fb6493457fee925800f2c0`; per-input source digests: `source-hashes.sha256` SHA-256 `305b12af3f8e5d1087778b7fe423221c30f7be784eaa348536d9563d6935e230`. +- Focused provider: source `run/provider-focus.om` SHA-256 `db32a876b46a90be0fc4c5181dfc4af0420aff2b5a4dd323765cd4d9eaf76222`; ELF `run/provider-focus` SHA-256 `ef1a108242bf2d963f2f93d057eb0efb1776f3510824ba517f96bfeacb96689f`; build log `run/provider-focus.build.log` SHA-256 `7cf0d9627d797238980dd2af938c370dbd0e36326ddb3dbf9edd0ef8174ba1e3`; raw result `run/provider-focus.log` SHA-256 `3eb3f819d84ee4b044ca462072cbbe83714e75b7574d0ab3beedb4cc1de8c408`. +- Lifecycle probe: immutable input `lifecycle-v3.om` SHA-256 `aa6c0dda358b55999b81350b893dede9fbbe1b43ba0d794480b3720ae0ebfbba`; combined source `run/lifecycle-v3.om` SHA-256 `5bd44701d8bd97ee04e63ae58f3dac0718e67e0766437498662ed51bd9996cf4`; ELF `run/lifecycle-v3` SHA-256 `c1b25a69bab4ea86076dab5b37f48a4431c87e2a8752791fe50c96da0d720c64`; raw result `run/lifecycle-v3.log` SHA-256 `8ebec9aeab32e4e47f9749d0e0c5979863f447625b089e2514d73bdd64b2824c`; exit receipt `run/lifecycle-v3.exit` SHA-256 `9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa`. +- Combined final probe hash inventory: `lifecycle-v3.sha256` SHA-256 `0df81acc47911c4b91a63cb12fdc0ab770b1eb59f40f9edd135f1c6aafffcf3a`. + +## Scope and issues + +This verifies source closure, focused native provider behavior, and the bounded lifecycle/refusal probe only. It does not replay the full native suite/mutants, nor qualify pixels, live sockets/disk, x86/EFI, QEMU, device behavior, or physical iMac acceptance. No source finding is being reported. Two host-orchestration attempts failed before behavioral execution (a relative build path from the wrong cwd and an unsupported shell process-substitution/quoting form); both were corrected, and the final build/probe receipts above are from successful executions. An earlier independent probe draft is preserved separately as `lifecycle-v2.om`; it is not the final probe receipt. diff --git a/evidence/allen-omega-L694/L763/independent-review/report.sha256 b/evidence/allen-omega-L694/L763/independent-review/report.sha256 new file mode 100644 index 00000000..277fcc74 --- /dev/null +++ b/evidence/allen-omega-L694/L763/independent-review/report.sha256 @@ -0,0 +1 @@ +36ef969350082ec14c3ab0e3e8396f5588eab28055802901ef08b3ddab92541b report.md diff --git a/evidence/allen-omega-L694/L763/independent-review/run.sha256 b/evidence/allen-omega-L694/L763/independent-review/run.sha256 new file mode 100644 index 00000000..efb9501f --- /dev/null +++ b/evidence/allen-omega-L694/L763/independent-review/run.sha256 @@ -0,0 +1,10 @@ +378767e9204c21eafd904290d8863e96b7701300c272dd70ffd63b02946841a9 /home/drakestapleton/handoffs/L764-review/run/core.om +db32a876b46a90be0fc4c5181dfc4af0420aff2b5a4dd323765cd4d9eaf76222 /home/drakestapleton/handoffs/L764-review/run/provider-focus.om +ef1a108242bf2d963f2f93d057eb0efb1776f3510824ba517f96bfeacb96689f /home/drakestapleton/handoffs/L764-review/run/provider-focus +7cf0d9627d797238980dd2af938c370dbd0e36326ddb3dbf9edd0ef8174ba1e3 /home/drakestapleton/handoffs/L764-review/run/provider-focus.build.log +3eb3f819d84ee4b044ca462072cbbe83714e75b7574d0ab3beedb4cc1de8c408 /home/drakestapleton/handoffs/L764-review/run/provider-focus.log +11050bfc0e21df08db82ca8cab6e250b4caa1101e9af995867defbef7dca367a /home/drakestapleton/handoffs/L764-review/lifecycle-v2.om +71a4550da9c7556d613f2703b0885a29048d0fdd0e28dea959082300ab1546f8 /home/drakestapleton/handoffs/L764-review/run/lifecycle.om +0dc710e5d1f82510cb773b8e443c5c5b9e896c4a004634aa00c5f9e3dda2bd6b /home/drakestapleton/handoffs/L764-review/run/lifecycle +7cf0d9627d797238980dd2af938c370dbd0e36326ddb3dbf9edd0ef8174ba1e3 /home/drakestapleton/handoffs/L764-review/run/lifecycle.build.log +e5e6b0de629ec0aba4bed6a6cbe49d12138a9270be027189ba82bc75ea4af186 /home/drakestapleton/handoffs/L764-review/run/lifecycle.log diff --git a/evidence/allen-omega-L694/L763/independent-review/run/core-v3.om b/evidence/allen-omega-L694/L763/independent-review/run/core-v3.om new file mode 100644 index 00000000..2f2a4040 --- /dev/null +++ b/evidence/allen-omega-L694/L763/independent-review/run/core-v3.om @@ -0,0 +1,4146 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Stable application presentation; see PRESENTATION.md for scope and ownership. +global Ds ulong 8 +global Dt ulong 64 +global Dtext uchar 2304 +global Dsay ulong 1 +global Dm ulong 3 +global Dcode uchar 32768 +global Dstart ulong 4096 +global Dlen ulong 4096 +global Dline ulong 4096 +global Dview ulong 3 +global Din uchar 8192 +fn dscene to bool +n = get Inlen 0 +for i ulong 8192 +put Din i get In i +end +for i ulong get R 8 +put In i get Answer i +end +put Inlen 0 get R 8 +ok = scdecode +for i ulong 8192 +put In i get Din i +end +put Inlen 0 n +if not ok +ret false +end +for i ulong 8 +put Ds i get Sc i +end +for i ulong 64 +put Dt i get Things i +end +for i ulong 2304 +put Dtext i 0 +end +for i ulong get Sc 4 +put Dtext i get Stext i +end +put Dsay 0 get Sw 3 +put Dm 0 1 +ret true +end +fn dcode to bool +if or le get R 2 1 ne get R 1 0 +ret false +end +if or eq get R 6 0 ne get C 0 get R 0 +ret false +end +if not rows 80 4096 +ret false +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong get C 2 +put Dcode i get Code i +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong get View 0 +put Dstart i get Rowst i +put Dlen i get Rowlen i +put Dline i get Rowline i +end +put Dview 0 get View 0 +put Dview 1 0 +put Dview 2 get C 2 +put Dm 1 1 +ret true +end +fn dpresent to bool +if or eq get A 0 0 ne get A 2 1 +ret false +end +if or gt get R 8 159 gt get Inlen 0 8192 +ret false +end +shown = dscene +coded = dcode +if or shown coded +put Dm 2 get R 0 +ret true +end +ret false +end +fn dask now ulong to bool +if not appask now +ret false +end +b = dpresent +ret true +end +fn drecv now ulong to bool +if not appreceive now +ret false +end +b = dpresent +ret true +end +fn dreset to void +appreset +for i ulong 8 +put Ds i 0 +end +for i ulong 64 +put Dt i 0 +end +for i ulong 2304 +put Dtext i 0 +end +put Dsay 0 0 +for i ulong 3 +put Dm i 0 +put Dview i 0 +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong 8192 +put Din i 0 +end +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +dreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not dask now +ret 0 +end +else +if not drecv now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +note Declarative Allen glyph designs and integer sine samples, retained from +note native/kernel/ui/allen_font.c at4c7888f. No foreign executable implementation. +text Afdata "w6|w6 M3,0 L3,14 D3,20|w10 M3,0 L3,5 M7,0 L7,5|w15 M6,2 L4,20 M11,2 L9,20 M2,8 L13,8 M1,14 L12,14|w15 A8,5,5,5,-30,-270 A8,15,5,5,270,510 M8,-2 L8,22|w16 A4,4,2,3,0,360 A12,16,2,3,0,360 M13,1 L3,19|w16 M14,20 L5,9 A7,5,3,4,150,400 L3,14 A7,15,4,5,180,60 L13,11|w6 M3,0 L3,5|w9 A10,10,6,12,240,120|w9 A-1,10,6,12,-60,60|w14 M7,2 L7,10 M3,4 L11,8 M11,4 L3,8|w14 M2,12 L12,12 M7,7 L7,17|w6 M3,19 L2,23|w11 M2,13 L9,13|w6 D3,20|w12 M10,0 L2,20|w14 A7,10,5,10,0,360|w14 M3,4 L8,0 L8,20|w14 A7,6,5,6,200,400 L2,20 L12,20|w14 A7,5,5,5,200,450 A7,15,5,5,270,520|w14 M10,20 L10,0 L1,14 L13,14|w14 M12,0 L4,0 L4,9 A7,14,5,6,235,520|w14 A7,14,5,6,0,360 M10,0 L3,11|w14 M2,0 L12,0 L5,20|w14 A7,5,4,5,0,360 A7,15,5,5,0,360|w14 A7,6,5,6,0,360 M4,20 L11,9|w6 D3,8 D3,20|w6 D3,8 M3,19 L2,23|w14 M12,6 L2,12 L12,18|w14 M2,10 L12,10 M2,15 L12,15|w14 M2,6 L12,12 L2,18|w14 A7,5,5,5,190,450 L7,14 D7,20|w19 A9,12,3,4,0,360 M12,8 L12,14 A14,14,2,2,180,0 A9,11,7,9,0,-300|w16 M2,20 L8,0 L14,20 M4,13 L12,13|w15 M2,0 L2,20 M2,0 L8,0 A8,5,4,5,270,450 L2,10 M2,10 L9,10 A9,15,4,5,270,450 L2,20|w17 A9,10,7,10,45,315|w16 M2,0 L2,20 M2,0 L6,0 A6,10,8,10,270,450 L2,20|w14 M12,0 L2,0 L2,20 L12,20 M2,10 L10,10|w13 M12,0 L2,0 L2,20 M2,10 L10,10|w18 A9,10,7,10,-45,-360 M11,10 L16,10|w16 M2,0 L2,20 M14,0 L14,20 M2,10 L14,10|w6 M3,0 L3,20|w13 M10,0 L10,14 A6,14,4,6,0,180|w15 M2,0 L2,20 M13,0 L2,12 M6,8 L14,20|w13 M2,0 L2,20 L12,20|w20 M2,20 L2,0 L10,14 L18,0 L18,20|w16 M2,20 L2,0 L14,20 L14,0|w20 A10,10,8,10,0,360|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10|w20 A10,10,8,10,0,360 M12,14 L18,21|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10 M8,10 L14,20|w16 A8,5,5,5,-30,-270 A8,15,5,5,270,510|w16 M1,0 L15,0 M8,0 L8,20|w16 M2,0 L2,13 A8,13,6,7,180,0 L14,0|w16 M1,0 L8,20 L15,0|w22 M1,0 L6,20 L11,0 L16,20 L21,0|w16 M2,0 L14,20 M14,0 L2,20|w16 M1,0 L8,10 L15,0 M8,10 L8,20|w16 M2,0 L14,0 L2,20 L14,20|w9 M7,-1 L3,-1 L3,21 L7,21|w12 M2,0 L10,20|w9 M2,-1 L6,-1 L6,21 L2,21|w12 M2,8 L6,1 L10,8|w14 M1,23 L13,23|w7 M2,0 L4,4|w15 A7,14,5,6,0,360 M12,8 L12,20|w15 M2,0 L2,20 A7,14,5,6,0,360|w13 A7,14,5,6,40,320|w15 A7,14,5,6,0,360 M12,0 L12,20|w14 M2,14 L12,14 A7,14,5,6,0,-320|w11 M5,20 L5,4 A9,4,4,4,180,300 M2,8 L10,8|w15 A7,14,5,6,0,360 M12,8 L12,22 A7,22,5,5,0,150|w15 M2,0 L2,20 A7,13,5,5,180,360 L12,20|w6 M3,8 L3,20 D3,3|w7 M4,8 L4,22 A0,22,4,5,0,120 D4,3|w13 M2,0 L2,20 M11,8 L2,15 M5,13 L12,20|w6 M3,0 L3,20|w21 M2,8 L2,20 A6,12,4,4,180,360 L10,20 A14,12,4,4,180,360 L18,20|w15 M2,8 L2,20 A7,13,5,5,180,360 L12,20|w14 A7,14,5,6,0,360|w15 M2,8 L2,27 A7,14,5,6,0,360|w15 A7,14,5,6,0,360 M12,8 L12,27|w10 M2,8 L2,20 A7,13,5,5,180,290|w14 A7,11,4,3,-30,-270 A7,17,4,3,270,510|w11 M5,2 L5,17 A8,17,3,3,180,40 M2,8 L10,8|w15 M2,8 L2,15 A7,15,5,5,180,0 M12,8 L12,20|w14 M2,8 L7,20 L12,8|w20 M2,8 L6,20 L10,8 L14,20 L18,8|w14 M2,8 L12,20 M12,8 L2,20|w14 M2,8 L7,20 M12,8 L4,27|w14 M2,8 L12,8 L2,20 L12,20|w10 M8,-1 L6,0 L6,8 L4,10 L6,12 L6,20 L8,21|w6 M3,-1 L3,23|w10 M2,-1 L4,0 L4,8 L6,10 L4,12 L4,20 L2,21|w14 M2,13 L5,11 L9,14 L12,12|" +text Afsines "0 286 572 857 1143 1428 1713 1997 2280 2563 2845 3126 3406 3686 3964 4240 4516 4790 5063 5334 5604 5872 6138 6402 6664 6924 7182 7438 7692 7943 8192 8438 8682 8923 9162 9397 9630 9860 10087 10311 10531 10749 10963 11174 11381 11585 11786 11982 12176 12365 12551 12733 12911 13085 13255 13421 13583 13741 13894 14044 14189 14330 14466 14598 14726 14849 14968 15082 15191 15296 15396 15491 15582 15668 15749 15826 15897 15964 16026 16083 16135 16182 16225 16262 16294 16322 16344 16362 16374 16382 16384 " +note Handwritten bounded Allen stroke rasterizer. Legacy C is an external oracle only. +global Af ulong 6 +global Ab long 4 +global Ag long 640 +global Alpha uchar 65536 +global Asin long 91 +global Afpos ulong 2 +global Apen long 2 +global Arc long 6 +fn afsqrt value ulong to ulong +r = ulong 0 +bit = shl ulong 1 62 +while gt bit value +bit = shr bit 2 +end +while ne bit 0 +if ge value add r bit +value = sub value add r bit +r = add shr r 1 bit +else +r = shr r 1 +end +bit = shr bit 2 +end +ret r +end +fn afsin deg long to long +a = rem deg 360 +if lt a 0 +a = add a 360 +end +if le a 90 +ret get Asin ulong a +end +if le a 180 +ret get Asin ulong sub long 180 a +end +if le a 270 +ret neg get Asin ulong sub a 180 +end +ret neg get Asin ulong sub long 360 a +end +fn afcos deg long to long +ret afsin add rem deg 360 90 +end +fn afinit cap ulong wt ulong to bool +if or eq cap 0 gt cap 64 +ret false +end +if or eq wt 0 gt wt 2500 +ret false +end +for i ulong 6 +put Af i 0 +end +put Af 0 div mul cap 256 20 +put Af 1 div mul wt get Af 0 1000 +v = long 0 +slot = ulong 0 +for i ulong len Afsines +c = get Afsines i +if eq c 32 +put Asin slot v +slot = add slot 1 +v = 0 +else +v = add mul v 10 sub long c 48 +end +end +ret eq slot 91 +end +fn afpick c uchar to bool +if or lt c 32 gt c 126 +c = 63 +end +wanted = sub ulong c 32 +slot = ulong 0 +startat = ulong 0 +for i ulong len Afdata +if eq get Afdata i 124 +if eq slot wanted +put Afpos 0 startat +put Afpos 1 i +ret true +end +slot = add slot 1 +startat = add i 1 +end +end +ret false +end +fn afnum to long +p = get Afpos 0 +minus = false +if eq get Afdata p 45 +minus = true +p = add p 1 +end +v = long 0 +go = true +while and lt p get Afpos 1 go +c = get Afdata p +if and ge c 48 le c 57 +v = add mul v 10 sub long c 48 +p = add p 1 +else +go = false +end +end +if lt p get Afpos 1 +if eq get Afdata p 44 +p = add p 1 +end +end +put Afpos 0 p +if minus +ret neg v +end +ret v +end +fn afseg nx long ny long to bool +n = get Af 2 +if ge n 160 +ret false +end +at = mul n 4 +put Ag at get Apen 0 +put Ag add at 1 get Apen 1 +put Ag add at 2 nx +put Ag add at 3 ny +put Apen 0 nx +put Apen 1 ny +put Af 2 add n 1 +ret true +end +fn afpoint a long first bool to bool +s = long get Af 0 +x = mul get Arc 0 s +x = add x div mul mul get Arc 2 s afcos a 16384 +y = mul sub get Arc 1 20 s +y = add y div mul mul get Arc 3 s afsin a 16384 +if first +put Apen 0 x +put Apen 1 y +ret true +end +ret afseg x y +end +fn afarc to bool +for i ulong 6 +put Arc i afnum +end +span = sub get Arc 5 get Arc 4 +if lt span 0 +span = neg span +end +steps = div span 9 +if lt steps 2 +steps = 2 +end +for k ulong ulong add steps 1 +a = sub get Arc 5 get Arc 4 +a = add get Arc 4 div mul a long k steps +if not afpoint a eq k 0 +ret false +end +end +ret true +end +fn afcmd cmd uchar to bool +if eq cmd 32 +ret true +end +if eq cmd 119 +put Af 5 mul ulong afnum get Af 0 +ret true +end +if eq cmd 65 +ret afarc +end +x = mul afnum long get Af 0 +y = mul sub afnum 20 long get Af 0 +if or eq cmd 77 eq cmd 68 +put Apen 0 x +put Apen 1 y +end +if eq cmd 77 +ret true +end +if or eq cmd 76 eq cmd 68 +ret afseg x y +end +ret false +end +fn affloor value long to long +if ge value 0 +ret div value 256 +end +ret neg div add neg value 255 256 +end +fn afbound x long y long to void +if lt x get Ab 0 +put Ab 0 x +end +if lt y get Ab 1 +put Ab 1 y +end +if gt x get Ab 2 +put Ab 2 x +end +if gt y get Ab 3 +put Ab 3 y +end +end +fn afbox to bool +put Ab 0 get Ag 0 +put Ab 2 get Ag 0 +put Ab 1 get Ag 1 +put Ab 3 get Ag 1 +for i ulong get Af 2 +at = mul i 4 +afbound get Ag at get Ag add at 1 +afbound get Ag add at 2 get Ag add at 3 +end +pad = add long get Af 1 256 +x0 = affloor sub get Ab 0 pad +y0 = affloor sub get Ab 1 pad +x1 = add affloor add get Ab 2 pad 1 +y1 = add affloor add get Ab 3 pad 1 +put Ab 0 x0 +put Ab 1 y0 +put Af 3 ulong sub x1 x0 +put Af 4 ulong sub y1 y0 +ret le mul get Af 3 get Af 4 len Alpha +end +fn afproj qx long qy long dx long dy long to ulong +len2 = add mul dx dx mul dy dy +ex = qx +ey = qy +if ne len2 0 +t = add mul qx dx mul qy dy +if gt t 0 +if ge t len2 +ex = sub qx dx +ey = sub qy dy +else +ex = sub qx div mul dx t len2 +ey = sub qy div mul dy t len2 +end +end +end +ret ulong add mul ex ex mul ey ey +end +fn afdist slot ulong px long py long to ulong +at = mul slot 4 +dx = sub get Ag add at 2 get Ag at +dy = sub get Ag add at 3 get Ag add at 1 +qx = sub px get Ag at +qy = sub py get Ag add at 1 +ret afproj qx qy dx dy +end +fn afalpha px long py long to uchar +best = ulong 18446744073709551615 +for i ulong get Af 2 +d2 = afdist i px py +if lt d2 best +best = d2 +end +end +d = long afsqrt best +cov = sub add long get Af 1 128 d +if le cov 0 +ret 0 +end +if ge cov 256 +ret 255 +end +ret uchar div mul cov 255 256 +end +fn afrow y ulong to void +py = add mul add get Ab 1 long y 256 128 +for x ulong get Af 3 +px = add mul add get Ab 0 long x 256 128 +at = add mul y get Af 3 x +put Alpha at afalpha px py +end +end +fn afpaint to void +for y ulong get Af 4 +afrow y +end +end +fn afglyph c uchar to bool +if eq get Af 0 0 +ret false +end +if not afpick c +ret false +end +for i ulong 65536 +put Alpha i 0 +end +put Af 2 0 +put Af 3 0 +put Af 4 1 +put Af 5 0 +put Ab 0 0 +put Ab 1 0 +put Apen 0 0 +put Apen 1 0 +while lt get Afpos 0 get Afpos 1 +cmd = get Afdata get Afpos 0 +put Afpos 0 add get Afpos 0 1 +if not afcmd cmd +ret false +end +end +if eq get Af 2 0 +ret true +end +if not afbox +ret false +end +afpaint +ret true +end diff --git a/evidence/allen-omega-L694/L763/independent-review/run/core.om b/evidence/allen-omega-L694/L763/independent-review/run/core.om new file mode 100644 index 00000000..2f2a4040 --- /dev/null +++ b/evidence/allen-omega-L694/L763/independent-review/run/core.om @@ -0,0 +1,4146 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Stable application presentation; see PRESENTATION.md for scope and ownership. +global Ds ulong 8 +global Dt ulong 64 +global Dtext uchar 2304 +global Dsay ulong 1 +global Dm ulong 3 +global Dcode uchar 32768 +global Dstart ulong 4096 +global Dlen ulong 4096 +global Dline ulong 4096 +global Dview ulong 3 +global Din uchar 8192 +fn dscene to bool +n = get Inlen 0 +for i ulong 8192 +put Din i get In i +end +for i ulong get R 8 +put In i get Answer i +end +put Inlen 0 get R 8 +ok = scdecode +for i ulong 8192 +put In i get Din i +end +put Inlen 0 n +if not ok +ret false +end +for i ulong 8 +put Ds i get Sc i +end +for i ulong 64 +put Dt i get Things i +end +for i ulong 2304 +put Dtext i 0 +end +for i ulong get Sc 4 +put Dtext i get Stext i +end +put Dsay 0 get Sw 3 +put Dm 0 1 +ret true +end +fn dcode to bool +if or le get R 2 1 ne get R 1 0 +ret false +end +if or eq get R 6 0 ne get C 0 get R 0 +ret false +end +if not rows 80 4096 +ret false +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong get C 2 +put Dcode i get Code i +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong get View 0 +put Dstart i get Rowst i +put Dlen i get Rowlen i +put Dline i get Rowline i +end +put Dview 0 get View 0 +put Dview 1 0 +put Dview 2 get C 2 +put Dm 1 1 +ret true +end +fn dpresent to bool +if or eq get A 0 0 ne get A 2 1 +ret false +end +if or gt get R 8 159 gt get Inlen 0 8192 +ret false +end +shown = dscene +coded = dcode +if or shown coded +put Dm 2 get R 0 +ret true +end +ret false +end +fn dask now ulong to bool +if not appask now +ret false +end +b = dpresent +ret true +end +fn drecv now ulong to bool +if not appreceive now +ret false +end +b = dpresent +ret true +end +fn dreset to void +appreset +for i ulong 8 +put Ds i 0 +end +for i ulong 64 +put Dt i 0 +end +for i ulong 2304 +put Dtext i 0 +end +put Dsay 0 0 +for i ulong 3 +put Dm i 0 +put Dview i 0 +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong 8192 +put Din i 0 +end +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +dreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not dask now +ret 0 +end +else +if not drecv now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +note Declarative Allen glyph designs and integer sine samples, retained from +note native/kernel/ui/allen_font.c at4c7888f. No foreign executable implementation. +text Afdata "w6|w6 M3,0 L3,14 D3,20|w10 M3,0 L3,5 M7,0 L7,5|w15 M6,2 L4,20 M11,2 L9,20 M2,8 L13,8 M1,14 L12,14|w15 A8,5,5,5,-30,-270 A8,15,5,5,270,510 M8,-2 L8,22|w16 A4,4,2,3,0,360 A12,16,2,3,0,360 M13,1 L3,19|w16 M14,20 L5,9 A7,5,3,4,150,400 L3,14 A7,15,4,5,180,60 L13,11|w6 M3,0 L3,5|w9 A10,10,6,12,240,120|w9 A-1,10,6,12,-60,60|w14 M7,2 L7,10 M3,4 L11,8 M11,4 L3,8|w14 M2,12 L12,12 M7,7 L7,17|w6 M3,19 L2,23|w11 M2,13 L9,13|w6 D3,20|w12 M10,0 L2,20|w14 A7,10,5,10,0,360|w14 M3,4 L8,0 L8,20|w14 A7,6,5,6,200,400 L2,20 L12,20|w14 A7,5,5,5,200,450 A7,15,5,5,270,520|w14 M10,20 L10,0 L1,14 L13,14|w14 M12,0 L4,0 L4,9 A7,14,5,6,235,520|w14 A7,14,5,6,0,360 M10,0 L3,11|w14 M2,0 L12,0 L5,20|w14 A7,5,4,5,0,360 A7,15,5,5,0,360|w14 A7,6,5,6,0,360 M4,20 L11,9|w6 D3,8 D3,20|w6 D3,8 M3,19 L2,23|w14 M12,6 L2,12 L12,18|w14 M2,10 L12,10 M2,15 L12,15|w14 M2,6 L12,12 L2,18|w14 A7,5,5,5,190,450 L7,14 D7,20|w19 A9,12,3,4,0,360 M12,8 L12,14 A14,14,2,2,180,0 A9,11,7,9,0,-300|w16 M2,20 L8,0 L14,20 M4,13 L12,13|w15 M2,0 L2,20 M2,0 L8,0 A8,5,4,5,270,450 L2,10 M2,10 L9,10 A9,15,4,5,270,450 L2,20|w17 A9,10,7,10,45,315|w16 M2,0 L2,20 M2,0 L6,0 A6,10,8,10,270,450 L2,20|w14 M12,0 L2,0 L2,20 L12,20 M2,10 L10,10|w13 M12,0 L2,0 L2,20 M2,10 L10,10|w18 A9,10,7,10,-45,-360 M11,10 L16,10|w16 M2,0 L2,20 M14,0 L14,20 M2,10 L14,10|w6 M3,0 L3,20|w13 M10,0 L10,14 A6,14,4,6,0,180|w15 M2,0 L2,20 M13,0 L2,12 M6,8 L14,20|w13 M2,0 L2,20 L12,20|w20 M2,20 L2,0 L10,14 L18,0 L18,20|w16 M2,20 L2,0 L14,20 L14,0|w20 A10,10,8,10,0,360|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10|w20 A10,10,8,10,0,360 M12,14 L18,21|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10 M8,10 L14,20|w16 A8,5,5,5,-30,-270 A8,15,5,5,270,510|w16 M1,0 L15,0 M8,0 L8,20|w16 M2,0 L2,13 A8,13,6,7,180,0 L14,0|w16 M1,0 L8,20 L15,0|w22 M1,0 L6,20 L11,0 L16,20 L21,0|w16 M2,0 L14,20 M14,0 L2,20|w16 M1,0 L8,10 L15,0 M8,10 L8,20|w16 M2,0 L14,0 L2,20 L14,20|w9 M7,-1 L3,-1 L3,21 L7,21|w12 M2,0 L10,20|w9 M2,-1 L6,-1 L6,21 L2,21|w12 M2,8 L6,1 L10,8|w14 M1,23 L13,23|w7 M2,0 L4,4|w15 A7,14,5,6,0,360 M12,8 L12,20|w15 M2,0 L2,20 A7,14,5,6,0,360|w13 A7,14,5,6,40,320|w15 A7,14,5,6,0,360 M12,0 L12,20|w14 M2,14 L12,14 A7,14,5,6,0,-320|w11 M5,20 L5,4 A9,4,4,4,180,300 M2,8 L10,8|w15 A7,14,5,6,0,360 M12,8 L12,22 A7,22,5,5,0,150|w15 M2,0 L2,20 A7,13,5,5,180,360 L12,20|w6 M3,8 L3,20 D3,3|w7 M4,8 L4,22 A0,22,4,5,0,120 D4,3|w13 M2,0 L2,20 M11,8 L2,15 M5,13 L12,20|w6 M3,0 L3,20|w21 M2,8 L2,20 A6,12,4,4,180,360 L10,20 A14,12,4,4,180,360 L18,20|w15 M2,8 L2,20 A7,13,5,5,180,360 L12,20|w14 A7,14,5,6,0,360|w15 M2,8 L2,27 A7,14,5,6,0,360|w15 A7,14,5,6,0,360 M12,8 L12,27|w10 M2,8 L2,20 A7,13,5,5,180,290|w14 A7,11,4,3,-30,-270 A7,17,4,3,270,510|w11 M5,2 L5,17 A8,17,3,3,180,40 M2,8 L10,8|w15 M2,8 L2,15 A7,15,5,5,180,0 M12,8 L12,20|w14 M2,8 L7,20 L12,8|w20 M2,8 L6,20 L10,8 L14,20 L18,8|w14 M2,8 L12,20 M12,8 L2,20|w14 M2,8 L7,20 M12,8 L4,27|w14 M2,8 L12,8 L2,20 L12,20|w10 M8,-1 L6,0 L6,8 L4,10 L6,12 L6,20 L8,21|w6 M3,-1 L3,23|w10 M2,-1 L4,0 L4,8 L6,10 L4,12 L4,20 L2,21|w14 M2,13 L5,11 L9,14 L12,12|" +text Afsines "0 286 572 857 1143 1428 1713 1997 2280 2563 2845 3126 3406 3686 3964 4240 4516 4790 5063 5334 5604 5872 6138 6402 6664 6924 7182 7438 7692 7943 8192 8438 8682 8923 9162 9397 9630 9860 10087 10311 10531 10749 10963 11174 11381 11585 11786 11982 12176 12365 12551 12733 12911 13085 13255 13421 13583 13741 13894 14044 14189 14330 14466 14598 14726 14849 14968 15082 15191 15296 15396 15491 15582 15668 15749 15826 15897 15964 16026 16083 16135 16182 16225 16262 16294 16322 16344 16362 16374 16382 16384 " +note Handwritten bounded Allen stroke rasterizer. Legacy C is an external oracle only. +global Af ulong 6 +global Ab long 4 +global Ag long 640 +global Alpha uchar 65536 +global Asin long 91 +global Afpos ulong 2 +global Apen long 2 +global Arc long 6 +fn afsqrt value ulong to ulong +r = ulong 0 +bit = shl ulong 1 62 +while gt bit value +bit = shr bit 2 +end +while ne bit 0 +if ge value add r bit +value = sub value add r bit +r = add shr r 1 bit +else +r = shr r 1 +end +bit = shr bit 2 +end +ret r +end +fn afsin deg long to long +a = rem deg 360 +if lt a 0 +a = add a 360 +end +if le a 90 +ret get Asin ulong a +end +if le a 180 +ret get Asin ulong sub long 180 a +end +if le a 270 +ret neg get Asin ulong sub a 180 +end +ret neg get Asin ulong sub long 360 a +end +fn afcos deg long to long +ret afsin add rem deg 360 90 +end +fn afinit cap ulong wt ulong to bool +if or eq cap 0 gt cap 64 +ret false +end +if or eq wt 0 gt wt 2500 +ret false +end +for i ulong 6 +put Af i 0 +end +put Af 0 div mul cap 256 20 +put Af 1 div mul wt get Af 0 1000 +v = long 0 +slot = ulong 0 +for i ulong len Afsines +c = get Afsines i +if eq c 32 +put Asin slot v +slot = add slot 1 +v = 0 +else +v = add mul v 10 sub long c 48 +end +end +ret eq slot 91 +end +fn afpick c uchar to bool +if or lt c 32 gt c 126 +c = 63 +end +wanted = sub ulong c 32 +slot = ulong 0 +startat = ulong 0 +for i ulong len Afdata +if eq get Afdata i 124 +if eq slot wanted +put Afpos 0 startat +put Afpos 1 i +ret true +end +slot = add slot 1 +startat = add i 1 +end +end +ret false +end +fn afnum to long +p = get Afpos 0 +minus = false +if eq get Afdata p 45 +minus = true +p = add p 1 +end +v = long 0 +go = true +while and lt p get Afpos 1 go +c = get Afdata p +if and ge c 48 le c 57 +v = add mul v 10 sub long c 48 +p = add p 1 +else +go = false +end +end +if lt p get Afpos 1 +if eq get Afdata p 44 +p = add p 1 +end +end +put Afpos 0 p +if minus +ret neg v +end +ret v +end +fn afseg nx long ny long to bool +n = get Af 2 +if ge n 160 +ret false +end +at = mul n 4 +put Ag at get Apen 0 +put Ag add at 1 get Apen 1 +put Ag add at 2 nx +put Ag add at 3 ny +put Apen 0 nx +put Apen 1 ny +put Af 2 add n 1 +ret true +end +fn afpoint a long first bool to bool +s = long get Af 0 +x = mul get Arc 0 s +x = add x div mul mul get Arc 2 s afcos a 16384 +y = mul sub get Arc 1 20 s +y = add y div mul mul get Arc 3 s afsin a 16384 +if first +put Apen 0 x +put Apen 1 y +ret true +end +ret afseg x y +end +fn afarc to bool +for i ulong 6 +put Arc i afnum +end +span = sub get Arc 5 get Arc 4 +if lt span 0 +span = neg span +end +steps = div span 9 +if lt steps 2 +steps = 2 +end +for k ulong ulong add steps 1 +a = sub get Arc 5 get Arc 4 +a = add get Arc 4 div mul a long k steps +if not afpoint a eq k 0 +ret false +end +end +ret true +end +fn afcmd cmd uchar to bool +if eq cmd 32 +ret true +end +if eq cmd 119 +put Af 5 mul ulong afnum get Af 0 +ret true +end +if eq cmd 65 +ret afarc +end +x = mul afnum long get Af 0 +y = mul sub afnum 20 long get Af 0 +if or eq cmd 77 eq cmd 68 +put Apen 0 x +put Apen 1 y +end +if eq cmd 77 +ret true +end +if or eq cmd 76 eq cmd 68 +ret afseg x y +end +ret false +end +fn affloor value long to long +if ge value 0 +ret div value 256 +end +ret neg div add neg value 255 256 +end +fn afbound x long y long to void +if lt x get Ab 0 +put Ab 0 x +end +if lt y get Ab 1 +put Ab 1 y +end +if gt x get Ab 2 +put Ab 2 x +end +if gt y get Ab 3 +put Ab 3 y +end +end +fn afbox to bool +put Ab 0 get Ag 0 +put Ab 2 get Ag 0 +put Ab 1 get Ag 1 +put Ab 3 get Ag 1 +for i ulong get Af 2 +at = mul i 4 +afbound get Ag at get Ag add at 1 +afbound get Ag add at 2 get Ag add at 3 +end +pad = add long get Af 1 256 +x0 = affloor sub get Ab 0 pad +y0 = affloor sub get Ab 1 pad +x1 = add affloor add get Ab 2 pad 1 +y1 = add affloor add get Ab 3 pad 1 +put Ab 0 x0 +put Ab 1 y0 +put Af 3 ulong sub x1 x0 +put Af 4 ulong sub y1 y0 +ret le mul get Af 3 get Af 4 len Alpha +end +fn afproj qx long qy long dx long dy long to ulong +len2 = add mul dx dx mul dy dy +ex = qx +ey = qy +if ne len2 0 +t = add mul qx dx mul qy dy +if gt t 0 +if ge t len2 +ex = sub qx dx +ey = sub qy dy +else +ex = sub qx div mul dx t len2 +ey = sub qy div mul dy t len2 +end +end +end +ret ulong add mul ex ex mul ey ey +end +fn afdist slot ulong px long py long to ulong +at = mul slot 4 +dx = sub get Ag add at 2 get Ag at +dy = sub get Ag add at 3 get Ag add at 1 +qx = sub px get Ag at +qy = sub py get Ag add at 1 +ret afproj qx qy dx dy +end +fn afalpha px long py long to uchar +best = ulong 18446744073709551615 +for i ulong get Af 2 +d2 = afdist i px py +if lt d2 best +best = d2 +end +end +d = long afsqrt best +cov = sub add long get Af 1 128 d +if le cov 0 +ret 0 +end +if ge cov 256 +ret 255 +end +ret uchar div mul cov 255 256 +end +fn afrow y ulong to void +py = add mul add get Ab 1 long y 256 128 +for x ulong get Af 3 +px = add mul add get Ab 0 long x 256 128 +at = add mul y get Af 3 x +put Alpha at afalpha px py +end +end +fn afpaint to void +for y ulong get Af 4 +afrow y +end +end +fn afglyph c uchar to bool +if eq get Af 0 0 +ret false +end +if not afpick c +ret false +end +for i ulong 65536 +put Alpha i 0 +end +put Af 2 0 +put Af 3 0 +put Af 4 1 +put Af 5 0 +put Ab 0 0 +put Ab 1 0 +put Apen 0 0 +put Apen 1 0 +while lt get Afpos 0 get Afpos 1 +cmd = get Afdata get Afpos 0 +put Afpos 0 add get Afpos 0 1 +if not afcmd cmd +ret false +end +end +if eq get Af 2 0 +ret true +end +if not afbox +ret false +end +afpaint +ret true +end diff --git a/evidence/allen-omega-L694/L763/independent-review/run/lifecycle-v3.build.log b/evidence/allen-omega-L694/L763/independent-review/run/lifecycle-v3.build.log new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/L763/independent-review/run/lifecycle-v3.exit b/evidence/allen-omega-L694/L763/independent-review/run/lifecycle-v3.exit new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/L763/independent-review/run/lifecycle-v3.exit @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/L763/independent-review/run/lifecycle-v3.log b/evidence/allen-omega-L694/L763/independent-review/run/lifecycle-v3.log new file mode 100644 index 00000000..de812932 --- /dev/null +++ b/evidence/allen-omega-L694/L763/independent-review/run/lifecycle-v3.log @@ -0,0 +1,2 @@ +34 0 +exit=0 diff --git a/evidence/allen-omega-L694/L763/independent-review/run/lifecycle-v3.om b/evidence/allen-omega-L694/L763/independent-review/run/lifecycle-v3.om new file mode 100644 index 00000000..13fdde36 --- /dev/null +++ b/evidence/allen-omega-L694/L763/independent-review/run/lifecycle-v3.om @@ -0,0 +1,4271 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Stable application presentation; see PRESENTATION.md for scope and ownership. +global Ds ulong 8 +global Dt ulong 64 +global Dtext uchar 2304 +global Dsay ulong 1 +global Dm ulong 3 +global Dcode uchar 32768 +global Dstart ulong 4096 +global Dlen ulong 4096 +global Dline ulong 4096 +global Dview ulong 3 +global Din uchar 8192 +fn dscene to bool +n = get Inlen 0 +for i ulong 8192 +put Din i get In i +end +for i ulong get R 8 +put In i get Answer i +end +put Inlen 0 get R 8 +ok = scdecode +for i ulong 8192 +put In i get Din i +end +put Inlen 0 n +if not ok +ret false +end +for i ulong 8 +put Ds i get Sc i +end +for i ulong 64 +put Dt i get Things i +end +for i ulong 2304 +put Dtext i 0 +end +for i ulong get Sc 4 +put Dtext i get Stext i +end +put Dsay 0 get Sw 3 +put Dm 0 1 +ret true +end +fn dcode to bool +if or le get R 2 1 ne get R 1 0 +ret false +end +if or eq get R 6 0 ne get C 0 get R 0 +ret false +end +if not rows 80 4096 +ret false +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong get C 2 +put Dcode i get Code i +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong get View 0 +put Dstart i get Rowst i +put Dlen i get Rowlen i +put Dline i get Rowline i +end +put Dview 0 get View 0 +put Dview 1 0 +put Dview 2 get C 2 +put Dm 1 1 +ret true +end +fn dpresent to bool +if or eq get A 0 0 ne get A 2 1 +ret false +end +if or gt get R 8 159 gt get Inlen 0 8192 +ret false +end +shown = dscene +coded = dcode +if or shown coded +put Dm 2 get R 0 +ret true +end +ret false +end +fn dask now ulong to bool +if not appask now +ret false +end +b = dpresent +ret true +end +fn drecv now ulong to bool +if not appreceive now +ret false +end +b = dpresent +ret true +end +fn dreset to void +appreset +for i ulong 8 +put Ds i 0 +end +for i ulong 64 +put Dt i 0 +end +for i ulong 2304 +put Dtext i 0 +end +put Dsay 0 0 +for i ulong 3 +put Dm i 0 +put Dview i 0 +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong 8192 +put Din i 0 +end +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +dreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not dask now +ret 0 +end +else +if not drecv now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +note Declarative Allen glyph designs and integer sine samples, retained from +note native/kernel/ui/allen_font.c at4c7888f. No foreign executable implementation. +text Afdata "w6|w6 M3,0 L3,14 D3,20|w10 M3,0 L3,5 M7,0 L7,5|w15 M6,2 L4,20 M11,2 L9,20 M2,8 L13,8 M1,14 L12,14|w15 A8,5,5,5,-30,-270 A8,15,5,5,270,510 M8,-2 L8,22|w16 A4,4,2,3,0,360 A12,16,2,3,0,360 M13,1 L3,19|w16 M14,20 L5,9 A7,5,3,4,150,400 L3,14 A7,15,4,5,180,60 L13,11|w6 M3,0 L3,5|w9 A10,10,6,12,240,120|w9 A-1,10,6,12,-60,60|w14 M7,2 L7,10 M3,4 L11,8 M11,4 L3,8|w14 M2,12 L12,12 M7,7 L7,17|w6 M3,19 L2,23|w11 M2,13 L9,13|w6 D3,20|w12 M10,0 L2,20|w14 A7,10,5,10,0,360|w14 M3,4 L8,0 L8,20|w14 A7,6,5,6,200,400 L2,20 L12,20|w14 A7,5,5,5,200,450 A7,15,5,5,270,520|w14 M10,20 L10,0 L1,14 L13,14|w14 M12,0 L4,0 L4,9 A7,14,5,6,235,520|w14 A7,14,5,6,0,360 M10,0 L3,11|w14 M2,0 L12,0 L5,20|w14 A7,5,4,5,0,360 A7,15,5,5,0,360|w14 A7,6,5,6,0,360 M4,20 L11,9|w6 D3,8 D3,20|w6 D3,8 M3,19 L2,23|w14 M12,6 L2,12 L12,18|w14 M2,10 L12,10 M2,15 L12,15|w14 M2,6 L12,12 L2,18|w14 A7,5,5,5,190,450 L7,14 D7,20|w19 A9,12,3,4,0,360 M12,8 L12,14 A14,14,2,2,180,0 A9,11,7,9,0,-300|w16 M2,20 L8,0 L14,20 M4,13 L12,13|w15 M2,0 L2,20 M2,0 L8,0 A8,5,4,5,270,450 L2,10 M2,10 L9,10 A9,15,4,5,270,450 L2,20|w17 A9,10,7,10,45,315|w16 M2,0 L2,20 M2,0 L6,0 A6,10,8,10,270,450 L2,20|w14 M12,0 L2,0 L2,20 L12,20 M2,10 L10,10|w13 M12,0 L2,0 L2,20 M2,10 L10,10|w18 A9,10,7,10,-45,-360 M11,10 L16,10|w16 M2,0 L2,20 M14,0 L14,20 M2,10 L14,10|w6 M3,0 L3,20|w13 M10,0 L10,14 A6,14,4,6,0,180|w15 M2,0 L2,20 M13,0 L2,12 M6,8 L14,20|w13 M2,0 L2,20 L12,20|w20 M2,20 L2,0 L10,14 L18,0 L18,20|w16 M2,20 L2,0 L14,20 L14,0|w20 A10,10,8,10,0,360|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10|w20 A10,10,8,10,0,360 M12,14 L18,21|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10 M8,10 L14,20|w16 A8,5,5,5,-30,-270 A8,15,5,5,270,510|w16 M1,0 L15,0 M8,0 L8,20|w16 M2,0 L2,13 A8,13,6,7,180,0 L14,0|w16 M1,0 L8,20 L15,0|w22 M1,0 L6,20 L11,0 L16,20 L21,0|w16 M2,0 L14,20 M14,0 L2,20|w16 M1,0 L8,10 L15,0 M8,10 L8,20|w16 M2,0 L14,0 L2,20 L14,20|w9 M7,-1 L3,-1 L3,21 L7,21|w12 M2,0 L10,20|w9 M2,-1 L6,-1 L6,21 L2,21|w12 M2,8 L6,1 L10,8|w14 M1,23 L13,23|w7 M2,0 L4,4|w15 A7,14,5,6,0,360 M12,8 L12,20|w15 M2,0 L2,20 A7,14,5,6,0,360|w13 A7,14,5,6,40,320|w15 A7,14,5,6,0,360 M12,0 L12,20|w14 M2,14 L12,14 A7,14,5,6,0,-320|w11 M5,20 L5,4 A9,4,4,4,180,300 M2,8 L10,8|w15 A7,14,5,6,0,360 M12,8 L12,22 A7,22,5,5,0,150|w15 M2,0 L2,20 A7,13,5,5,180,360 L12,20|w6 M3,8 L3,20 D3,3|w7 M4,8 L4,22 A0,22,4,5,0,120 D4,3|w13 M2,0 L2,20 M11,8 L2,15 M5,13 L12,20|w6 M3,0 L3,20|w21 M2,8 L2,20 A6,12,4,4,180,360 L10,20 A14,12,4,4,180,360 L18,20|w15 M2,8 L2,20 A7,13,5,5,180,360 L12,20|w14 A7,14,5,6,0,360|w15 M2,8 L2,27 A7,14,5,6,0,360|w15 A7,14,5,6,0,360 M12,8 L12,27|w10 M2,8 L2,20 A7,13,5,5,180,290|w14 A7,11,4,3,-30,-270 A7,17,4,3,270,510|w11 M5,2 L5,17 A8,17,3,3,180,40 M2,8 L10,8|w15 M2,8 L2,15 A7,15,5,5,180,0 M12,8 L12,20|w14 M2,8 L7,20 L12,8|w20 M2,8 L6,20 L10,8 L14,20 L18,8|w14 M2,8 L12,20 M12,8 L2,20|w14 M2,8 L7,20 M12,8 L4,27|w14 M2,8 L12,8 L2,20 L12,20|w10 M8,-1 L6,0 L6,8 L4,10 L6,12 L6,20 L8,21|w6 M3,-1 L3,23|w10 M2,-1 L4,0 L4,8 L6,10 L4,12 L4,20 L2,21|w14 M2,13 L5,11 L9,14 L12,12|" +text Afsines "0 286 572 857 1143 1428 1713 1997 2280 2563 2845 3126 3406 3686 3964 4240 4516 4790 5063 5334 5604 5872 6138 6402 6664 6924 7182 7438 7692 7943 8192 8438 8682 8923 9162 9397 9630 9860 10087 10311 10531 10749 10963 11174 11381 11585 11786 11982 12176 12365 12551 12733 12911 13085 13255 13421 13583 13741 13894 14044 14189 14330 14466 14598 14726 14849 14968 15082 15191 15296 15396 15491 15582 15668 15749 15826 15897 15964 16026 16083 16135 16182 16225 16262 16294 16322 16344 16362 16374 16382 16384 " +note Handwritten bounded Allen stroke rasterizer. Legacy C is an external oracle only. +global Af ulong 6 +global Ab long 4 +global Ag long 640 +global Alpha uchar 65536 +global Asin long 91 +global Afpos ulong 2 +global Apen long 2 +global Arc long 6 +fn afsqrt value ulong to ulong +r = ulong 0 +bit = shl ulong 1 62 +while gt bit value +bit = shr bit 2 +end +while ne bit 0 +if ge value add r bit +value = sub value add r bit +r = add shr r 1 bit +else +r = shr r 1 +end +bit = shr bit 2 +end +ret r +end +fn afsin deg long to long +a = rem deg 360 +if lt a 0 +a = add a 360 +end +if le a 90 +ret get Asin ulong a +end +if le a 180 +ret get Asin ulong sub long 180 a +end +if le a 270 +ret neg get Asin ulong sub a 180 +end +ret neg get Asin ulong sub long 360 a +end +fn afcos deg long to long +ret afsin add rem deg 360 90 +end +fn afinit cap ulong wt ulong to bool +if or eq cap 0 gt cap 64 +ret false +end +if or eq wt 0 gt wt 2500 +ret false +end +for i ulong 6 +put Af i 0 +end +put Af 0 div mul cap 256 20 +put Af 1 div mul wt get Af 0 1000 +v = long 0 +slot = ulong 0 +for i ulong len Afsines +c = get Afsines i +if eq c 32 +put Asin slot v +slot = add slot 1 +v = 0 +else +v = add mul v 10 sub long c 48 +end +end +ret eq slot 91 +end +fn afpick c uchar to bool +if or lt c 32 gt c 126 +c = 63 +end +wanted = sub ulong c 32 +slot = ulong 0 +startat = ulong 0 +for i ulong len Afdata +if eq get Afdata i 124 +if eq slot wanted +put Afpos 0 startat +put Afpos 1 i +ret true +end +slot = add slot 1 +startat = add i 1 +end +end +ret false +end +fn afnum to long +p = get Afpos 0 +minus = false +if eq get Afdata p 45 +minus = true +p = add p 1 +end +v = long 0 +go = true +while and lt p get Afpos 1 go +c = get Afdata p +if and ge c 48 le c 57 +v = add mul v 10 sub long c 48 +p = add p 1 +else +go = false +end +end +if lt p get Afpos 1 +if eq get Afdata p 44 +p = add p 1 +end +end +put Afpos 0 p +if minus +ret neg v +end +ret v +end +fn afseg nx long ny long to bool +n = get Af 2 +if ge n 160 +ret false +end +at = mul n 4 +put Ag at get Apen 0 +put Ag add at 1 get Apen 1 +put Ag add at 2 nx +put Ag add at 3 ny +put Apen 0 nx +put Apen 1 ny +put Af 2 add n 1 +ret true +end +fn afpoint a long first bool to bool +s = long get Af 0 +x = mul get Arc 0 s +x = add x div mul mul get Arc 2 s afcos a 16384 +y = mul sub get Arc 1 20 s +y = add y div mul mul get Arc 3 s afsin a 16384 +if first +put Apen 0 x +put Apen 1 y +ret true +end +ret afseg x y +end +fn afarc to bool +for i ulong 6 +put Arc i afnum +end +span = sub get Arc 5 get Arc 4 +if lt span 0 +span = neg span +end +steps = div span 9 +if lt steps 2 +steps = 2 +end +for k ulong ulong add steps 1 +a = sub get Arc 5 get Arc 4 +a = add get Arc 4 div mul a long k steps +if not afpoint a eq k 0 +ret false +end +end +ret true +end +fn afcmd cmd uchar to bool +if eq cmd 32 +ret true +end +if eq cmd 119 +put Af 5 mul ulong afnum get Af 0 +ret true +end +if eq cmd 65 +ret afarc +end +x = mul afnum long get Af 0 +y = mul sub afnum 20 long get Af 0 +if or eq cmd 77 eq cmd 68 +put Apen 0 x +put Apen 1 y +end +if eq cmd 77 +ret true +end +if or eq cmd 76 eq cmd 68 +ret afseg x y +end +ret false +end +fn affloor value long to long +if ge value 0 +ret div value 256 +end +ret neg div add neg value 255 256 +end +fn afbound x long y long to void +if lt x get Ab 0 +put Ab 0 x +end +if lt y get Ab 1 +put Ab 1 y +end +if gt x get Ab 2 +put Ab 2 x +end +if gt y get Ab 3 +put Ab 3 y +end +end +fn afbox to bool +put Ab 0 get Ag 0 +put Ab 2 get Ag 0 +put Ab 1 get Ag 1 +put Ab 3 get Ag 1 +for i ulong get Af 2 +at = mul i 4 +afbound get Ag at get Ag add at 1 +afbound get Ag add at 2 get Ag add at 3 +end +pad = add long get Af 1 256 +x0 = affloor sub get Ab 0 pad +y0 = affloor sub get Ab 1 pad +x1 = add affloor add get Ab 2 pad 1 +y1 = add affloor add get Ab 3 pad 1 +put Ab 0 x0 +put Ab 1 y0 +put Af 3 ulong sub x1 x0 +put Af 4 ulong sub y1 y0 +ret le mul get Af 3 get Af 4 len Alpha +end +fn afproj qx long qy long dx long dy long to ulong +len2 = add mul dx dx mul dy dy +ex = qx +ey = qy +if ne len2 0 +t = add mul qx dx mul qy dy +if gt t 0 +if ge t len2 +ex = sub qx dx +ey = sub qy dy +else +ex = sub qx div mul dx t len2 +ey = sub qy div mul dy t len2 +end +end +end +ret ulong add mul ex ex mul ey ey +end +fn afdist slot ulong px long py long to ulong +at = mul slot 4 +dx = sub get Ag add at 2 get Ag at +dy = sub get Ag add at 3 get Ag add at 1 +qx = sub px get Ag at +qy = sub py get Ag add at 1 +ret afproj qx qy dx dy +end +fn afalpha px long py long to uchar +best = ulong 18446744073709551615 +for i ulong get Af 2 +d2 = afdist i px py +if lt d2 best +best = d2 +end +end +d = long afsqrt best +cov = sub add long get Af 1 128 d +if le cov 0 +ret 0 +end +if ge cov 256 +ret 255 +end +ret uchar div mul cov 255 256 +end +fn afrow y ulong to void +py = add mul add get Ab 1 long y 256 128 +for x ulong get Af 3 +px = add mul add get Ab 0 long x 256 128 +at = add mul y get Af 3 x +put Alpha at afalpha px py +end +end +fn afpaint to void +for y ulong get Af 4 +afrow y +end +end +fn afglyph c uchar to bool +if eq get Af 0 0 +ret false +end +if not afpick c +ret false +end +for i ulong 65536 +put Alpha i 0 +end +put Af 2 0 +put Af 3 0 +put Af 4 1 +put Af 5 0 +put Ab 0 0 +put Ab 1 0 +put Apen 0 0 +put Apen 1 0 +while lt get Afpos 0 get Afpos 1 +cmd = get Afdata get Afpos 0 +put Afpos 0 add get Afpos 0 1 +if not afcmd cmd +ret false +end +end +if eq get Af 2 0 +ret true +end +if not afbox +ret false +end +afpaint +ret true +end +note Independent L764 provider attachment lifecycle probe; handwritten Omega assertions. +text Lmagic "ALNPRV01" +text Lhi "hi" +text Lreply "SAY 1 1/1 hello" +global Lchecks ulong 1 +global Lfails ulong 1 +global Lheld uchar 8192 +fn lcheck ok bool to void +put Lchecks 0 add get Lchecks 0 1 +if not ok +put Lfails 0 add get Lfails 0 1 +end +end +fn lhword off ulong v ulong to void +for i ulong 8 +put Ph add off i uchar and shr v mul i 8 255 +end +end +fn lframe op ulong now ulong arg ulong size ulong to void +for i ulong 8 +put Ph i get Lmagic i +end +lhword 8 op +lhword 16 now +lhword 24 arg +lhword 32 size +end +fn lstatus to ulong +v = ulong 0 +for i ulong 8 +v = or v shl ulong get Pout add 16 i mul i 8 +end +ret v +end +fn lreceive part ulong size ulong to void +note Construct an actual courier LINE payload through existing packet logic. +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Lheld i get Outb i +end +put Inlen 0 size +b = packet 2 get Q 1 part 0 0 +size = get Outlen 0 +for i ulong size +put Pb i get Outb i +end +for i ulong n +put Outb i get Lheld i +end +put Outlen 0 n +put Err 0 e +lframe 5 4294967297 0 size +end +fn main to int +lframe 1 4294967296 77 0 +lcheck prdo +lcheck eq lstatus 1 +lframe 2 4294967297 0 len Lhi +for i ulong len Lhi +put Pb i get Lhi i +end +lcheck prdo +lcheck eq lstatus 1 +lframe 3 4294967297 1 0 +lcheck prdo +lcheck eq lstatus 3 +lframe 4 4294967297 1 0 +lcheck prdo +for i ulong len Lreply +put In i get Lreply i +end +lreceive 1 len Lreply +lcheck prdo +lcheck eq lstatus 1 +lcheck eq get Dm 0 1 +lcheck eq get Dm 2 1 +lcheck eq get Dtext get Dsay 0 104 +lframe 6 0 0 0 +lcheck prdo +lcheck eq lstatus 1 +lcheck eq get Dm 0 1 +lcheck eq get Dm 2 1 +lcheck eq get Dtext get Dsay 0 104 +lframe 1 4294967296 88 0 +lcheck prdo +lcheck eq lstatus 0 +lcheck eq get Dm 2 1 +lframe 3 4294967296 1 0 +lcheck prdo +lcheck eq lstatus 0 +lcheck eq get Dm 0 1 +lcheck eq get Dtext get Dsay 0 104 +lframe 5 4294967297 0 65 +for i ulong 65 +put Pb i 0 +end +lcheck prdo +lcheck eq lstatus 0 +lcheck eq get Dm 2 1 +lcheck eq get Dtext get Dsay 0 104 +lframe 7 0 0 0 +lcheck prdo +lcheck eq lstatus 1 +lcheck eq get Dm 0 0 +lcheck eq get Dm 1 0 +lcheck eq get Dm 2 0 +lcheck eq get Dtext get Dsay 0 0 +if ne get Lfails 0 0 +outreset +emitn get Lchecks 0 +emitb 32 +emitn get Lfails 0 +emitb 10 +w = write 1 Outb 0 get Outlen 0 +ret 1 +end +outreset +emitn get Lchecks 0 +emitb 32 +emitn get Lfails 0 +emitb 10 +w = write 1 Outb 0 get Outlen 0 +ret 0 +end diff --git a/evidence/allen-omega-L694/L763/independent-review/run/lifecycle.build.log b/evidence/allen-omega-L694/L763/independent-review/run/lifecycle.build.log new file mode 100644 index 00000000..b8804b87 --- /dev/null +++ b/evidence/allen-omega-L694/L763/independent-review/run/lifecycle.build.log @@ -0,0 +1 @@ +build_rc=0 diff --git a/evidence/allen-omega-L694/L763/independent-review/run/lifecycle.log b/evidence/allen-omega-L694/L763/independent-review/run/lifecycle.log new file mode 100644 index 00000000..50cc3099 --- /dev/null +++ b/evidence/allen-omega-L694/L763/independent-review/run/lifecycle.log @@ -0,0 +1,2 @@ +30 0 +exit=0 diff --git a/evidence/allen-omega-L694/L763/independent-review/run/lifecycle.om b/evidence/allen-omega-L694/L763/independent-review/run/lifecycle.om new file mode 100644 index 00000000..2dbc3afc --- /dev/null +++ b/evidence/allen-omega-L694/L763/independent-review/run/lifecycle.om @@ -0,0 +1,4263 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Stable application presentation; see PRESENTATION.md for scope and ownership. +global Ds ulong 8 +global Dt ulong 64 +global Dtext uchar 2304 +global Dsay ulong 1 +global Dm ulong 3 +global Dcode uchar 32768 +global Dstart ulong 4096 +global Dlen ulong 4096 +global Dline ulong 4096 +global Dview ulong 3 +global Din uchar 8192 +fn dscene to bool +n = get Inlen 0 +for i ulong 8192 +put Din i get In i +end +for i ulong get R 8 +put In i get Answer i +end +put Inlen 0 get R 8 +ok = scdecode +for i ulong 8192 +put In i get Din i +end +put Inlen 0 n +if not ok +ret false +end +for i ulong 8 +put Ds i get Sc i +end +for i ulong 64 +put Dt i get Things i +end +for i ulong 2304 +put Dtext i 0 +end +for i ulong get Sc 4 +put Dtext i get Stext i +end +put Dsay 0 get Sw 3 +put Dm 0 1 +ret true +end +fn dcode to bool +if or le get R 2 1 ne get R 1 0 +ret false +end +if or eq get R 6 0 ne get C 0 get R 0 +ret false +end +if not rows 80 4096 +ret false +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong get C 2 +put Dcode i get Code i +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong get View 0 +put Dstart i get Rowst i +put Dlen i get Rowlen i +put Dline i get Rowline i +end +put Dview 0 get View 0 +put Dview 1 0 +put Dview 2 get C 2 +put Dm 1 1 +ret true +end +fn dpresent to bool +if or eq get A 0 0 ne get A 2 1 +ret false +end +if or gt get R 8 159 gt get Inlen 0 8192 +ret false +end +shown = dscene +coded = dcode +if or shown coded +put Dm 2 get R 0 +ret true +end +ret false +end +fn dask now ulong to bool +if not appask now +ret false +end +b = dpresent +ret true +end +fn drecv now ulong to bool +if not appreceive now +ret false +end +b = dpresent +ret true +end +fn dreset to void +appreset +for i ulong 8 +put Ds i 0 +end +for i ulong 64 +put Dt i 0 +end +for i ulong 2304 +put Dtext i 0 +end +put Dsay 0 0 +for i ulong 3 +put Dm i 0 +put Dview i 0 +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong 8192 +put Din i 0 +end +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +dreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not dask now +ret 0 +end +else +if not drecv now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +note Declarative Allen glyph designs and integer sine samples, retained from +note native/kernel/ui/allen_font.c at4c7888f. No foreign executable implementation. +text Afdata "w6|w6 M3,0 L3,14 D3,20|w10 M3,0 L3,5 M7,0 L7,5|w15 M6,2 L4,20 M11,2 L9,20 M2,8 L13,8 M1,14 L12,14|w15 A8,5,5,5,-30,-270 A8,15,5,5,270,510 M8,-2 L8,22|w16 A4,4,2,3,0,360 A12,16,2,3,0,360 M13,1 L3,19|w16 M14,20 L5,9 A7,5,3,4,150,400 L3,14 A7,15,4,5,180,60 L13,11|w6 M3,0 L3,5|w9 A10,10,6,12,240,120|w9 A-1,10,6,12,-60,60|w14 M7,2 L7,10 M3,4 L11,8 M11,4 L3,8|w14 M2,12 L12,12 M7,7 L7,17|w6 M3,19 L2,23|w11 M2,13 L9,13|w6 D3,20|w12 M10,0 L2,20|w14 A7,10,5,10,0,360|w14 M3,4 L8,0 L8,20|w14 A7,6,5,6,200,400 L2,20 L12,20|w14 A7,5,5,5,200,450 A7,15,5,5,270,520|w14 M10,20 L10,0 L1,14 L13,14|w14 M12,0 L4,0 L4,9 A7,14,5,6,235,520|w14 A7,14,5,6,0,360 M10,0 L3,11|w14 M2,0 L12,0 L5,20|w14 A7,5,4,5,0,360 A7,15,5,5,0,360|w14 A7,6,5,6,0,360 M4,20 L11,9|w6 D3,8 D3,20|w6 D3,8 M3,19 L2,23|w14 M12,6 L2,12 L12,18|w14 M2,10 L12,10 M2,15 L12,15|w14 M2,6 L12,12 L2,18|w14 A7,5,5,5,190,450 L7,14 D7,20|w19 A9,12,3,4,0,360 M12,8 L12,14 A14,14,2,2,180,0 A9,11,7,9,0,-300|w16 M2,20 L8,0 L14,20 M4,13 L12,13|w15 M2,0 L2,20 M2,0 L8,0 A8,5,4,5,270,450 L2,10 M2,10 L9,10 A9,15,4,5,270,450 L2,20|w17 A9,10,7,10,45,315|w16 M2,0 L2,20 M2,0 L6,0 A6,10,8,10,270,450 L2,20|w14 M12,0 L2,0 L2,20 L12,20 M2,10 L10,10|w13 M12,0 L2,0 L2,20 M2,10 L10,10|w18 A9,10,7,10,-45,-360 M11,10 L16,10|w16 M2,0 L2,20 M14,0 L14,20 M2,10 L14,10|w6 M3,0 L3,20|w13 M10,0 L10,14 A6,14,4,6,0,180|w15 M2,0 L2,20 M13,0 L2,12 M6,8 L14,20|w13 M2,0 L2,20 L12,20|w20 M2,20 L2,0 L10,14 L18,0 L18,20|w16 M2,20 L2,0 L14,20 L14,0|w20 A10,10,8,10,0,360|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10|w20 A10,10,8,10,0,360 M12,14 L18,21|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10 M8,10 L14,20|w16 A8,5,5,5,-30,-270 A8,15,5,5,270,510|w16 M1,0 L15,0 M8,0 L8,20|w16 M2,0 L2,13 A8,13,6,7,180,0 L14,0|w16 M1,0 L8,20 L15,0|w22 M1,0 L6,20 L11,0 L16,20 L21,0|w16 M2,0 L14,20 M14,0 L2,20|w16 M1,0 L8,10 L15,0 M8,10 L8,20|w16 M2,0 L14,0 L2,20 L14,20|w9 M7,-1 L3,-1 L3,21 L7,21|w12 M2,0 L10,20|w9 M2,-1 L6,-1 L6,21 L2,21|w12 M2,8 L6,1 L10,8|w14 M1,23 L13,23|w7 M2,0 L4,4|w15 A7,14,5,6,0,360 M12,8 L12,20|w15 M2,0 L2,20 A7,14,5,6,0,360|w13 A7,14,5,6,40,320|w15 A7,14,5,6,0,360 M12,0 L12,20|w14 M2,14 L12,14 A7,14,5,6,0,-320|w11 M5,20 L5,4 A9,4,4,4,180,300 M2,8 L10,8|w15 A7,14,5,6,0,360 M12,8 L12,22 A7,22,5,5,0,150|w15 M2,0 L2,20 A7,13,5,5,180,360 L12,20|w6 M3,8 L3,20 D3,3|w7 M4,8 L4,22 A0,22,4,5,0,120 D4,3|w13 M2,0 L2,20 M11,8 L2,15 M5,13 L12,20|w6 M3,0 L3,20|w21 M2,8 L2,20 A6,12,4,4,180,360 L10,20 A14,12,4,4,180,360 L18,20|w15 M2,8 L2,20 A7,13,5,5,180,360 L12,20|w14 A7,14,5,6,0,360|w15 M2,8 L2,27 A7,14,5,6,0,360|w15 A7,14,5,6,0,360 M12,8 L12,27|w10 M2,8 L2,20 A7,13,5,5,180,290|w14 A7,11,4,3,-30,-270 A7,17,4,3,270,510|w11 M5,2 L5,17 A8,17,3,3,180,40 M2,8 L10,8|w15 M2,8 L2,15 A7,15,5,5,180,0 M12,8 L12,20|w14 M2,8 L7,20 L12,8|w20 M2,8 L6,20 L10,8 L14,20 L18,8|w14 M2,8 L12,20 M12,8 L2,20|w14 M2,8 L7,20 M12,8 L4,27|w14 M2,8 L12,8 L2,20 L12,20|w10 M8,-1 L6,0 L6,8 L4,10 L6,12 L6,20 L8,21|w6 M3,-1 L3,23|w10 M2,-1 L4,0 L4,8 L6,10 L4,12 L4,20 L2,21|w14 M2,13 L5,11 L9,14 L12,12|" +text Afsines "0 286 572 857 1143 1428 1713 1997 2280 2563 2845 3126 3406 3686 3964 4240 4516 4790 5063 5334 5604 5872 6138 6402 6664 6924 7182 7438 7692 7943 8192 8438 8682 8923 9162 9397 9630 9860 10087 10311 10531 10749 10963 11174 11381 11585 11786 11982 12176 12365 12551 12733 12911 13085 13255 13421 13583 13741 13894 14044 14189 14330 14466 14598 14726 14849 14968 15082 15191 15296 15396 15491 15582 15668 15749 15826 15897 15964 16026 16083 16135 16182 16225 16262 16294 16322 16344 16362 16374 16382 16384 " +note Handwritten bounded Allen stroke rasterizer. Legacy C is an external oracle only. +global Af ulong 6 +global Ab long 4 +global Ag long 640 +global Alpha uchar 65536 +global Asin long 91 +global Afpos ulong 2 +global Apen long 2 +global Arc long 6 +fn afsqrt value ulong to ulong +r = ulong 0 +bit = shl ulong 1 62 +while gt bit value +bit = shr bit 2 +end +while ne bit 0 +if ge value add r bit +value = sub value add r bit +r = add shr r 1 bit +else +r = shr r 1 +end +bit = shr bit 2 +end +ret r +end +fn afsin deg long to long +a = rem deg 360 +if lt a 0 +a = add a 360 +end +if le a 90 +ret get Asin ulong a +end +if le a 180 +ret get Asin ulong sub long 180 a +end +if le a 270 +ret neg get Asin ulong sub a 180 +end +ret neg get Asin ulong sub long 360 a +end +fn afcos deg long to long +ret afsin add rem deg 360 90 +end +fn afinit cap ulong wt ulong to bool +if or eq cap 0 gt cap 64 +ret false +end +if or eq wt 0 gt wt 2500 +ret false +end +for i ulong 6 +put Af i 0 +end +put Af 0 div mul cap 256 20 +put Af 1 div mul wt get Af 0 1000 +v = long 0 +slot = ulong 0 +for i ulong len Afsines +c = get Afsines i +if eq c 32 +put Asin slot v +slot = add slot 1 +v = 0 +else +v = add mul v 10 sub long c 48 +end +end +ret eq slot 91 +end +fn afpick c uchar to bool +if or lt c 32 gt c 126 +c = 63 +end +wanted = sub ulong c 32 +slot = ulong 0 +startat = ulong 0 +for i ulong len Afdata +if eq get Afdata i 124 +if eq slot wanted +put Afpos 0 startat +put Afpos 1 i +ret true +end +slot = add slot 1 +startat = add i 1 +end +end +ret false +end +fn afnum to long +p = get Afpos 0 +minus = false +if eq get Afdata p 45 +minus = true +p = add p 1 +end +v = long 0 +go = true +while and lt p get Afpos 1 go +c = get Afdata p +if and ge c 48 le c 57 +v = add mul v 10 sub long c 48 +p = add p 1 +else +go = false +end +end +if lt p get Afpos 1 +if eq get Afdata p 44 +p = add p 1 +end +end +put Afpos 0 p +if minus +ret neg v +end +ret v +end +fn afseg nx long ny long to bool +n = get Af 2 +if ge n 160 +ret false +end +at = mul n 4 +put Ag at get Apen 0 +put Ag add at 1 get Apen 1 +put Ag add at 2 nx +put Ag add at 3 ny +put Apen 0 nx +put Apen 1 ny +put Af 2 add n 1 +ret true +end +fn afpoint a long first bool to bool +s = long get Af 0 +x = mul get Arc 0 s +x = add x div mul mul get Arc 2 s afcos a 16384 +y = mul sub get Arc 1 20 s +y = add y div mul mul get Arc 3 s afsin a 16384 +if first +put Apen 0 x +put Apen 1 y +ret true +end +ret afseg x y +end +fn afarc to bool +for i ulong 6 +put Arc i afnum +end +span = sub get Arc 5 get Arc 4 +if lt span 0 +span = neg span +end +steps = div span 9 +if lt steps 2 +steps = 2 +end +for k ulong ulong add steps 1 +a = sub get Arc 5 get Arc 4 +a = add get Arc 4 div mul a long k steps +if not afpoint a eq k 0 +ret false +end +end +ret true +end +fn afcmd cmd uchar to bool +if eq cmd 32 +ret true +end +if eq cmd 119 +put Af 5 mul ulong afnum get Af 0 +ret true +end +if eq cmd 65 +ret afarc +end +x = mul afnum long get Af 0 +y = mul sub afnum 20 long get Af 0 +if or eq cmd 77 eq cmd 68 +put Apen 0 x +put Apen 1 y +end +if eq cmd 77 +ret true +end +if or eq cmd 76 eq cmd 68 +ret afseg x y +end +ret false +end +fn affloor value long to long +if ge value 0 +ret div value 256 +end +ret neg div add neg value 255 256 +end +fn afbound x long y long to void +if lt x get Ab 0 +put Ab 0 x +end +if lt y get Ab 1 +put Ab 1 y +end +if gt x get Ab 2 +put Ab 2 x +end +if gt y get Ab 3 +put Ab 3 y +end +end +fn afbox to bool +put Ab 0 get Ag 0 +put Ab 2 get Ag 0 +put Ab 1 get Ag 1 +put Ab 3 get Ag 1 +for i ulong get Af 2 +at = mul i 4 +afbound get Ag at get Ag add at 1 +afbound get Ag add at 2 get Ag add at 3 +end +pad = add long get Af 1 256 +x0 = affloor sub get Ab 0 pad +y0 = affloor sub get Ab 1 pad +x1 = add affloor add get Ab 2 pad 1 +y1 = add affloor add get Ab 3 pad 1 +put Ab 0 x0 +put Ab 1 y0 +put Af 3 ulong sub x1 x0 +put Af 4 ulong sub y1 y0 +ret le mul get Af 3 get Af 4 len Alpha +end +fn afproj qx long qy long dx long dy long to ulong +len2 = add mul dx dx mul dy dy +ex = qx +ey = qy +if ne len2 0 +t = add mul qx dx mul qy dy +if gt t 0 +if ge t len2 +ex = sub qx dx +ey = sub qy dy +else +ex = sub qx div mul dx t len2 +ey = sub qy div mul dy t len2 +end +end +end +ret ulong add mul ex ex mul ey ey +end +fn afdist slot ulong px long py long to ulong +at = mul slot 4 +dx = sub get Ag add at 2 get Ag at +dy = sub get Ag add at 3 get Ag add at 1 +qx = sub px get Ag at +qy = sub py get Ag add at 1 +ret afproj qx qy dx dy +end +fn afalpha px long py long to uchar +best = ulong 18446744073709551615 +for i ulong get Af 2 +d2 = afdist i px py +if lt d2 best +best = d2 +end +end +d = long afsqrt best +cov = sub add long get Af 1 128 d +if le cov 0 +ret 0 +end +if ge cov 256 +ret 255 +end +ret uchar div mul cov 255 256 +end +fn afrow y ulong to void +py = add mul add get Ab 1 long y 256 128 +for x ulong get Af 3 +px = add mul add get Ab 0 long x 256 128 +at = add mul y get Af 3 x +put Alpha at afalpha px py +end +end +fn afpaint to void +for y ulong get Af 4 +afrow y +end +end +fn afglyph c uchar to bool +if eq get Af 0 0 +ret false +end +if not afpick c +ret false +end +for i ulong 65536 +put Alpha i 0 +end +put Af 2 0 +put Af 3 0 +put Af 4 1 +put Af 5 0 +put Ab 0 0 +put Ab 1 0 +put Apen 0 0 +put Apen 1 0 +while lt get Afpos 0 get Afpos 1 +cmd = get Afdata get Afpos 0 +put Afpos 0 add get Afpos 0 1 +if not afcmd cmd +ret false +end +end +if eq get Af 2 0 +ret true +end +if not afbox +ret false +end +afpaint +ret true +end +note Independent L764 provider attachment lifecycle probe; handwritten Omega assertions. +text Lmagic "ALNPRV01" +text Lhi "hi" +text Lreply "SAY 1 1/1 hello" +global Lchecks ulong 1 +global Lfails ulong 1 +global Lheld uchar 8192 +fn lcheck ok bool to void +put Lchecks 0 add get Lchecks 0 1 +if not ok +put Lfails 0 add get Lfails 0 1 +end +end +fn lhword off ulong v ulong to void +for i ulong 8 +put Ph add off i uchar and shr v mul i 8 255 +end +end +fn lframe op ulong now ulong arg ulong size ulong to void +for i ulong 8 +put Ph i get Lmagic i +end +lhword 8 op +lhword 16 now +lhword 24 arg +lhword 32 size +end +fn lstatus to ulong +v = ulong 0 +for i ulong 8 +v = or v shl ulong get Pout add 16 i mul i 8 +end +ret v +end +fn lreceive part ulong size ulong to void +note Construct an actual courier LINE payload through existing packet logic. +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Lheld i get Outb i +end +put Inlen 0 size +b = packet 2 get Q 1 part 0 0 +size = get Outlen 0 +for i ulong size +put Pb i get Outb i +end +for i ulong n +put Outb i get Lheld i +end +put Outlen 0 n +put Err 0 e +lframe 5 4294967297 0 size +end +fn main to int +lframe 1 4294967296 77 0 +lcheck prdo +lcheck eq lstatus 1 +lframe 2 4294967297 0 len Lhi +for i ulong len Lhi +put Pb i get Lhi i +end +lcheck prdo +lcheck eq lstatus 1 +lframe 3 4294967297 1 0 +lcheck prdo +lcheck eq lstatus 3 +lframe 4 4294967297 1 0 +lcheck prdo +for i ulong len Lreply +put In i get Lreply i +end +lreceive 1 len Lreply +lcheck prdo +lcheck eq lstatus 1 +lcheck eq get Dm 0 1 +lcheck eq get Dm 2 1 +lcheck eq get Dtext get Dsay 0 104 +lframe 6 0 0 0 +lcheck prdo +lcheck eq lstatus 1 +lcheck eq get Dm 0 1 +lcheck eq get Dm 2 1 +lcheck eq get Dtext get Dsay 0 104 +lframe 1 4294967296 88 0 +lcheck prdo +lcheck eq lstatus 0 +lcheck eq get Dm 2 1 +lframe 3 4294967296 1 0 +lcheck prdo +lcheck eq lstatus 0 +lcheck eq get Dm 0 1 +lcheck eq get Dtext get Dsay 0 104 +lframe 7 0 0 0 +lcheck prdo +lcheck eq lstatus 1 +lcheck eq get Dm 0 0 +lcheck eq get Dm 1 0 +lcheck eq get Dm 2 0 +lcheck eq get Dtext get Dsay 0 0 +if ne get Lfails 0 0 +outreset +emitn get Lchecks 0 +emitb 32 +emitn get Lfails 0 +emitb 10 +w = write 1 Outb 0 get Outlen 0 +ret 1 +end +outreset +emitn get Lchecks 0 +emitb 32 +emitn get Lfails 0 +emitb 10 +w = write 1 Outb 0 get Outlen 0 +ret 0 +end diff --git a/evidence/allen-omega-L694/L763/independent-review/run/provider-focus.build.log b/evidence/allen-omega-L694/L763/independent-review/run/provider-focus.build.log new file mode 100644 index 00000000..b8804b87 --- /dev/null +++ b/evidence/allen-omega-L694/L763/independent-review/run/provider-focus.build.log @@ -0,0 +1 @@ +build_rc=0 diff --git a/evidence/allen-omega-L694/L763/independent-review/run/provider-focus.log b/evidence/allen-omega-L694/L763/independent-review/run/provider-focus.log new file mode 100644 index 00000000..9b32fe05 --- /dev/null +++ b/evidence/allen-omega-L694/L763/independent-review/run/provider-focus.log @@ -0,0 +1,137 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +exit=0 diff --git a/evidence/allen-omega-L694/L763/independent-review/run/provider-focus.om b/evidence/allen-omega-L694/L763/independent-review/run/provider-focus.om new file mode 100644 index 00000000..1e269178 --- /dev/null +++ b/evidence/allen-omega-L694/L763/independent-review/run/provider-focus.om @@ -0,0 +1,4469 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Stable application presentation; see PRESENTATION.md for scope and ownership. +global Ds ulong 8 +global Dt ulong 64 +global Dtext uchar 2304 +global Dsay ulong 1 +global Dm ulong 3 +global Dcode uchar 32768 +global Dstart ulong 4096 +global Dlen ulong 4096 +global Dline ulong 4096 +global Dview ulong 3 +global Din uchar 8192 +fn dscene to bool +n = get Inlen 0 +for i ulong 8192 +put Din i get In i +end +for i ulong get R 8 +put In i get Answer i +end +put Inlen 0 get R 8 +ok = scdecode +for i ulong 8192 +put In i get Din i +end +put Inlen 0 n +if not ok +ret false +end +for i ulong 8 +put Ds i get Sc i +end +for i ulong 64 +put Dt i get Things i +end +for i ulong 2304 +put Dtext i 0 +end +for i ulong get Sc 4 +put Dtext i get Stext i +end +put Dsay 0 get Sw 3 +put Dm 0 1 +ret true +end +fn dcode to bool +if or le get R 2 1 ne get R 1 0 +ret false +end +if or eq get R 6 0 ne get C 0 get R 0 +ret false +end +if not rows 80 4096 +ret false +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong get C 2 +put Dcode i get Code i +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong get View 0 +put Dstart i get Rowst i +put Dlen i get Rowlen i +put Dline i get Rowline i +end +put Dview 0 get View 0 +put Dview 1 0 +put Dview 2 get C 2 +put Dm 1 1 +ret true +end +fn dpresent to bool +if or eq get A 0 0 ne get A 2 1 +ret false +end +if or gt get R 8 159 gt get Inlen 0 8192 +ret false +end +shown = dscene +coded = dcode +if or shown coded +put Dm 2 get R 0 +ret true +end +ret false +end +fn dask now ulong to bool +if not appask now +ret false +end +b = dpresent +ret true +end +fn drecv now ulong to bool +if not appreceive now +ret false +end +b = dpresent +ret true +end +fn dreset to void +appreset +for i ulong 8 +put Ds i 0 +end +for i ulong 64 +put Dt i 0 +end +for i ulong 2304 +put Dtext i 0 +end +put Dsay 0 0 +for i ulong 3 +put Dm i 0 +put Dview i 0 +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong 8192 +put Din i 0 +end +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +dreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not dask now +ret 0 +end +else +if not drecv now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +note Declarative Allen glyph designs and integer sine samples, retained from +note native/kernel/ui/allen_font.c at4c7888f. No foreign executable implementation. +text Afdata "w6|w6 M3,0 L3,14 D3,20|w10 M3,0 L3,5 M7,0 L7,5|w15 M6,2 L4,20 M11,2 L9,20 M2,8 L13,8 M1,14 L12,14|w15 A8,5,5,5,-30,-270 A8,15,5,5,270,510 M8,-2 L8,22|w16 A4,4,2,3,0,360 A12,16,2,3,0,360 M13,1 L3,19|w16 M14,20 L5,9 A7,5,3,4,150,400 L3,14 A7,15,4,5,180,60 L13,11|w6 M3,0 L3,5|w9 A10,10,6,12,240,120|w9 A-1,10,6,12,-60,60|w14 M7,2 L7,10 M3,4 L11,8 M11,4 L3,8|w14 M2,12 L12,12 M7,7 L7,17|w6 M3,19 L2,23|w11 M2,13 L9,13|w6 D3,20|w12 M10,0 L2,20|w14 A7,10,5,10,0,360|w14 M3,4 L8,0 L8,20|w14 A7,6,5,6,200,400 L2,20 L12,20|w14 A7,5,5,5,200,450 A7,15,5,5,270,520|w14 M10,20 L10,0 L1,14 L13,14|w14 M12,0 L4,0 L4,9 A7,14,5,6,235,520|w14 A7,14,5,6,0,360 M10,0 L3,11|w14 M2,0 L12,0 L5,20|w14 A7,5,4,5,0,360 A7,15,5,5,0,360|w14 A7,6,5,6,0,360 M4,20 L11,9|w6 D3,8 D3,20|w6 D3,8 M3,19 L2,23|w14 M12,6 L2,12 L12,18|w14 M2,10 L12,10 M2,15 L12,15|w14 M2,6 L12,12 L2,18|w14 A7,5,5,5,190,450 L7,14 D7,20|w19 A9,12,3,4,0,360 M12,8 L12,14 A14,14,2,2,180,0 A9,11,7,9,0,-300|w16 M2,20 L8,0 L14,20 M4,13 L12,13|w15 M2,0 L2,20 M2,0 L8,0 A8,5,4,5,270,450 L2,10 M2,10 L9,10 A9,15,4,5,270,450 L2,20|w17 A9,10,7,10,45,315|w16 M2,0 L2,20 M2,0 L6,0 A6,10,8,10,270,450 L2,20|w14 M12,0 L2,0 L2,20 L12,20 M2,10 L10,10|w13 M12,0 L2,0 L2,20 M2,10 L10,10|w18 A9,10,7,10,-45,-360 M11,10 L16,10|w16 M2,0 L2,20 M14,0 L14,20 M2,10 L14,10|w6 M3,0 L3,20|w13 M10,0 L10,14 A6,14,4,6,0,180|w15 M2,0 L2,20 M13,0 L2,12 M6,8 L14,20|w13 M2,0 L2,20 L12,20|w20 M2,20 L2,0 L10,14 L18,0 L18,20|w16 M2,20 L2,0 L14,20 L14,0|w20 A10,10,8,10,0,360|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10|w20 A10,10,8,10,0,360 M12,14 L18,21|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10 M8,10 L14,20|w16 A8,5,5,5,-30,-270 A8,15,5,5,270,510|w16 M1,0 L15,0 M8,0 L8,20|w16 M2,0 L2,13 A8,13,6,7,180,0 L14,0|w16 M1,0 L8,20 L15,0|w22 M1,0 L6,20 L11,0 L16,20 L21,0|w16 M2,0 L14,20 M14,0 L2,20|w16 M1,0 L8,10 L15,0 M8,10 L8,20|w16 M2,0 L14,0 L2,20 L14,20|w9 M7,-1 L3,-1 L3,21 L7,21|w12 M2,0 L10,20|w9 M2,-1 L6,-1 L6,21 L2,21|w12 M2,8 L6,1 L10,8|w14 M1,23 L13,23|w7 M2,0 L4,4|w15 A7,14,5,6,0,360 M12,8 L12,20|w15 M2,0 L2,20 A7,14,5,6,0,360|w13 A7,14,5,6,40,320|w15 A7,14,5,6,0,360 M12,0 L12,20|w14 M2,14 L12,14 A7,14,5,6,0,-320|w11 M5,20 L5,4 A9,4,4,4,180,300 M2,8 L10,8|w15 A7,14,5,6,0,360 M12,8 L12,22 A7,22,5,5,0,150|w15 M2,0 L2,20 A7,13,5,5,180,360 L12,20|w6 M3,8 L3,20 D3,3|w7 M4,8 L4,22 A0,22,4,5,0,120 D4,3|w13 M2,0 L2,20 M11,8 L2,15 M5,13 L12,20|w6 M3,0 L3,20|w21 M2,8 L2,20 A6,12,4,4,180,360 L10,20 A14,12,4,4,180,360 L18,20|w15 M2,8 L2,20 A7,13,5,5,180,360 L12,20|w14 A7,14,5,6,0,360|w15 M2,8 L2,27 A7,14,5,6,0,360|w15 A7,14,5,6,0,360 M12,8 L12,27|w10 M2,8 L2,20 A7,13,5,5,180,290|w14 A7,11,4,3,-30,-270 A7,17,4,3,270,510|w11 M5,2 L5,17 A8,17,3,3,180,40 M2,8 L10,8|w15 M2,8 L2,15 A7,15,5,5,180,0 M12,8 L12,20|w14 M2,8 L7,20 L12,8|w20 M2,8 L6,20 L10,8 L14,20 L18,8|w14 M2,8 L12,20 M12,8 L2,20|w14 M2,8 L7,20 M12,8 L4,27|w14 M2,8 L12,8 L2,20 L12,20|w10 M8,-1 L6,0 L6,8 L4,10 L6,12 L6,20 L8,21|w6 M3,-1 L3,23|w10 M2,-1 L4,0 L4,8 L6,10 L4,12 L4,20 L2,21|w14 M2,13 L5,11 L9,14 L12,12|" +text Afsines "0 286 572 857 1143 1428 1713 1997 2280 2563 2845 3126 3406 3686 3964 4240 4516 4790 5063 5334 5604 5872 6138 6402 6664 6924 7182 7438 7692 7943 8192 8438 8682 8923 9162 9397 9630 9860 10087 10311 10531 10749 10963 11174 11381 11585 11786 11982 12176 12365 12551 12733 12911 13085 13255 13421 13583 13741 13894 14044 14189 14330 14466 14598 14726 14849 14968 15082 15191 15296 15396 15491 15582 15668 15749 15826 15897 15964 16026 16083 16135 16182 16225 16262 16294 16322 16344 16362 16374 16382 16384 " +note Handwritten bounded Allen stroke rasterizer. Legacy C is an external oracle only. +global Af ulong 6 +global Ab long 4 +global Ag long 640 +global Alpha uchar 65536 +global Asin long 91 +global Afpos ulong 2 +global Apen long 2 +global Arc long 6 +fn afsqrt value ulong to ulong +r = ulong 0 +bit = shl ulong 1 62 +while gt bit value +bit = shr bit 2 +end +while ne bit 0 +if ge value add r bit +value = sub value add r bit +r = add shr r 1 bit +else +r = shr r 1 +end +bit = shr bit 2 +end +ret r +end +fn afsin deg long to long +a = rem deg 360 +if lt a 0 +a = add a 360 +end +if le a 90 +ret get Asin ulong a +end +if le a 180 +ret get Asin ulong sub long 180 a +end +if le a 270 +ret neg get Asin ulong sub a 180 +end +ret neg get Asin ulong sub long 360 a +end +fn afcos deg long to long +ret afsin add rem deg 360 90 +end +fn afinit cap ulong wt ulong to bool +if or eq cap 0 gt cap 64 +ret false +end +if or eq wt 0 gt wt 2500 +ret false +end +for i ulong 6 +put Af i 0 +end +put Af 0 div mul cap 256 20 +put Af 1 div mul wt get Af 0 1000 +v = long 0 +slot = ulong 0 +for i ulong len Afsines +c = get Afsines i +if eq c 32 +put Asin slot v +slot = add slot 1 +v = 0 +else +v = add mul v 10 sub long c 48 +end +end +ret eq slot 91 +end +fn afpick c uchar to bool +if or lt c 32 gt c 126 +c = 63 +end +wanted = sub ulong c 32 +slot = ulong 0 +startat = ulong 0 +for i ulong len Afdata +if eq get Afdata i 124 +if eq slot wanted +put Afpos 0 startat +put Afpos 1 i +ret true +end +slot = add slot 1 +startat = add i 1 +end +end +ret false +end +fn afnum to long +p = get Afpos 0 +minus = false +if eq get Afdata p 45 +minus = true +p = add p 1 +end +v = long 0 +go = true +while and lt p get Afpos 1 go +c = get Afdata p +if and ge c 48 le c 57 +v = add mul v 10 sub long c 48 +p = add p 1 +else +go = false +end +end +if lt p get Afpos 1 +if eq get Afdata p 44 +p = add p 1 +end +end +put Afpos 0 p +if minus +ret neg v +end +ret v +end +fn afseg nx long ny long to bool +n = get Af 2 +if ge n 160 +ret false +end +at = mul n 4 +put Ag at get Apen 0 +put Ag add at 1 get Apen 1 +put Ag add at 2 nx +put Ag add at 3 ny +put Apen 0 nx +put Apen 1 ny +put Af 2 add n 1 +ret true +end +fn afpoint a long first bool to bool +s = long get Af 0 +x = mul get Arc 0 s +x = add x div mul mul get Arc 2 s afcos a 16384 +y = mul sub get Arc 1 20 s +y = add y div mul mul get Arc 3 s afsin a 16384 +if first +put Apen 0 x +put Apen 1 y +ret true +end +ret afseg x y +end +fn afarc to bool +for i ulong 6 +put Arc i afnum +end +span = sub get Arc 5 get Arc 4 +if lt span 0 +span = neg span +end +steps = div span 9 +if lt steps 2 +steps = 2 +end +for k ulong ulong add steps 1 +a = sub get Arc 5 get Arc 4 +a = add get Arc 4 div mul a long k steps +if not afpoint a eq k 0 +ret false +end +end +ret true +end +fn afcmd cmd uchar to bool +if eq cmd 32 +ret true +end +if eq cmd 119 +put Af 5 mul ulong afnum get Af 0 +ret true +end +if eq cmd 65 +ret afarc +end +x = mul afnum long get Af 0 +y = mul sub afnum 20 long get Af 0 +if or eq cmd 77 eq cmd 68 +put Apen 0 x +put Apen 1 y +end +if eq cmd 77 +ret true +end +if or eq cmd 76 eq cmd 68 +ret afseg x y +end +ret false +end +fn affloor value long to long +if ge value 0 +ret div value 256 +end +ret neg div add neg value 255 256 +end +fn afbound x long y long to void +if lt x get Ab 0 +put Ab 0 x +end +if lt y get Ab 1 +put Ab 1 y +end +if gt x get Ab 2 +put Ab 2 x +end +if gt y get Ab 3 +put Ab 3 y +end +end +fn afbox to bool +put Ab 0 get Ag 0 +put Ab 2 get Ag 0 +put Ab 1 get Ag 1 +put Ab 3 get Ag 1 +for i ulong get Af 2 +at = mul i 4 +afbound get Ag at get Ag add at 1 +afbound get Ag add at 2 get Ag add at 3 +end +pad = add long get Af 1 256 +x0 = affloor sub get Ab 0 pad +y0 = affloor sub get Ab 1 pad +x1 = add affloor add get Ab 2 pad 1 +y1 = add affloor add get Ab 3 pad 1 +put Ab 0 x0 +put Ab 1 y0 +put Af 3 ulong sub x1 x0 +put Af 4 ulong sub y1 y0 +ret le mul get Af 3 get Af 4 len Alpha +end +fn afproj qx long qy long dx long dy long to ulong +len2 = add mul dx dx mul dy dy +ex = qx +ey = qy +if ne len2 0 +t = add mul qx dx mul qy dy +if gt t 0 +if ge t len2 +ex = sub qx dx +ey = sub qy dy +else +ex = sub qx div mul dx t len2 +ey = sub qy div mul dy t len2 +end +end +end +ret ulong add mul ex ex mul ey ey +end +fn afdist slot ulong px long py long to ulong +at = mul slot 4 +dx = sub get Ag add at 2 get Ag at +dy = sub get Ag add at 3 get Ag add at 1 +qx = sub px get Ag at +qy = sub py get Ag add at 1 +ret afproj qx qy dx dy +end +fn afalpha px long py long to uchar +best = ulong 18446744073709551615 +for i ulong get Af 2 +d2 = afdist i px py +if lt d2 best +best = d2 +end +end +d = long afsqrt best +cov = sub add long get Af 1 128 d +if le cov 0 +ret 0 +end +if ge cov 256 +ret 255 +end +ret uchar div mul cov 255 256 +end +fn afrow y ulong to void +py = add mul add get Ab 1 long y 256 128 +for x ulong get Af 3 +px = add mul add get Ab 0 long x 256 128 +at = add mul y get Af 3 x +put Alpha at afalpha px py +end +end +fn afpaint to void +for y ulong get Af 4 +afrow y +end +end +fn afglyph c uchar to bool +if eq get Af 0 0 +ret false +end +if not afpick c +ret false +end +for i ulong 65536 +put Alpha i 0 +end +put Af 2 0 +put Af 3 0 +put Af 4 1 +put Af 5 0 +put Ab 0 0 +put Ab 1 0 +put Apen 0 0 +put Apen 1 0 +while lt get Afpos 0 get Afpos 1 +cmd = get Afdata get Afpos 0 +put Afpos 0 add get Afpos 0 1 +if not afcmd cmd +ret false +end +end +if eq get Af 2 0 +ret true +end +if not afbox +ret false +end +afpaint +ret true +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +text Fmagic "ALNPRV01" +text Hi "hi" +text Leak "LEAK" +text Reply "SAY 1 1/1 hello" +text Askcode "write a calculator" +text Tinycode "CODE 2 1/1 2 d8932aac text hi" +text Done "SAY 2 1/1 Done." +global Held uchar 8192 +global Holdn ulong 2 +global Before uchar 8192 +fn test ok bool to void +note Direct write logger would clobber the very datagram being tested. +put Holdn 0 get Outlen 0 +put Holdn 1 get Err 0 +for i ulong get Outlen 0 +put Held i get Outb i +end +check ok add get Checks 0 1 +for i ulong get Holdn 0 +put Outb i get Held i +end +put Outlen 0 get Holdn 0 +put Err 0 get Holdn 1 +end +fn hword off ulong v ulong to void +for i ulong 8 +put Ph add off i uchar and shr v mul i 8 255 +end +end +fn frame op ulong now ulong arg ulong size ulong to void +for i ulong 8 +put Ph i get Fmagic i +end +hword 8 op +hword 16 now +hword 24 arg +hword 32 size +end +fn oword off ulong to ulong +v = ulong 0 +for i ulong 8 +v = or v shl ulong get Pout add off i mul i 8 +end +ret v +end +fn receive part ulong size ulong to void +note Caller placed LINE payload in In; packet overwrites Outb, so preserve it. +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Held i get Outb i +end +put Inlen 0 size +b = packet 2 get Q 1 part 0 0 +size = get Outlen 0 +for i ulong size +put Pb i get Outb i +end +for i ulong n +put Outb i get Held i +end +put Outlen 0 n +put Err 0 e +frame 5 4294967297 0 size +end +fn main to int +frame 1 4294967296 77 0 +test prparse +test eq get Pv 0 1 +test eq get Pv 1 4294967296 +test eq get Pv 2 77 +put Ph 0 88 +test not prparse +frame 11 0 0 0 +test not prparse +frame 1 0 77 1 +test not prparse +frame 3 0 2 0 +test not prparse +frame 2 0 0 160 +test not prparse +frame 10 0 0 0 +test prdo +test eq oword 16 1 +test eq get Pc 0 1 +mset32 0 3 +mset32 36 1 +test memenc 10 +for i ulong 4096 +put Pb i get Enc i +end +frame 8 0 1 4096 +test prdo +test eq oword 16 1 +test eq get St 0 10 +test prdo +test eq oword 16 0 +frame 1 4294967296 77 0 +test prdo +test eq oword 16 0 +for i ulong 4096 +put Pb i 0 +end +frame 8 0 0 4096 +test prdo +test eq oword 16 2 +test eq get Pc 0 2 +test eq get St 0 10 +frame 1 4294967296 77 0 +test prdo +test eq oword 16 0 +put Ns 0 2 +put Ns 1 0 +put Ns 2 3 +put Ns 3 0 +put Note 0 78 +put Note 1 48 +test noteenc +for i ulong 4096 +put Pb i get Enc i +end +frame 9 0 1 4096 +test prdo +test eq oword 16 0 +frame 9 0 0 4096 +test prdo +test eq oword 16 1 +test eq get Pc 0 3 +frame 1 4294967296 77 0 +test prdo +test eq oword 16 1 +test eq get A 0 1 +test eq get Dm 0 0 +test eq get Dm 1 0 +test prdo +test eq oword 16 0 +frame 10 0 0 0 +test prdo +test eq oword 16 0 +test eq mem32 0 3 +frame 2 4294967297 0 len Hi +for i ulong len Hi +put Pb i get Hi i +end +test prdo +test eq oword 16 1 +test eq get R 0 1 +test eq get Dm 0 0 +frame 3 4294967297 1 0 +test prdo +test eq oword 16 3 +test eq oword 32 get Outlen 0 +test eq get T 10 5 +same = true +for i ulong get Outlen 0 +if ne get Pout add i 40 get Outb i +same = false +end +end +test same +test prdo +test eq oword 16 1 +test eq get T 10 5 +frame 4 4294967297 0 0 +test prdo +test eq get T 3 0 +frame 3 4294967297 1 0 +test prdo +test eq oword 16 3 +frame 4 4294967297 1 0 +test prdo +test eq get T 3 1 +frame 3 4294967297 1 0 +test prdo +test eq get T 10 1 +for i ulong len Reply +put In i get Reply i +end +receive 1 len Reply +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Before i get Outb i +end +test prdo +test eq get Outlen 0 n +test eq get Err 0 e +same = true +for i ulong n +if ne get Outb i get Before i +same = false +end +end +test same +test eq oword 16 1 +test eq oword 24 1 +test eq oword 32 5 +test eq get Pout 40 104 +test eq get Dm 0 1 +test eq get Dm 2 1 +test eq get Ds 2 1 +test eq get Dtext get Dsay 0 104 +test eq get R 1 0 +test eq get T 10 1 +test eq get Outb 0 65 +note A stale visible event must not be projected by a rejected provider frame. +for i ulong len Leak +put Answer i get Leak i +end +put R 8 len Leak +frame 5 4294967297 0 65 +put Ph 0 88 +test not prdo +test eq get Dtext get Dsay 0 104 +frame 5 4294967297 0 65 +for i ulong 65 +put Pb i 0 +end +test prdo +test eq oword 16 0 +test eq get Dtext get Dsay 0 104 +test eq get Dm 2 1 +frame 4 4294967297 1 0 +test prdo +frame 3 4294967297 1 0 +test prdo +test eq oword 16 3 +test eq get T 10 3 +frame 4 4294967297 1 0 +test prdo +frame 3 4294967297 1 0 +test prdo +test eq oword 16 1 +test eq oword 32 0 +frame 2 4294967297 0 len Askcode +for i ulong len Askcode +put Pb i get Askcode i +end +test prdo +test eq oword 24 1 +test eq oword 32 len Ack +test eq get Dm 0 1 +test eq get Dm 2 2 +test eq get Dtext get Dsay 0 73 +for i ulong len Tinycode +put In i get Tinycode i +end +receive 1 len Tinycode +test prdo +test eq oword 24 0 +test eq get Dm 1 0 +frame 3 4294967297 1 0 +test prdo +frame 4 4294967297 1 0 +test prdo +for i ulong len Done +put In i get Done i +end +receive 2 len Done +test prdo +test eq oword 24 1 +test eq oword 32 5 +off = ulong 45 +test eq oword add off 8 11 +test eq oword add off 32 2 +test eq get Pout add off 40 104 +test eq get Pout add off 41 105 +test eq get Pn 0 add off 42 +test eq get Dm 1 1 +test eq get Dm 2 2 +test eq get Dview 0 1 +test eq get Dview 2 2 +test eq get Dlen 0 2 +test eq get Dcode 0 104 +test eq get Dcode 1 105 +test eq get Dtext get Dsay 0 68 +note Snapshot stays independent of later assembly and refused clock. +put Code 0 88 +test eq get Dcode 0 104 +frame 3 4294967296 1 0 +test prdo +test eq oword 16 0 +test eq oword 24 0 +test eq get Dcode 0 104 +test eq get Dtext get Dsay 0 68 +put Dtext 2303 88 +put Dcode 32767 88 +put Dlen 4095 88 +frame 7 0 0 0 +test prdo +test eq get Dm 0 0 +test eq get Dm 1 0 +test eq get Dm 2 0 +test eq get Dview 0 0 +test eq get Dview 2 0 +test eq get Dtext 2303 0 +test eq get Dcode 32767 0 +test eq get Dlen 4095 0 +test eq get R 9 0 +test eq get R 0 2 +test eq get Q 1 2 +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L763/independent-review/source-hashes.sha256 b/evidence/allen-omega-L694/L763/independent-review/source-hashes.sha256 new file mode 100644 index 00000000..a6028e3a --- /dev/null +++ b/evidence/allen-omega-L694/L763/independent-review/source-hashes.sha256 @@ -0,0 +1,3 @@ +378767e9204c21eafd904290d8863e96b7701300c272dd70ffd63b02946841a9 /home/drakestapleton/handoffs/L764-review/run/core.om +db32a876b46a90be0fc4c5181dfc4af0420aff2b5a4dd323765cd4d9eaf76222 /home/drakestapleton/handoffs/L764-review/run/provider-focus.om +11050bfc0e21df08db82ca8cab6e250b4caa1101e9af995867defbef7dca367a /home/drakestapleton/handoffs/L764-review/lifecycle-v2.om diff --git a/evidence/allen-omega-L694/L763/inputtail-mutant.log b/evidence/allen-omega-L694/L763/inputtail-mutant.log new file mode 100644 index 00000000..c0415908 --- /dev/null +++ b/evidence/allen-omega-L694/L763/inputtail-mutant.log @@ -0,0 +1,75 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 1 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 diff --git a/evidence/allen-omega-L694/L763/intent.log b/evidence/allen-omega-L694/L763/intent.log new file mode 100644 index 00000000..5371bd36 --- /dev/null +++ b/evidence/allen-omega-L694/L763/intent.log @@ -0,0 +1,8 @@ +501 0 +502 0 +503 0 +504 0 +505 0 +506 0 +507 0 +508 0 diff --git a/evidence/allen-omega-L694/L763/inventory.json b/evidence/allen-omega-L694/L763/inventory.json new file mode 100644 index 00000000..f5da77ff --- /dev/null +++ b/evidence/allen-omega-L694/L763/inventory.json @@ -0,0 +1,74 @@ +{ + "README.md": "7143b8f2b86a2dd443a7b723113a6dbf9b7ac36a087b8e928db70f7e15994753", + "ackstop-mutant.log": "e35f80780a1c1769657287485e65ca25ab222d99277482c91900418d6dc6d433", + "appcode-mutant.log": "087522069b49d76999d8a495fccbff79cad4ff1fdf1d3ebf1e15855d6c959dc1", + "application.log": "799a91676cc7a8b0f4d027392ad8dda0e26af0501906ad906ae1ec8b1703d30a", + "autosent-mutant.log": "0a87e6bc447a7f5a73b519e4894331584138c0efa69baa3d66af99b4cadd5f2a", + "binaries.sha256": "8f7740e07603eddfbd55f244040246a57e32b63d541bef25120ad2ea0ef33328", + "code.log": "f4d91fae8c90949b5538689d148384c72984c34d8f84507b499cbb75349ec390", + "context.log": "a93a138b2ffb8a544174d9bc55e3e5e8b7d0f2531f4aff76030eba22e7c7b5e0", + "contextjob-mutant.log": "4f32375d7357e7ebd07106f23fada35d235ad7756a9aba91f6a556fae4d39c3b", + "contextnote-mutant.log": "528e41cd827af033d9f5391f011aba3c9e348051a57916c0c5d52c9e263f87a5", + "courier.log": "466116a0daf08d362ded3aab678a6213671cc17e82ead4bd6fdc5dcedf1674f1", + "crc-mutant.log": "d640ebbfc3be10156ce28e7972bd9931390e4a2c18f90099997e4bd94d941835", + "edges.log": "c3c33b435c05aebcb2c86e76121ca0681bcc58c52bc1388b5a8b47258c5603ed", + "font.log": "e740379ab582a55deec96e1e2cc0ad550b217409e78ea906b415765b522c028d", + "fontalpha-mutant.log": "4a9357c64f7baaff5d6ccce7396f34ae76c40d22b2df4e0262df3c90ba8b77f3", + "fontroot-mutant.log": "877fce5a15491776440a7318117a847f974aea016b3a2f162c8644302d02d0fc", + "framecheck-mutant.log": "925e213d1b31b91996ca57bcdddfd12c33f5a302d9e2176a11ccedd04f6ae58b", + "full.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa", + "full.log": "2d783008f9635f01ef89110deb9c49f34a71a05763322ddd67eb8df45a1d83f2", + "green.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa", + "green.log": "568cc8e9e1f6233e1f3b2e5fa07fafa4ac21f9cab5b006841eff0c2ba429c9fb", + "hash-mutant.log": "e2900d31ceb87ff95fb84cac73a1e6aa3a0100eebaada0432ec50c2471cd437e", + "inputtail-mutant.log": "48170607e958bb62a28b6a05bf184a3fcf16b5a0ec76bed8b7fa2bcc0b9a9d67", + "intent.log": "920955281e985095ba5d24b01370dcb7fc022559df06892bfc120a9fc6a04345", + "keepalive-mutant.log": "9cf7f699f4c0a01694b4d3d557857d95fa76bdf5d7d2d58571aef3b9e66da10e", + "long.log": "b37fc9e675de395d9cba4c2e74ae7ea210e617927691c9f1df4896ae1bafe508", + "memory.log": "d8ad7727ab1536ed00ab2a63f0a056e4e4cc237571077c36573952a4c49c9a15", + "paint.log": "ab43be8b6b42efc70663a0e14d0b44aec7c0766bbb961af2da77d2737f78a81a", + "pendingwire-mutant.log": "6a48c141724f07b9adf2a4da28802544ab29d2d3f42fe1eacb3ef45df2d96657", + "presentation.log": "c43d43223e83f0d34b868be1fa08b0fa42386f72938a8f59e24811f84aad37e7", + "provider-bad-1.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c", + "provider-bad-1.receipt": "4a4a5cc6008f0286443686c10c17919e7e3a3e2258a6b97bf06311c9afe0dfe4", + "provider-bad-2.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c", + "provider-bad-2.receipt": "437701d7771dcdcc130e256587a9251dbeabef08feb3d518d93f7db29b32619b", + "provider-bad-3.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c", + "provider-bad-3.receipt": "cf271c014ed96ffcad97c0ddde9a784deae63b48ab54ead38a601896a2cdfa05", + "provider-bad-4.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c", + "provider-bad-4.receipt": "3be14d5117cfd9923743dc772ac727cb30372228ca81879e3cac708dc9700d9a", + "provider-bad-5.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c", + "provider-bad-5.receipt": "311ce7da405cd8858718b28b45415028dedec82003dcb862d1b5ceea26c84646", + "provider-bad-6.log": "a0cc795fae1ca892318f47133f6c48e1c8bb6aad118ff7f2b00c8e8967393435", + "provider-bad-6.receipt": "26e7d22e42e36c12f4341bf1e1838f7fa84402571f3127fb91208ac45a05f64b", + "provider-consumer.log": "d8b9c61c09b396c654162f89688f72787756206bfcc70276d6c2682c3e7710f5", + "provider-consumer.receipt": "fb092a176e79462f135ff6f1aea3e2171eada31ad629d8c498104e43b244dabb", + "provider-core.log": "568cc8e9e1f6233e1f3b2e5fa07fafa4ac21f9cab5b006841eff0c2ba429c9fb", + "provider-fragment.log": "49c437a2551e71a10bc26bc969f55103611991adea98696503cbdb8e686d1ba3", + "provider-process.log": "d8b9c61c09b396c654162f89688f72787756206bfcc70276d6c2682c3e7710f5", + "provider-process.receipt": "fb092a176e79462f135ff6f1aea3e2171eada31ad629d8c498104e43b244dabb", + "provider-producer.log": "d8b9c61c09b396c654162f89688f72787756206bfcc70276d6c2682c3e7710f5", + "provider-producer.receipt": "b710cb935724406c7cf4e459857b58c47f6026696cc11727da2815675bfec4d9", + "provider-stream.log": "49c437a2551e71a10bc26bc969f55103611991adea98696503cbdb8e686d1ba3", + "rawask-mutant.log": "148f8896f9220cbbecb641a6fe49c137260bf437bec937d1f09afbd46b5451fb", + "rawrecv-mutant.log": "2e45054213301b34842645a40bc5e0e19498c1a26653b7bde451b4c36a4e6fb1", + "rawreset-mutant.log": "2acccf216cb9aaf9b5864661973daccbab733c0f1eef5cc37f7b386e55926826", + "readback-mutant.log": "c841304340c8e11f4412f33a05d63a76dfc6329270c33f30a4d5fb38c9339c61", + "red.exit": "4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865", + "red.log": "58a0648bb6f395125e97fb3787f3b60a725cb0ca7a0d27f36112ba023cbcf9ad", + "red.om": "0bba98de9e3925db8f3ea4d3c04a94f7bd02758e095d65c9cdf2063a70aca19b", + "reply.log": "32d6f801fcebf933a573005fdb8d16376c56b01c34b1004101b0c0f047216162", + "runtime.log": "3113eae822a3529bfeb10a00da4130799a2e951a77ce4d468a7e94ff5a312c51", + "scene-input.log": "613312ef2e6ad6eb62d19f9a161a65dbefd867af59a260d4dd82adef18ff88c9", + "scene.log": "bec37a817909cb5af22c3d82c962698ab0ddaf8a2c16debe86a84ea2a0889bc8", + "scenecap-mutant.log": "aaecc0a85ed361c2a5f6823a85f76ea5c8c60e3bef3d88ef225175ca7c3c090d", + "scheduler.log": "b73f09405c612284cb7eecacb51fbabe60f5f7c6ec11f504cbb76a1e4e83f948", + "session-mutant.log": "b6320567e748c4f1ab264c07c76e22f7091d6bf77c004aae67ecef4d8115e8f2", + "short.log": "b8ed8e2db46290298415a96dbb9f64580f5ff79f631cdcf3b0257f3fb836f8a2", + "source.sha256": "dd9bdc76bc690a3303c6d66d1ad30ebc54ff2ab70f4b9aee07159d284d6c85fa", + "stale-mutant.log": "59a77d4cd8683beb2a101425071eafef48c9afba89ac8b6e10edb8ed1098b42b", + "staleview-mutant.log": "0968ca91bbecca4bf9f6dda44d115d3a162170b23ce21fa798a32a9617cd425b", + "summary.json": "bf272391d502b317bb72f14e4b713d32e2bf8ade17cc14afdbc2ca0d59268ba6", + "thinking-mutant.log": "908c76c450a2ae6643694cc1f41e2a868792bcc3e20e96c317de6fa764d7f474", + "view.log": "2d117e033fea3f325a11c5cd70be5a181eb4d7d6b08e45b5fd73447d4159550e" +} diff --git a/evidence/allen-omega-L694/L763/keepalive-mutant.log b/evidence/allen-omega-L694/L763/keepalive-mutant.log new file mode 100644 index 00000000..2e3415df --- /dev/null +++ b/evidence/allen-omega-L694/L763/keepalive-mutant.log @@ -0,0 +1,213 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 1 +19 1 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 1 +54 1 +55 1 +56 1 +57 0 +58 0 +59 1 +60 0 +61 0 +62 0 +63 0 +64 0 +65 1 +66 0 +67 0 +68 0 +69 1 +70 1 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 1 +170 0 +171 1 +172 1 +173 0 +174 1 +175 0 +176 0 +177 0 +178 1 +179 1 +180 1 +181 1 +182 1 +183 1 +184 1 +185 1 +186 1 +187 1 +188 1 +189 1 +190 1 +191 1 +192 1 +193 1 +194 1 +195 1 +196 1 +197 1 +198 0 +199 1 +200 0 +201 0 +202 1 +203 1 +204 1 +205 0 +206 1 +207 1 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 diff --git a/evidence/allen-omega-L694/L763/long.log b/evidence/allen-omega-L694/L763/long.log new file mode 100644 index 00000000..0a060bc8 --- /dev/null +++ b/evidence/allen-omega-L694/L763/long.log @@ -0,0 +1,292 @@ +401 0 +410 0 +411 0 +412 0 +413 0 +414 0 +415 0 +416 0 +417 0 +418 0 +419 0 +420 0 +421 0 +422 0 +423 0 +424 0 +425 0 +426 0 +427 0 +428 0 +429 0 +430 0 +431 0 +432 0 +433 0 +434 0 +435 0 +436 0 +437 0 +438 0 +439 0 +440 0 +441 0 +442 0 +443 0 +444 0 +445 0 +446 0 +447 0 +448 0 +449 0 +450 0 +451 0 +452 0 +453 0 +454 0 +455 0 +456 0 +457 0 +458 0 +459 0 +460 0 +461 0 +462 0 +463 0 +464 0 +465 0 +466 0 +467 0 +468 0 +469 0 +470 0 +471 0 +472 0 +473 0 +474 0 +475 0 +476 0 +477 0 +478 0 +479 0 +480 0 +481 0 +482 0 +483 0 +484 0 +485 0 +486 0 +487 0 +488 0 +489 0 +490 0 +491 0 +492 0 +493 0 +494 0 +495 0 +496 0 +497 0 +498 0 +499 0 +500 0 +501 0 +502 0 +503 0 +504 0 +505 0 +506 0 +507 0 +508 0 +509 0 +510 0 +511 0 +512 0 +513 0 +514 0 +515 0 +516 0 +517 0 +518 0 +519 0 +520 0 +521 0 +522 0 +523 0 +524 0 +525 0 +526 0 +527 0 +528 0 +529 0 +530 0 +531 0 +532 0 +533 0 +534 0 +535 0 +536 0 +537 0 +538 0 +539 0 +540 0 +541 0 +542 0 +543 0 +544 0 +545 0 +546 0 +547 0 +548 0 +549 0 +550 0 +402 0 +403 0 +404 0 +405 0 +406 0 +700 0 +701 0 +702 0 +703 0 +704 0 +705 0 +706 0 +707 0 +708 0 +709 0 +710 0 +711 0 +712 0 +713 0 +714 0 +715 0 +716 0 +717 0 +718 0 +719 0 +720 0 +721 0 +722 0 +723 0 +724 0 +725 0 +726 0 +727 0 +728 0 +729 0 +730 0 +731 0 +732 0 +733 0 +734 0 +735 0 +736 0 +737 0 +738 0 +739 0 +740 0 +741 0 +742 0 +743 0 +744 0 +745 0 +746 0 +747 0 +748 0 +749 0 +750 0 +751 0 +752 0 +753 0 +754 0 +755 0 +756 0 +757 0 +758 0 +759 0 +760 0 +761 0 +762 0 +763 0 +764 0 +765 0 +766 0 +767 0 +768 0 +769 0 +770 0 +771 0 +772 0 +773 0 +774 0 +775 0 +776 0 +777 0 +778 0 +779 0 +780 0 +781 0 +782 0 +783 0 +784 0 +785 0 +786 0 +787 0 +788 0 +789 0 +790 0 +791 0 +792 0 +793 0 +794 0 +795 0 +796 0 +797 0 +798 0 +799 0 +800 0 +801 0 +802 0 +803 0 +804 0 +805 0 +806 0 +807 0 +808 0 +809 0 +810 0 +811 0 +812 0 +813 0 +814 0 +815 0 +816 0 +817 0 +818 0 +819 0 +820 0 +821 0 +822 0 +823 0 +824 0 +825 0 +826 0 +827 0 +828 0 +829 0 +830 0 +831 0 +832 0 +833 0 +834 0 +835 0 +836 0 +837 0 +838 0 +839 0 +840 0 +841 0 +407 0 +408 0 +409 0 diff --git a/evidence/allen-omega-L694/L763/memory.log b/evidence/allen-omega-L694/L763/memory.log new file mode 100644 index 00000000..5928102e --- /dev/null +++ b/evidence/allen-omega-L694/L763/memory.log @@ -0,0 +1,79 @@ +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 0 +310 0 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +362 0 +363 0 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 0 +361 0 diff --git a/evidence/allen-omega-L694/L763/paint.log b/evidence/allen-omega-L694/L763/paint.log new file mode 100644 index 00000000..281a5bd2 --- /dev/null +++ b/evidence/allen-omega-L694/L763/paint.log @@ -0,0 +1,11 @@ +1101 0 +1102 0 +1103 0 +1104 0 +1105 0 +1106 0 +1107 0 +1108 0 +1109 0 +1110 0 +1111 0 diff --git a/evidence/allen-omega-L694/L763/pendingwire-mutant.log b/evidence/allen-omega-L694/L763/pendingwire-mutant.log new file mode 100644 index 00000000..48fb2008 --- /dev/null +++ b/evidence/allen-omega-L694/L763/pendingwire-mutant.log @@ -0,0 +1,182 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 1 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 diff --git a/evidence/allen-omega-L694/L763/presentation.log b/evidence/allen-omega-L694/L763/presentation.log new file mode 100644 index 00000000..84fd2470 --- /dev/null +++ b/evidence/allen-omega-L694/L763/presentation.log @@ -0,0 +1,75 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 diff --git a/evidence/allen-omega-L694/L763/provider-bad-1.log b/evidence/allen-omega-L694/L763/provider-bad-1.log new file mode 100644 index 00000000..7da8e511 --- /dev/null +++ b/evidence/allen-omega-L694/L763/provider-bad-1.log @@ -0,0 +1,5 @@ +1 0 +2 0 +3 0 +4 0 +5 0 diff --git a/evidence/allen-omega-L694/L763/provider-bad-1.receipt b/evidence/allen-omega-L694/L763/provider-bad-1.receipt new file mode 100644 index 00000000..2b29860a --- /dev/null +++ b/evidence/allen-omega-L694/L763/provider-bad-1.receipt @@ -0,0 +1,4 @@ +1 +65 +0 +0 diff --git a/evidence/allen-omega-L694/L763/provider-bad-2.log b/evidence/allen-omega-L694/L763/provider-bad-2.log new file mode 100644 index 00000000..7da8e511 --- /dev/null +++ b/evidence/allen-omega-L694/L763/provider-bad-2.log @@ -0,0 +1,5 @@ +1 0 +2 0 +3 0 +4 0 +5 0 diff --git a/evidence/allen-omega-L694/L763/provider-bad-2.receipt b/evidence/allen-omega-L694/L763/provider-bad-2.receipt new file mode 100644 index 00000000..9ba12cca --- /dev/null +++ b/evidence/allen-omega-L694/L763/provider-bad-2.receipt @@ -0,0 +1,4 @@ +2 +65 +0 +0 diff --git a/evidence/allen-omega-L694/L763/provider-bad-3.log b/evidence/allen-omega-L694/L763/provider-bad-3.log new file mode 100644 index 00000000..7da8e511 --- /dev/null +++ b/evidence/allen-omega-L694/L763/provider-bad-3.log @@ -0,0 +1,5 @@ +1 0 +2 0 +3 0 +4 0 +5 0 diff --git a/evidence/allen-omega-L694/L763/provider-bad-3.receipt b/evidence/allen-omega-L694/L763/provider-bad-3.receipt new file mode 100644 index 00000000..199cc204 --- /dev/null +++ b/evidence/allen-omega-L694/L763/provider-bad-3.receipt @@ -0,0 +1,4 @@ +3 +65 +0 +0 diff --git a/evidence/allen-omega-L694/L763/provider-bad-4.log b/evidence/allen-omega-L694/L763/provider-bad-4.log new file mode 100644 index 00000000..7da8e511 --- /dev/null +++ b/evidence/allen-omega-L694/L763/provider-bad-4.log @@ -0,0 +1,5 @@ +1 0 +2 0 +3 0 +4 0 +5 0 diff --git a/evidence/allen-omega-L694/L763/provider-bad-4.receipt b/evidence/allen-omega-L694/L763/provider-bad-4.receipt new file mode 100644 index 00000000..26a81c4a --- /dev/null +++ b/evidence/allen-omega-L694/L763/provider-bad-4.receipt @@ -0,0 +1,4 @@ +4 +65 +0 +0 diff --git a/evidence/allen-omega-L694/L763/provider-bad-5.log b/evidence/allen-omega-L694/L763/provider-bad-5.log new file mode 100644 index 00000000..7da8e511 --- /dev/null +++ b/evidence/allen-omega-L694/L763/provider-bad-5.log @@ -0,0 +1,5 @@ +1 0 +2 0 +3 0 +4 0 +5 0 diff --git a/evidence/allen-omega-L694/L763/provider-bad-5.receipt b/evidence/allen-omega-L694/L763/provider-bad-5.receipt new file mode 100644 index 00000000..d79f5995 --- /dev/null +++ b/evidence/allen-omega-L694/L763/provider-bad-5.receipt @@ -0,0 +1,4 @@ +5 +65 +0 +0 diff --git a/evidence/allen-omega-L694/L763/provider-bad-6.log b/evidence/allen-omega-L694/L763/provider-bad-6.log new file mode 100644 index 00000000..3f9cc45d --- /dev/null +++ b/evidence/allen-omega-L694/L763/provider-bad-6.log @@ -0,0 +1,17 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 diff --git a/evidence/allen-omega-L694/L763/provider-bad-6.receipt b/evidence/allen-omega-L694/L763/provider-bad-6.receipt new file mode 100644 index 00000000..d0b7cd17 Binary files /dev/null and b/evidence/allen-omega-L694/L763/provider-bad-6.receipt differ diff --git a/evidence/allen-omega-L694/L763/provider-consumer.log b/evidence/allen-omega-L694/L763/provider-consumer.log new file mode 100644 index 00000000..9c0592e2 --- /dev/null +++ b/evidence/allen-omega-L694/L763/provider-consumer.log @@ -0,0 +1,3 @@ +1 0 +2 0 +3 0 diff --git a/evidence/allen-omega-L694/L763/provider-consumer.receipt b/evidence/allen-omega-L694/L763/provider-consumer.receipt new file mode 100644 index 00000000..31d93b9d Binary files /dev/null and b/evidence/allen-omega-L694/L763/provider-consumer.receipt differ diff --git a/evidence/allen-omega-L694/L763/provider-core.log b/evidence/allen-omega-L694/L763/provider-core.log new file mode 100644 index 00000000..1f06fc57 --- /dev/null +++ b/evidence/allen-omega-L694/L763/provider-core.log @@ -0,0 +1,136 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 diff --git a/evidence/allen-omega-L694/L763/provider-fragment.log b/evidence/allen-omega-L694/L763/provider-fragment.log new file mode 100644 index 00000000..d91084d1 --- /dev/null +++ b/evidence/allen-omega-L694/L763/provider-fragment.log @@ -0,0 +1,292 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 +183 0 +184 0 +185 0 +186 0 +187 0 +188 0 +189 0 +190 0 +191 0 +192 0 +193 0 +194 0 +195 0 +196 0 +197 0 +198 0 +199 0 +200 0 +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 +225 0 +226 0 +227 0 +228 0 +229 0 +230 0 +231 0 +232 0 +233 0 +234 0 +235 0 +236 0 +237 0 +238 0 +239 0 +240 0 +241 0 +242 0 +243 0 +244 0 +245 0 +246 0 +247 0 +248 0 +249 0 +250 0 +251 0 +252 0 +253 0 +254 0 +255 0 +256 0 +257 0 +258 0 +259 0 +260 0 +261 0 +262 0 +263 0 +264 0 +265 0 +266 0 +267 0 +268 0 +269 0 +270 0 +271 0 +272 0 +273 0 +274 0 +275 0 +276 0 +277 0 +278 0 +279 0 +280 0 +281 0 +282 0 +283 0 +284 0 +285 0 +286 0 +287 0 +288 0 +289 0 +290 0 +291 0 +292 0 diff --git a/evidence/allen-omega-L694/L763/provider-process.log b/evidence/allen-omega-L694/L763/provider-process.log new file mode 100644 index 00000000..9c0592e2 --- /dev/null +++ b/evidence/allen-omega-L694/L763/provider-process.log @@ -0,0 +1,3 @@ +1 0 +2 0 +3 0 diff --git a/evidence/allen-omega-L694/L763/provider-process.receipt b/evidence/allen-omega-L694/L763/provider-process.receipt new file mode 100644 index 00000000..31d93b9d Binary files /dev/null and b/evidence/allen-omega-L694/L763/provider-process.receipt differ diff --git a/evidence/allen-omega-L694/L763/provider-producer.log b/evidence/allen-omega-L694/L763/provider-producer.log new file mode 100644 index 00000000..9c0592e2 --- /dev/null +++ b/evidence/allen-omega-L694/L763/provider-producer.log @@ -0,0 +1,3 @@ +1 0 +2 0 +3 0 diff --git a/evidence/allen-omega-L694/L763/provider-producer.receipt b/evidence/allen-omega-L694/L763/provider-producer.receipt new file mode 100644 index 00000000..0967800c --- /dev/null +++ b/evidence/allen-omega-L694/L763/provider-producer.receipt @@ -0,0 +1,4 @@ +7 +0 +0 +0 diff --git a/evidence/allen-omega-L694/L763/provider-stream.log b/evidence/allen-omega-L694/L763/provider-stream.log new file mode 100644 index 00000000..d91084d1 --- /dev/null +++ b/evidence/allen-omega-L694/L763/provider-stream.log @@ -0,0 +1,292 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 +183 0 +184 0 +185 0 +186 0 +187 0 +188 0 +189 0 +190 0 +191 0 +192 0 +193 0 +194 0 +195 0 +196 0 +197 0 +198 0 +199 0 +200 0 +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 +225 0 +226 0 +227 0 +228 0 +229 0 +230 0 +231 0 +232 0 +233 0 +234 0 +235 0 +236 0 +237 0 +238 0 +239 0 +240 0 +241 0 +242 0 +243 0 +244 0 +245 0 +246 0 +247 0 +248 0 +249 0 +250 0 +251 0 +252 0 +253 0 +254 0 +255 0 +256 0 +257 0 +258 0 +259 0 +260 0 +261 0 +262 0 +263 0 +264 0 +265 0 +266 0 +267 0 +268 0 +269 0 +270 0 +271 0 +272 0 +273 0 +274 0 +275 0 +276 0 +277 0 +278 0 +279 0 +280 0 +281 0 +282 0 +283 0 +284 0 +285 0 +286 0 +287 0 +288 0 +289 0 +290 0 +291 0 +292 0 diff --git a/evidence/allen-omega-L694/L763/rawask-mutant.log b/evidence/allen-omega-L694/L763/rawask-mutant.log new file mode 100644 index 00000000..a9da9338 --- /dev/null +++ b/evidence/allen-omega-L694/L763/rawask-mutant.log @@ -0,0 +1,136 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 1 +97 1 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 diff --git a/evidence/allen-omega-L694/L763/rawrecv-mutant.log b/evidence/allen-omega-L694/L763/rawrecv-mutant.log new file mode 100644 index 00000000..debaa464 --- /dev/null +++ b/evidence/allen-omega-L694/L763/rawrecv-mutant.log @@ -0,0 +1,136 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 1 +72 1 +73 1 +74 1 +75 0 +76 0 +77 0 +78 0 +79 1 +80 0 +81 0 +82 1 +83 1 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 1 +112 0 +113 1 +114 1 +115 1 +116 1 +117 1 +118 1 +119 1 +120 0 +121 0 +122 0 +123 1 +124 1 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 diff --git a/evidence/allen-omega-L694/L763/rawreset-mutant.log b/evidence/allen-omega-L694/L763/rawreset-mutant.log new file mode 100644 index 00000000..bbd3c7f0 --- /dev/null +++ b/evidence/allen-omega-L694/L763/rawreset-mutant.log @@ -0,0 +1,136 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 1 +127 1 +128 1 +129 1 +130 1 +131 1 +132 1 +133 1 +134 0 +135 0 +136 0 diff --git a/evidence/allen-omega-L694/L763/readback-mutant.log b/evidence/allen-omega-L694/L763/readback-mutant.log new file mode 100644 index 00000000..268002ad --- /dev/null +++ b/evidence/allen-omega-L694/L763/readback-mutant.log @@ -0,0 +1,79 @@ +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 0 +310 0 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 1 +339 1 +340 0 +341 0 +342 0 +343 0 +344 1 +345 0 +346 0 +347 0 +348 0 +349 1 +350 1 +351 0 +352 0 +362 0 +363 0 +353 1 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 1 +361 0 diff --git a/evidence/allen-omega-L694/L763/red.exit b/evidence/allen-omega-L694/L763/red.exit new file mode 100644 index 00000000..d00491fd --- /dev/null +++ b/evidence/allen-omega-L694/L763/red.exit @@ -0,0 +1 @@ +1 diff --git a/evidence/allen-omega-L694/L763/red.log b/evidence/allen-omega-L694/L763/red.log new file mode 100644 index 00000000..8cce9d3c --- /dev/null +++ b/evidence/allen-omega-L694/L763/red.log @@ -0,0 +1,136 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 1 +72 1 +73 1 +74 1 +75 0 +76 0 +77 0 +78 0 +79 1 +80 0 +81 0 +82 1 +83 1 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 1 +96 1 +97 1 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 1 +112 1 +113 1 +114 1 +115 1 +116 1 +117 1 +118 1 +119 1 +120 0 +121 0 +122 0 +123 1 +124 1 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 1 +132 1 +133 1 +134 0 +135 0 +136 0 diff --git a/evidence/allen-omega-L694/L763/red.om b/evidence/allen-omega-L694/L763/red.om new file mode 100644 index 00000000..f6e24e90 --- /dev/null +++ b/evidence/allen-omega-L694/L763/red.om @@ -0,0 +1,4469 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +appreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not appask now +ret 0 +end +else +if not appreceive now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +note Stable application presentation; see PRESENTATION.md for scope and ownership. +global Ds ulong 8 +global Dt ulong 64 +global Dtext uchar 2304 +global Dsay ulong 1 +global Dm ulong 3 +global Dcode uchar 32768 +global Dstart ulong 4096 +global Dlen ulong 4096 +global Dline ulong 4096 +global Dview ulong 3 +global Din uchar 8192 +fn dscene to bool +n = get Inlen 0 +for i ulong 8192 +put Din i get In i +end +for i ulong get R 8 +put In i get Answer i +end +put Inlen 0 get R 8 +ok = scdecode +for i ulong 8192 +put In i get Din i +end +put Inlen 0 n +if not ok +ret false +end +for i ulong 8 +put Ds i get Sc i +end +for i ulong 64 +put Dt i get Things i +end +for i ulong 2304 +put Dtext i 0 +end +for i ulong get Sc 4 +put Dtext i get Stext i +end +put Dsay 0 get Sw 3 +put Dm 0 1 +ret true +end +fn dcode to bool +if or le get R 2 1 ne get R 1 0 +ret false +end +if or eq get R 6 0 ne get C 0 get R 0 +ret false +end +if not rows 80 4096 +ret false +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong get C 2 +put Dcode i get Code i +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong get View 0 +put Dstart i get Rowst i +put Dlen i get Rowlen i +put Dline i get Rowline i +end +put Dview 0 get View 0 +put Dview 1 0 +put Dview 2 get C 2 +put Dm 1 1 +ret true +end +fn dpresent to bool +if or eq get A 0 0 ne get A 2 1 +ret false +end +if or gt get R 8 159 gt get Inlen 0 8192 +ret false +end +shown = dscene +coded = dcode +if or shown coded +put Dm 2 get R 0 +ret true +end +ret false +end +fn dask now ulong to bool +if not appask now +ret false +end +b = dpresent +ret true +end +fn drecv now ulong to bool +if not appreceive now +ret false +end +b = dpresent +ret true +end +fn dreset to void +appreset +for i ulong 8 +put Ds i 0 +end +for i ulong 64 +put Dt i 0 +end +for i ulong 2304 +put Dtext i 0 +end +put Dsay 0 0 +for i ulong 3 +put Dm i 0 +put Dview i 0 +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong 8192 +put Din i 0 +end +end +note Declarative Allen glyph designs and integer sine samples, retained from +note native/kernel/ui/allen_font.c at4c7888f. No foreign executable implementation. +text Afdata "w6|w6 M3,0 L3,14 D3,20|w10 M3,0 L3,5 M7,0 L7,5|w15 M6,2 L4,20 M11,2 L9,20 M2,8 L13,8 M1,14 L12,14|w15 A8,5,5,5,-30,-270 A8,15,5,5,270,510 M8,-2 L8,22|w16 A4,4,2,3,0,360 A12,16,2,3,0,360 M13,1 L3,19|w16 M14,20 L5,9 A7,5,3,4,150,400 L3,14 A7,15,4,5,180,60 L13,11|w6 M3,0 L3,5|w9 A10,10,6,12,240,120|w9 A-1,10,6,12,-60,60|w14 M7,2 L7,10 M3,4 L11,8 M11,4 L3,8|w14 M2,12 L12,12 M7,7 L7,17|w6 M3,19 L2,23|w11 M2,13 L9,13|w6 D3,20|w12 M10,0 L2,20|w14 A7,10,5,10,0,360|w14 M3,4 L8,0 L8,20|w14 A7,6,5,6,200,400 L2,20 L12,20|w14 A7,5,5,5,200,450 A7,15,5,5,270,520|w14 M10,20 L10,0 L1,14 L13,14|w14 M12,0 L4,0 L4,9 A7,14,5,6,235,520|w14 A7,14,5,6,0,360 M10,0 L3,11|w14 M2,0 L12,0 L5,20|w14 A7,5,4,5,0,360 A7,15,5,5,0,360|w14 A7,6,5,6,0,360 M4,20 L11,9|w6 D3,8 D3,20|w6 D3,8 M3,19 L2,23|w14 M12,6 L2,12 L12,18|w14 M2,10 L12,10 M2,15 L12,15|w14 M2,6 L12,12 L2,18|w14 A7,5,5,5,190,450 L7,14 D7,20|w19 A9,12,3,4,0,360 M12,8 L12,14 A14,14,2,2,180,0 A9,11,7,9,0,-300|w16 M2,20 L8,0 L14,20 M4,13 L12,13|w15 M2,0 L2,20 M2,0 L8,0 A8,5,4,5,270,450 L2,10 M2,10 L9,10 A9,15,4,5,270,450 L2,20|w17 A9,10,7,10,45,315|w16 M2,0 L2,20 M2,0 L6,0 A6,10,8,10,270,450 L2,20|w14 M12,0 L2,0 L2,20 L12,20 M2,10 L10,10|w13 M12,0 L2,0 L2,20 M2,10 L10,10|w18 A9,10,7,10,-45,-360 M11,10 L16,10|w16 M2,0 L2,20 M14,0 L14,20 M2,10 L14,10|w6 M3,0 L3,20|w13 M10,0 L10,14 A6,14,4,6,0,180|w15 M2,0 L2,20 M13,0 L2,12 M6,8 L14,20|w13 M2,0 L2,20 L12,20|w20 M2,20 L2,0 L10,14 L18,0 L18,20|w16 M2,20 L2,0 L14,20 L14,0|w20 A10,10,8,10,0,360|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10|w20 A10,10,8,10,0,360 M12,14 L18,21|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10 M8,10 L14,20|w16 A8,5,5,5,-30,-270 A8,15,5,5,270,510|w16 M1,0 L15,0 M8,0 L8,20|w16 M2,0 L2,13 A8,13,6,7,180,0 L14,0|w16 M1,0 L8,20 L15,0|w22 M1,0 L6,20 L11,0 L16,20 L21,0|w16 M2,0 L14,20 M14,0 L2,20|w16 M1,0 L8,10 L15,0 M8,10 L8,20|w16 M2,0 L14,0 L2,20 L14,20|w9 M7,-1 L3,-1 L3,21 L7,21|w12 M2,0 L10,20|w9 M2,-1 L6,-1 L6,21 L2,21|w12 M2,8 L6,1 L10,8|w14 M1,23 L13,23|w7 M2,0 L4,4|w15 A7,14,5,6,0,360 M12,8 L12,20|w15 M2,0 L2,20 A7,14,5,6,0,360|w13 A7,14,5,6,40,320|w15 A7,14,5,6,0,360 M12,0 L12,20|w14 M2,14 L12,14 A7,14,5,6,0,-320|w11 M5,20 L5,4 A9,4,4,4,180,300 M2,8 L10,8|w15 A7,14,5,6,0,360 M12,8 L12,22 A7,22,5,5,0,150|w15 M2,0 L2,20 A7,13,5,5,180,360 L12,20|w6 M3,8 L3,20 D3,3|w7 M4,8 L4,22 A0,22,4,5,0,120 D4,3|w13 M2,0 L2,20 M11,8 L2,15 M5,13 L12,20|w6 M3,0 L3,20|w21 M2,8 L2,20 A6,12,4,4,180,360 L10,20 A14,12,4,4,180,360 L18,20|w15 M2,8 L2,20 A7,13,5,5,180,360 L12,20|w14 A7,14,5,6,0,360|w15 M2,8 L2,27 A7,14,5,6,0,360|w15 A7,14,5,6,0,360 M12,8 L12,27|w10 M2,8 L2,20 A7,13,5,5,180,290|w14 A7,11,4,3,-30,-270 A7,17,4,3,270,510|w11 M5,2 L5,17 A8,17,3,3,180,40 M2,8 L10,8|w15 M2,8 L2,15 A7,15,5,5,180,0 M12,8 L12,20|w14 M2,8 L7,20 L12,8|w20 M2,8 L6,20 L10,8 L14,20 L18,8|w14 M2,8 L12,20 M12,8 L2,20|w14 M2,8 L7,20 M12,8 L4,27|w14 M2,8 L12,8 L2,20 L12,20|w10 M8,-1 L6,0 L6,8 L4,10 L6,12 L6,20 L8,21|w6 M3,-1 L3,23|w10 M2,-1 L4,0 L4,8 L6,10 L4,12 L4,20 L2,21|w14 M2,13 L5,11 L9,14 L12,12|" +text Afsines "0 286 572 857 1143 1428 1713 1997 2280 2563 2845 3126 3406 3686 3964 4240 4516 4790 5063 5334 5604 5872 6138 6402 6664 6924 7182 7438 7692 7943 8192 8438 8682 8923 9162 9397 9630 9860 10087 10311 10531 10749 10963 11174 11381 11585 11786 11982 12176 12365 12551 12733 12911 13085 13255 13421 13583 13741 13894 14044 14189 14330 14466 14598 14726 14849 14968 15082 15191 15296 15396 15491 15582 15668 15749 15826 15897 15964 16026 16083 16135 16182 16225 16262 16294 16322 16344 16362 16374 16382 16384 " +note Handwritten bounded Allen stroke rasterizer. Legacy C is an external oracle only. +global Af ulong 6 +global Ab long 4 +global Ag long 640 +global Alpha uchar 65536 +global Asin long 91 +global Afpos ulong 2 +global Apen long 2 +global Arc long 6 +fn afsqrt value ulong to ulong +r = ulong 0 +bit = shl ulong 1 62 +while gt bit value +bit = shr bit 2 +end +while ne bit 0 +if ge value add r bit +value = sub value add r bit +r = add shr r 1 bit +else +r = shr r 1 +end +bit = shr bit 2 +end +ret r +end +fn afsin deg long to long +a = rem deg 360 +if lt a 0 +a = add a 360 +end +if le a 90 +ret get Asin ulong a +end +if le a 180 +ret get Asin ulong sub long 180 a +end +if le a 270 +ret neg get Asin ulong sub a 180 +end +ret neg get Asin ulong sub long 360 a +end +fn afcos deg long to long +ret afsin add rem deg 360 90 +end +fn afinit cap ulong wt ulong to bool +if or eq cap 0 gt cap 64 +ret false +end +if or eq wt 0 gt wt 2500 +ret false +end +for i ulong 6 +put Af i 0 +end +put Af 0 div mul cap 256 20 +put Af 1 div mul wt get Af 0 1000 +v = long 0 +slot = ulong 0 +for i ulong len Afsines +c = get Afsines i +if eq c 32 +put Asin slot v +slot = add slot 1 +v = 0 +else +v = add mul v 10 sub long c 48 +end +end +ret eq slot 91 +end +fn afpick c uchar to bool +if or lt c 32 gt c 126 +c = 63 +end +wanted = sub ulong c 32 +slot = ulong 0 +startat = ulong 0 +for i ulong len Afdata +if eq get Afdata i 124 +if eq slot wanted +put Afpos 0 startat +put Afpos 1 i +ret true +end +slot = add slot 1 +startat = add i 1 +end +end +ret false +end +fn afnum to long +p = get Afpos 0 +minus = false +if eq get Afdata p 45 +minus = true +p = add p 1 +end +v = long 0 +go = true +while and lt p get Afpos 1 go +c = get Afdata p +if and ge c 48 le c 57 +v = add mul v 10 sub long c 48 +p = add p 1 +else +go = false +end +end +if lt p get Afpos 1 +if eq get Afdata p 44 +p = add p 1 +end +end +put Afpos 0 p +if minus +ret neg v +end +ret v +end +fn afseg nx long ny long to bool +n = get Af 2 +if ge n 160 +ret false +end +at = mul n 4 +put Ag at get Apen 0 +put Ag add at 1 get Apen 1 +put Ag add at 2 nx +put Ag add at 3 ny +put Apen 0 nx +put Apen 1 ny +put Af 2 add n 1 +ret true +end +fn afpoint a long first bool to bool +s = long get Af 0 +x = mul get Arc 0 s +x = add x div mul mul get Arc 2 s afcos a 16384 +y = mul sub get Arc 1 20 s +y = add y div mul mul get Arc 3 s afsin a 16384 +if first +put Apen 0 x +put Apen 1 y +ret true +end +ret afseg x y +end +fn afarc to bool +for i ulong 6 +put Arc i afnum +end +span = sub get Arc 5 get Arc 4 +if lt span 0 +span = neg span +end +steps = div span 9 +if lt steps 2 +steps = 2 +end +for k ulong ulong add steps 1 +a = sub get Arc 5 get Arc 4 +a = add get Arc 4 div mul a long k steps +if not afpoint a eq k 0 +ret false +end +end +ret true +end +fn afcmd cmd uchar to bool +if eq cmd 32 +ret true +end +if eq cmd 119 +put Af 5 mul ulong afnum get Af 0 +ret true +end +if eq cmd 65 +ret afarc +end +x = mul afnum long get Af 0 +y = mul sub afnum 20 long get Af 0 +if or eq cmd 77 eq cmd 68 +put Apen 0 x +put Apen 1 y +end +if eq cmd 77 +ret true +end +if or eq cmd 76 eq cmd 68 +ret afseg x y +end +ret false +end +fn affloor value long to long +if ge value 0 +ret div value 256 +end +ret neg div add neg value 255 256 +end +fn afbound x long y long to void +if lt x get Ab 0 +put Ab 0 x +end +if lt y get Ab 1 +put Ab 1 y +end +if gt x get Ab 2 +put Ab 2 x +end +if gt y get Ab 3 +put Ab 3 y +end +end +fn afbox to bool +put Ab 0 get Ag 0 +put Ab 2 get Ag 0 +put Ab 1 get Ag 1 +put Ab 3 get Ag 1 +for i ulong get Af 2 +at = mul i 4 +afbound get Ag at get Ag add at 1 +afbound get Ag add at 2 get Ag add at 3 +end +pad = add long get Af 1 256 +x0 = affloor sub get Ab 0 pad +y0 = affloor sub get Ab 1 pad +x1 = add affloor add get Ab 2 pad 1 +y1 = add affloor add get Ab 3 pad 1 +put Ab 0 x0 +put Ab 1 y0 +put Af 3 ulong sub x1 x0 +put Af 4 ulong sub y1 y0 +ret le mul get Af 3 get Af 4 len Alpha +end +fn afproj qx long qy long dx long dy long to ulong +len2 = add mul dx dx mul dy dy +ex = qx +ey = qy +if ne len2 0 +t = add mul qx dx mul qy dy +if gt t 0 +if ge t len2 +ex = sub qx dx +ey = sub qy dy +else +ex = sub qx div mul dx t len2 +ey = sub qy div mul dy t len2 +end +end +end +ret ulong add mul ex ex mul ey ey +end +fn afdist slot ulong px long py long to ulong +at = mul slot 4 +dx = sub get Ag add at 2 get Ag at +dy = sub get Ag add at 3 get Ag add at 1 +qx = sub px get Ag at +qy = sub py get Ag add at 1 +ret afproj qx qy dx dy +end +fn afalpha px long py long to uchar +best = ulong 18446744073709551615 +for i ulong get Af 2 +d2 = afdist i px py +if lt d2 best +best = d2 +end +end +d = long afsqrt best +cov = sub add long get Af 1 128 d +if le cov 0 +ret 0 +end +if ge cov 256 +ret 255 +end +ret uchar div mul cov 255 256 +end +fn afrow y ulong to void +py = add mul add get Ab 1 long y 256 128 +for x ulong get Af 3 +px = add mul add get Ab 0 long x 256 128 +at = add mul y get Af 3 x +put Alpha at afalpha px py +end +end +fn afpaint to void +for y ulong get Af 4 +afrow y +end +end +fn afglyph c uchar to bool +if eq get Af 0 0 +ret false +end +if not afpick c +ret false +end +for i ulong 65536 +put Alpha i 0 +end +put Af 2 0 +put Af 3 0 +put Af 4 1 +put Af 5 0 +put Ab 0 0 +put Ab 1 0 +put Apen 0 0 +put Apen 1 0 +while lt get Afpos 0 get Afpos 1 +cmd = get Afdata get Afpos 0 +put Afpos 0 add get Afpos 0 1 +if not afcmd cmd +ret false +end +end +if eq get Af 2 0 +ret true +end +if not afbox +ret false +end +afpaint +ret true +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +text Fmagic "ALNPRV01" +text Hi "hi" +text Leak "LEAK" +text Reply "SAY 1 1/1 hello" +text Askcode "write a calculator" +text Tinycode "CODE 2 1/1 2 d8932aac text hi" +text Done "SAY 2 1/1 Done." +global Held uchar 8192 +global Holdn ulong 2 +global Before uchar 8192 +fn test ok bool to void +note Direct write logger would clobber the very datagram being tested. +put Holdn 0 get Outlen 0 +put Holdn 1 get Err 0 +for i ulong get Outlen 0 +put Held i get Outb i +end +check ok add get Checks 0 1 +for i ulong get Holdn 0 +put Outb i get Held i +end +put Outlen 0 get Holdn 0 +put Err 0 get Holdn 1 +end +fn hword off ulong v ulong to void +for i ulong 8 +put Ph add off i uchar and shr v mul i 8 255 +end +end +fn frame op ulong now ulong arg ulong size ulong to void +for i ulong 8 +put Ph i get Fmagic i +end +hword 8 op +hword 16 now +hword 24 arg +hword 32 size +end +fn oword off ulong to ulong +v = ulong 0 +for i ulong 8 +v = or v shl ulong get Pout add off i mul i 8 +end +ret v +end +fn receive part ulong size ulong to void +note Caller placed LINE payload in In; packet overwrites Outb, so preserve it. +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Held i get Outb i +end +put Inlen 0 size +b = packet 2 get Q 1 part 0 0 +size = get Outlen 0 +for i ulong size +put Pb i get Outb i +end +for i ulong n +put Outb i get Held i +end +put Outlen 0 n +put Err 0 e +frame 5 4294967297 0 size +end +fn main to int +frame 1 4294967296 77 0 +test prparse +test eq get Pv 0 1 +test eq get Pv 1 4294967296 +test eq get Pv 2 77 +put Ph 0 88 +test not prparse +frame 11 0 0 0 +test not prparse +frame 1 0 77 1 +test not prparse +frame 3 0 2 0 +test not prparse +frame 2 0 0 160 +test not prparse +frame 10 0 0 0 +test prdo +test eq oword 16 1 +test eq get Pc 0 1 +mset32 0 3 +mset32 36 1 +test memenc 10 +for i ulong 4096 +put Pb i get Enc i +end +frame 8 0 1 4096 +test prdo +test eq oword 16 1 +test eq get St 0 10 +test prdo +test eq oword 16 0 +frame 1 4294967296 77 0 +test prdo +test eq oword 16 0 +for i ulong 4096 +put Pb i 0 +end +frame 8 0 0 4096 +test prdo +test eq oword 16 2 +test eq get Pc 0 2 +test eq get St 0 10 +frame 1 4294967296 77 0 +test prdo +test eq oword 16 0 +put Ns 0 2 +put Ns 1 0 +put Ns 2 3 +put Ns 3 0 +put Note 0 78 +put Note 1 48 +test noteenc +for i ulong 4096 +put Pb i get Enc i +end +frame 9 0 1 4096 +test prdo +test eq oword 16 0 +frame 9 0 0 4096 +test prdo +test eq oword 16 1 +test eq get Pc 0 3 +frame 1 4294967296 77 0 +test prdo +test eq oword 16 1 +test eq get A 0 1 +test eq get Dm 0 0 +test eq get Dm 1 0 +test prdo +test eq oword 16 0 +frame 10 0 0 0 +test prdo +test eq oword 16 0 +test eq mem32 0 3 +frame 2 4294967297 0 len Hi +for i ulong len Hi +put Pb i get Hi i +end +test prdo +test eq oword 16 1 +test eq get R 0 1 +test eq get Dm 0 0 +frame 3 4294967297 1 0 +test prdo +test eq oword 16 3 +test eq oword 32 get Outlen 0 +test eq get T 10 5 +same = true +for i ulong get Outlen 0 +if ne get Pout add i 40 get Outb i +same = false +end +end +test same +test prdo +test eq oword 16 1 +test eq get T 10 5 +frame 4 4294967297 0 0 +test prdo +test eq get T 3 0 +frame 3 4294967297 1 0 +test prdo +test eq oword 16 3 +frame 4 4294967297 1 0 +test prdo +test eq get T 3 1 +frame 3 4294967297 1 0 +test prdo +test eq get T 10 1 +for i ulong len Reply +put In i get Reply i +end +receive 1 len Reply +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Before i get Outb i +end +test prdo +test eq get Outlen 0 n +test eq get Err 0 e +same = true +for i ulong n +if ne get Outb i get Before i +same = false +end +end +test same +test eq oword 16 1 +test eq oword 24 1 +test eq oword 32 5 +test eq get Pout 40 104 +test eq get Dm 0 1 +test eq get Dm 2 1 +test eq get Ds 2 1 +test eq get Dtext get Dsay 0 104 +test eq get R 1 0 +test eq get T 10 1 +test eq get Outb 0 65 +note A stale visible event must not be projected by a rejected provider frame. +for i ulong len Leak +put Answer i get Leak i +end +put R 8 len Leak +frame 5 4294967297 0 65 +put Ph 0 88 +test not prdo +test eq get Dtext get Dsay 0 104 +frame 5 4294967297 0 65 +for i ulong 65 +put Pb i 0 +end +test prdo +test eq oword 16 0 +test eq get Dtext get Dsay 0 104 +test eq get Dm 2 1 +frame 4 4294967297 1 0 +test prdo +frame 3 4294967297 1 0 +test prdo +test eq oword 16 3 +test eq get T 10 3 +frame 4 4294967297 1 0 +test prdo +frame 3 4294967297 1 0 +test prdo +test eq oword 16 1 +test eq oword 32 0 +frame 2 4294967297 0 len Askcode +for i ulong len Askcode +put Pb i get Askcode i +end +test prdo +test eq oword 24 1 +test eq oword 32 len Ack +test eq get Dm 0 1 +test eq get Dm 2 2 +test eq get Dtext get Dsay 0 73 +for i ulong len Tinycode +put In i get Tinycode i +end +receive 1 len Tinycode +test prdo +test eq oword 24 0 +test eq get Dm 1 0 +frame 3 4294967297 1 0 +test prdo +frame 4 4294967297 1 0 +test prdo +for i ulong len Done +put In i get Done i +end +receive 2 len Done +test prdo +test eq oword 24 1 +test eq oword 32 5 +off = ulong 45 +test eq oword add off 8 11 +test eq oword add off 32 2 +test eq get Pout add off 40 104 +test eq get Pout add off 41 105 +test eq get Pn 0 add off 42 +test eq get Dm 1 1 +test eq get Dm 2 2 +test eq get Dview 0 1 +test eq get Dview 2 2 +test eq get Dlen 0 2 +test eq get Dcode 0 104 +test eq get Dcode 1 105 +test eq get Dtext get Dsay 0 68 +note Snapshot stays independent of later assembly and refused clock. +put Code 0 88 +test eq get Dcode 0 104 +frame 3 4294967296 1 0 +test prdo +test eq oword 16 0 +test eq oword 24 0 +test eq get Dcode 0 104 +test eq get Dtext get Dsay 0 68 +put Dtext 2303 88 +put Dcode 32767 88 +put Dlen 4095 88 +frame 7 0 0 0 +test prdo +test eq get Dm 0 0 +test eq get Dm 1 0 +test eq get Dm 2 0 +test eq get Dview 0 0 +test eq get Dview 2 0 +test eq get Dtext 2303 0 +test eq get Dcode 32767 0 +test eq get Dlen 4095 0 +test eq get R 9 0 +test eq get R 0 2 +test eq get Q 1 2 +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L763/reply.log b/evidence/allen-omega-L694/L763/reply.log new file mode 100644 index 00000000..d11a72ad --- /dev/null +++ b/evidence/allen-omega-L694/L763/reply.log @@ -0,0 +1,15 @@ +801 0 +802 0 +803 0 +804 0 +805 0 +806 0 +807 0 +808 0 +809 0 +810 0 +811 0 +812 0 +813 0 +814 0 +815 0 diff --git a/evidence/allen-omega-L694/L763/runtime.log b/evidence/allen-omega-L694/L763/runtime.log new file mode 100644 index 00000000..5168e6f3 --- /dev/null +++ b/evidence/allen-omega-L694/L763/runtime.log @@ -0,0 +1,28 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 diff --git a/evidence/allen-omega-L694/L763/scene-input.log b/evidence/allen-omega-L694/L763/scene-input.log new file mode 100644 index 00000000..edd8e122 --- /dev/null +++ b/evidence/allen-omega-L694/L763/scene-input.log @@ -0,0 +1,63 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 diff --git a/evidence/allen-omega-L694/L763/scene.log b/evidence/allen-omega-L694/L763/scene.log new file mode 100644 index 00000000..44a4b2b1 --- /dev/null +++ b/evidence/allen-omega-L694/L763/scene.log @@ -0,0 +1,14 @@ +1001 0 +1002 0 +1003 0 +1004 0 +1005 0 +1006 0 +1007 0 +1008 0 +1009 0 +1010 0 +1011 0 +1012 0 +1013 0 +1014 0 diff --git a/evidence/allen-omega-L694/L763/scenecap-mutant.log b/evidence/allen-omega-L694/L763/scenecap-mutant.log new file mode 100644 index 00000000..502843ec --- /dev/null +++ b/evidence/allen-omega-L694/L763/scenecap-mutant.log @@ -0,0 +1,63 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 1 +60 0 +61 0 +62 1 +63 1 diff --git a/evidence/allen-omega-L694/L763/scheduler.log b/evidence/allen-omega-L694/L763/scheduler.log new file mode 100644 index 00000000..1d8ffd12 --- /dev/null +++ b/evidence/allen-omega-L694/L763/scheduler.log @@ -0,0 +1,213 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 +183 0 +184 0 +185 0 +186 0 +187 0 +188 0 +189 0 +190 0 +191 0 +192 0 +193 0 +194 0 +195 0 +196 0 +197 0 +198 0 +199 0 +200 0 +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 diff --git a/evidence/allen-omega-L694/L763/session-mutant.log b/evidence/allen-omega-L694/L763/session-mutant.log new file mode 100644 index 00000000..9ce7ef78 --- /dev/null +++ b/evidence/allen-omega-L694/L763/session-mutant.log @@ -0,0 +1,24 @@ +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 1 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 diff --git a/evidence/allen-omega-L694/L763/short.log b/evidence/allen-omega-L694/L763/short.log new file mode 100644 index 00000000..a9da2dc8 --- /dev/null +++ b/evidence/allen-omega-L694/L763/short.log @@ -0,0 +1,20 @@ +401 0 +410 0 +411 0 +412 0 +413 0 +414 0 +402 0 +403 0 +404 0 +405 0 +406 0 +700 0 +701 0 +702 0 +703 0 +704 0 +705 0 +407 0 +408 0 +409 0 diff --git a/evidence/allen-omega-L694/L763/source.sha256 b/evidence/allen-omega-L694/L763/source.sha256 new file mode 100644 index 00000000..1ed394ce --- /dev/null +++ b/evidence/allen-omega-L694/L763/source.sha256 @@ -0,0 +1,63 @@ +56936108de0087499bb62a117a275f27b01d7bfb05eb8f6250f13ab8783e1095 native/omega/allen/application.om +184f4270c72c4eca6a7afdd28b70a608f2e237980b12c8a7bfc2c7d2c3e625b9 native/omega/allen/base.om +795ca28627a19f1088de0f23277e79cdac921ff88451c606c7b655ce0f2e8a5b native/omega/allen/build-one.sh +4d2235ac5d6b237695b1c3112f70ebdfa0cebafa2ec8e691e4be4de37a62199b native/omega/allen/code.om +75e86e193346a5548e596c84fa7d65aaeefd69f9979a648e0bf53f0f97cd9eb4 native/omega/allen/context.om +76ee9cdeaac036905c76dfa29f42bf5a78d1259ad1656adfaa24916c3b93550d native/omega/allen/courier.om +f8c559b449c81159172d3e08f185e1fcd9ac446ab594420d07221ca68ffa87d5 native/omega/allen/font-data.om +79e5c778e31f9753553ade367c7de2a5a2521bef7247672cab7498f3ba32d9e6 native/omega/allen/FONT.md +c62f5a799b601315e61b05283295810a084d1adcc06b5bddc34010f3b344b915 native/omega/allen/font.om +58afa9d254f16e3840857001d804c68b7e29b528ef562f1c8bf0341861b425df native/omega/allen/gate.sh +9d71a653870eeef678f95df04db9c38aedaadd06e7c74bf3e5d9fde6e28f82f8 native/omega/allen/golden.sh +06087bc573ebb876a0ed80f6025c592fb4b1d23335169c3da402824fd1482c35 native/omega/allen/intent.om +4bc37c95d553364c5d2925d8ff9e8a53b1a61974513e6f492f77b7ebb05bbda4 native/omega/allen/main.om +068292abd04d3a61b063fc5380b22a56c4235a87915c219ebf3b37d16d7bc9c7 native/omega/allen/memory.om +b4d7b6e6cd680d2ba1eec2978b0cbb81ffc63035b73f5c3726bdad97a7b6aa04 native/omega/allen/paint.om +6afdb75311c0fbc5293034ac3ba315c231439c694750f6d8c3a1996cd34abff3 native/omega/allen/PRESENTATION.md +d3e3004fb587f75514c638b8b723c996303f664a74b653a6fc674f4600288d41 native/omega/allen/presentation.om +c8a04b1d5f95c36500e7b2f475e169148c6ac76a677b1ca3da38f217fe2a501e native/omega/allen/provider-core.om +f96b8b9074b4802b1cb52545db7ced1b5a64bf75ad756d532a8fc4e16c7107cd native/omega/allen/PROVIDER.md +ef0d5dcc14b68bf4ee24468db703fd7dc98ffd982e045c719d42a78e442546ba native/omega/allen/provider.om +259c4a50465c0932955e86f5d5c0fbf6c1f863097ea499a91aa583fa01eaf003 native/omega/allen/README.md +e50a7f673aaee92aba4a3aec303aa93b071121c09ad05d4ad1dcc2deb9706dcc native/omega/allen/reply.om +5b01eae03204d08f6d207ef29f2ba09a1d9f249f1738f68f151214675a4ff2ed native/omega/allen/runtime.om +c16d61dbcb81f7ef8196c937929a53e47de3de0015e5d663bcd8e49b3cb05002 native/omega/allen/scene-input.om +c8d4a437b41538cc1eeb62a2029c6993d41e5ef90cc7b26c8e1c92bc98ec57d3 native/omega/allen/scene.om +615dff78462a715153b3d891b2cfe146c318d3a0a26ae1aaa642484f965c12df native/omega/allen/scheduler.om +f4e6bb5571a0700febdecfc6209ae1c088eab50a82bce4d8a10179408e3abb5f native/omega/allen/tests/application.om +f085198549d1c235a97574ff6f6560ce82217611f4051fc3dbbc8286aab6d536 native/omega/allen/tests/check.om +b76438a85257bd95768115047be286c107e3723628a16a0541870732d0849a42 native/omega/allen/tests/code.om +c61bb0ca8f70114e6fd180e9f9a48ec4d2f927152269c11bfc9df55dc13bc1bc native/omega/allen/tests/context.om +98105e1c30626f54da07940fe0415637730b7e112ea39ba2aae1f2d648993373 native/omega/allen/tests/courier.om +f524aab74657dc2e9e4330bf42bc05ef01ce3e8f08a05c80371be0c0a33764d3 native/omega/allen/tests/edges.om +a2e8bcde92d522216a4fa99559dd3bcba096aea86127364587dadcc2bfb585af native/omega/allen/tests/fixture.om +9c293d9f46e8815d96701ef9084deb34c24269d65677682a7be731e589e260bc native/omega/allen/tests/font-mutants.om +cf836ead7ced76a528bd2df1738a2255d9b37b4ab51702d593488bc94726f75a native/omega/allen/tests/font.om +7ef1280488f17ac3001876ca8f1d9a48e202f8fb3305d974e6cd33166458f8eb native/omega/allen/tests/font-output.om +a3e64c2054a9c83daacc8bd86ce5df0395014eb0ac2e237e63ade12dfb1a6bd8 native/omega/allen/tests/font-render.om +c9ef2bee7cbd1c072c6045d62c55f3bdd938901e91792cee72ea57fb8f25a198 native/omega/allen/tests/golden.om +8ba742d85ea510586f3cf86661bc0f28c5d99b59981c2d3fb220705efad24564 native/omega/allen/tests/intent.om +861d9af698b021056cceb6c00ae3458558db415963fe832d3fca7da55731cf7b native/omega/allen/tests/memory.om +13e4db7436165783c6aad48497ffe89fa6e5ba3de928e66a766c29e1e817fcf5 native/omega/allen/tests/paint.om +a36e1168fb5b19f5d1b444c6e0d171a6b55a0ffd7e1920438304afd0415d09ba native/omega/allen/tests/presentation-mutants.om +b051af93057752c3d361e1aa5a4dc31bd0853e09d2d2a213d82a282f5709f641 native/omega/allen/tests/presentation.om +e6d232d92d74d88423cebbbbfc6e403ea9b865b80c909e1d23087001d905035a native/omega/allen/tests/probe.om +ebc300f5c8737543acec6397bf7a82000594e13c424df20e203ea7ab09da46c4 native/omega/allen/tests/provider-core.om +0c611ef5d6fe9c5d951fa8886e6425a4cb538c308d99f2723634f253d755cbbb native/omega/allen/tests/provider-display-mutants.om +b98923bd7df278ed0cd8a46c90d90fda296e27c8d60afdd4848ed86dba8221cc native/omega/allen/tests/provider-input.om +37480ca89922dea787a7acb72835a0109b3549461791e7499789ed25932b397c native/omega/allen/tests/provider-mutants.om +d1b1338b2cabe207c1cd9a4bd92b11f51502c29af4b754e2b39fac06d80b28ed native/omega/allen/tests/provider-output.om +8616252944ac2f2903427a6cbf165137087addf3eff169f05f6801d38dac0962 native/omega/allen/tests/provider-process.om +8fbc8a0517900efd771a994686356416a0fea5e20cfd9bc26c787850398113df native/omega/allen/tests/render.om +094a5e833bae7dfd3b013e3f015f143e9d7bd3efe9b9c896a7f58b09e1ec14b8 native/omega/allen/tests/reply.om +bab9b0e853aa4b62918353a5d1625a3171deebfb639e599fe9751b5a61a3df62 native/omega/allen/tests/runtime.om +c5847b4ea0c7df81691fadf9af2f258ad02d3fa588a400448f6d34d7819570b4 native/omega/allen/tests/scene-input.om +b9c84d9a58658589137764fe60209d8320550dd8ed99fa6026df65ba48737e4f native/omega/allen/tests/scene.om +bf984fa9cf63ddb569147afc2a028ccdafdbeae2067125cf35d658e5d00f4c94 native/omega/allen/tests/scheduler.om +521fff50f312b64801017b1349d9a31dac6eac50eb989d93d2dbac4e100f5007 native/omega/allen/tests/stdio-overflow.om +89aee5326b428147ea6da9aa739b6679e214ed114ae5f41d3b70299cf864092c native/omega/allen/tests/view.om +0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0 native/omega/allen/vendor/OMEGA-LICENSE +b234738e8ce81b3d67586deb41fdaab4543169d4b69e86fd3dc28a08432ab5fc native/omega/allen/vendor/PROVENANCE.md +992ec4a4957271b442740598136887a5c610effcd8ae9fb9480a006a4f181097 native/omega/allen/vendor/sha256-core.om +0781cdcec18570a57afbe3be4a6717dd2d1fa4c887b49a3e4cb542b594f8a041 native/omega/allen/vendor/sha256.om +abbefd2f7dc48f2ac28b9526f5c2e5b369da4b7c5e84dde6e6a3cd20bd5687ac native/omega/allen/view.om diff --git a/evidence/allen-omega-L694/L763/stale-mutant.log b/evidence/allen-omega-L694/L763/stale-mutant.log new file mode 100644 index 00000000..ac2e3d09 --- /dev/null +++ b/evidence/allen-omega-L694/L763/stale-mutant.log @@ -0,0 +1,28 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 1 +7 1 +8 1 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 diff --git a/evidence/allen-omega-L694/L763/staleview-mutant.log b/evidence/allen-omega-L694/L763/staleview-mutant.log new file mode 100644 index 00000000..c0c96c65 --- /dev/null +++ b/evidence/allen-omega-L694/L763/staleview-mutant.log @@ -0,0 +1,75 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 1 +35 1 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 diff --git a/evidence/allen-omega-L694/L763/summary.json b/evidence/allen-omega-L694/L763/summary.json new file mode 100644 index 00000000..f9070ac8 --- /dev/null +++ b/evidence/allen-omega-L694/L763/summary.json @@ -0,0 +1,68 @@ +{ + "base": "61ef587ee5d24bf862705f51bffb8039c9a2ed01", + "checks": { + "runtime": 28, + "code": 23, + "courier": 24, + "scheduler": 213, + "application": 182, + "provider-core": 136, + "memory": 79, + "context": 142, + "intent": 8, + "reply": 15, + "view": 13, + "scene": 14, + "scene-input": 63, + "paint": 11, + "edges": 352, + "short": 20, + "long": 292, + "provider-stream": 292, + "provider-fragment": 292, + "provider-process": 3, + "provider-consumer": 3, + "provider-producer": 3, + "provider-bad-1": 5, + "provider-bad-2": 5, + "provider-bad-3": 5, + "provider-bad-4": 5, + "provider-bad-5": 5, + "provider-bad-6": 17, + "presentation": 75, + "font": 421 + }, + "total_checks": 2746, + "compiled_rejected_mutants": { + "inputtail-mutant": 1, + "session-mutant": 1, + "appcode-mutant": 3, + "contextjob-mutant": 36, + "readback-mutant": 7, + "staleview-mutant": 2, + "fontroot-mutant": 11, + "fontalpha-mutant": 2, + "hash-mutant": 2, + "contextnote-mutant": 5, + "autosent-mutant": 8, + "thinking-mutant": 6, + "pendingwire-mutant": 1, + "scenecap-mutant": 3, + "crc-mutant": 2, + "ackstop-mutant": 27, + "stale-mutant": 3, + "rawrecv-mutant": 17, + "rawreset-mutant": 8, + "framecheck-mutant": 4, + "rawask-mutant": 2, + "keepalive-mutant": 40 + }, + "red_checks": 136, + "red_failures": 24, + "focused_green": 136, + "wire_output_unchanged": true, + "provider_output_sha256": "94a3fc4b05bef182b4d33e6adf875bf638f89b01315ea1081da0cbdb950a6ac0", + "provider_elf_sha256": "4021dd66d7ec338426210bf2f0d139c1225e3cc2e3207fbfd4b0e1bbba9fa8ca", + "compiler_sha256": "191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9", + "scope": "Provider dispatch attached to retained presentation; no pixel/device/live/iMac qualification." +} diff --git a/evidence/allen-omega-L694/L763/thinking-mutant.log b/evidence/allen-omega-L694/L763/thinking-mutant.log new file mode 100644 index 00000000..74b41a12 --- /dev/null +++ b/evidence/allen-omega-L694/L763/thinking-mutant.log @@ -0,0 +1,63 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 1 +15 1 +16 0 +17 0 +18 0 +19 1 +20 1 +21 1 +22 1 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 diff --git a/evidence/allen-omega-L694/L763/view.log b/evidence/allen-omega-L694/L763/view.log new file mode 100644 index 00000000..8b194f11 --- /dev/null +++ b/evidence/allen-omega-L694/L763/view.log @@ -0,0 +1,13 @@ +901 0 +902 0 +903 0 +904 0 +905 0 +906 0 +907 0 +908 0 +909 0 +910 0 +911 0 +912 0 +913 0 diff --git a/evidence/allen-omega-L694/L765/README.md b/evidence/allen-omega-L694/L765/README.md new file mode 100644 index 00000000..5044f7e0 --- /dev/null +++ b/evidence/allen-omega-L694/L765/README.md @@ -0,0 +1,25 @@ +# L765 clipped native text surface + +The native surface renders retained text using the qualified Omega stroke font. +The actual image follows provider BOOT/ASK/RECV -> retained note -> RGB pixels. +It is a test reply, not live inference or a completed hosted application. The +inspected PNG is a lossless conversion of the actual native P6 output; final +full-gate pixels match the inspected specimen. Font specimen pixels and provider +wire bytes are unchanged after sharing surface storage with the old fixture. + +Reproduce: `quiet-build native/omega/allen/gate.sh /absolute/fresh/output`. +Counts and actual compiled-mutant failures are in summary.json. Native tests +exercise blending, clipping, negative origins, fractional pen advance, maximum +span, refusal preservation and input/wire isolation. New mutation logic is Omega. + +Initial stub compilation failed because parameter start collided with runtime's +start function (error10 atline4162). Retained red.om is that construction failure, +not behavioralRED. Renaming only that parameter to beg yielded79 assertions, +43 failures,exit1. Expanded stub85 assertions/46 failures and final native85/85 +are retained. No assertion was weakened; no compiler implementation was changed. + +The public-alpha direction is native/omega/allen/ALPHA.md: sovereign local compute, +optional user cloud or keyed Spark, free temporary hosted trial without boot, +partition or driver modification. The current fixture neither installs an app +nor touches devices. Target/hosted packaging and live inference remain unqualified. +Independent surface review remains pending. diff --git a/evidence/allen-omega-L694/L765/ackstop-mutant.log b/evidence/allen-omega-L694/L765/ackstop-mutant.log new file mode 100644 index 00000000..5d0598cb --- /dev/null +++ b/evidence/allen-omega-L694/L765/ackstop-mutant.log @@ -0,0 +1,213 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 1 +65 1 +66 0 +67 0 +68 0 +69 1 +70 1 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 1 +165 0 +166 0 +167 0 +168 0 +169 1 +170 0 +171 1 +172 1 +173 0 +174 1 +175 0 +176 0 +177 0 +178 1 +179 0 +180 1 +181 0 +182 1 +183 0 +184 1 +185 0 +186 1 +187 0 +188 1 +189 0 +190 1 +191 0 +192 1 +193 0 +194 1 +195 1 +196 1 +197 1 +198 0 +199 1 +200 0 +201 0 +202 1 +203 1 +204 1 +205 0 +206 1 +207 1 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 diff --git a/evidence/allen-omega-L694/L765/appcode-mutant.log b/evidence/allen-omega-L694/L765/appcode-mutant.log new file mode 100644 index 00000000..c9c50601 --- /dev/null +++ b/evidence/allen-omega-L694/L765/appcode-mutant.log @@ -0,0 +1,182 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 1 +76 1 +77 1 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 diff --git a/evidence/allen-omega-L694/L765/application.log b/evidence/allen-omega-L694/L765/application.log new file mode 100644 index 00000000..2e8a428d --- /dev/null +++ b/evidence/allen-omega-L694/L765/application.log @@ -0,0 +1,182 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 diff --git a/evidence/allen-omega-L694/L765/autosent-mutant.log b/evidence/allen-omega-L694/L765/autosent-mutant.log new file mode 100644 index 00000000..6b9b9f3a --- /dev/null +++ b/evidence/allen-omega-L694/L765/autosent-mutant.log @@ -0,0 +1,136 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 1 +51 0 +52 0 +53 1 +54 1 +55 0 +56 1 +57 0 +58 1 +59 0 +60 0 +61 0 +62 1 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 1 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 1 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 diff --git a/evidence/allen-omega-L694/L765/binaries.sha256 b/evidence/allen-omega-L694/L765/binaries.sha256 new file mode 100644 index 00000000..7dbbebab --- /dev/null +++ b/evidence/allen-omega-L694/L765/binaries.sha256 @@ -0,0 +1,59 @@ +1ec8ee3cae7f12c5bc6c70e7db8620b5c0e35a995badd6ed5127dfcd2bcd1a34 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/provider-display-mutants +b2b1d530dcd471e22b624ee3e618e17c579f37a9d8536538159eb3df3265f7e6 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/provider-core +5df3376637df46283bfad517a35e158a2db9b404a0e18c940069f743a0fd736d /home/drakestapleton/handoffs/allen-omega-L694/L765/full/scheduler +a0043555cf79c2ecd4d308f778000e4d4c3ada6c4283184ca68911c59a6c4515 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/readback-mutant +0680ae9828d4c569c483f96a2a093e2e9d4f2f694c99f7207f2d6653111b52c6 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/font-render +ef3294fd665e72167192dc07c3c4184f130dd0d9cf56bd8922eee141793cddc1 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/view +7a8d6f74e73ab8a10a07b8d7b418bd784c51e02a6bde07c981910436dbbe28b5 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/contextnote-mutant +db8eb2ea2815fbb84323126cc3755eaa547517b5726aec60c4e7b2e2af48bf28 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/font +277d78e5b07556c6d62fa480039f460f3f433e52e5d6d5fb539ba1d09ce064fd /home/drakestapleton/handoffs/allen-omega-L694/L765/full/allen +bf1a0644658cc2c4a0ac55ff227a6dd8a2fdc771c8a9a2d300d30c36f4b3cfc0 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/reply +583c208881381618716db4d8013c41951b6e6aad60d5c789acb144e09686c4e8 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/thinking-mutant +5a3a813ab4cfcef486b7920563d4b3fe615edafbf269ce6d8ed1796fb01fb230 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/surface +3889b10935f48c606b17d2cb778ea39866d02f7976eff0292c03f6ff8d24b9a8 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/inputtail-mutant +e44ee2e0fb447a50836ee6f83e70b349469b8c6a86edfeb5425e55f71a40de83 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/ackstop-mutant +67e1d74c0eba2c9be5b1499f21f11e0c09207ff77d2f6480b0ae3c7f166f6cae /home/drakestapleton/handoffs/allen-omega-L694/L765/full/hash-mutant +3ea36ec2690a2276299c1a2792e083a9428663ad3f617ed17cd794ba9f4f400b /home/drakestapleton/handoffs/allen-omega-L694/L765/full/golden +d79606e96ab36b8f4946bcba86f6ca8a28b97b22b4075a72fe388c40937296a5 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/session-mutant +f0de7e1fd80f28d8905a29cf6f2e96ffc7b271e155b2900ab785338da9d677df /home/drakestapleton/handoffs/allen-omega-L694/L765/full/scene-input +b88253b534e3cc6327e5aee1c246ec043aa76e13d605bbcc20b19116dbc242e8 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/intent +dd2a504c99a5757ee195553550ee0e9e832f5d2902a02f654a795f40067e6c1f /home/drakestapleton/handoffs/allen-omega-L694/L765/full/provider-input +1cf6557305554a699bbf2844466976f862a473c4f96692c84b9073c0d64ccb6f /home/drakestapleton/handoffs/allen-omega-L694/L765/full/rawask-mutant +3a84eb8ffde7ae9a0d181250afb66cac4b0e43fe49b2e9b76c957dd601de4152 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/surface-mutants +34c901cfb34adcbba1212045f9209a5fb3f385b9011c116be8bf8be9ed173f41 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/font-mutants +4a15671c7565b7bb36a8c73b71469ea5a0516785aaaaf4a117d711b674172ca6 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/fixture +7920f4faf33ee312a4e40bd059cfbd596ed6dde41a4d72e3d7b841762ab961a1 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/provider +5e0805d8db84dee2a34d3ff8c1ebb0a7e21759caa03cb72a49f84af126cf7fca /home/drakestapleton/handoffs/allen-omega-L694/L765/full/context +7170b5750d4a617400e3fb789d45ec9768e266b450b20fdc959767320bd96521 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/staleview-mutant +227e8e308484c3ec9ee57da0f295b616e613dc7c9a1e3d096b8a9f39f7cfa709 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/runtime +74219971e764b8ed72fb1ef00b96f90724a161160c9927d17aec52460dd08647 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/code +52ffd81fe79089c4e03accba53621f9f90c52d6ae2be6e33fdd0f09e42c07642 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/provider-mutants +da46b103d53b8bdbeb80f3bd6c7013bdbf534af103f47a1168e023fa967539f7 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/edges +a389d7dd2f8de1f6d69d888c3ddec7e0fa293ed8eec0504b43d35d2ca79e2463 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/presentation-mutants +1cd67f151fd770abccd40e76084c371ed445745a50072344f043e69c60082e0b /home/drakestapleton/handoffs/allen-omega-L694/L765/full/appcode-mutant +263e91dd6669b47100249da8583b00d5242393b57e56e8d5630ef9615f1590c4 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/render +d1180a7492a313488f50e9dae1e4b01bbfd37695f190e1be15cb91f01fa9f1e2 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/rawrecv-mutant +282d033f4752c79e88949736501550f4c9fc555b535df3aa52393463d8f6aae5 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/stale-mutant +7e5737bb5acf31c3e584a6389cef5f04f2e0f61c5c421ca90c20856b3b093251 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/courier +7ee8446a1fdb79609dd83e073cd0fa964047839915bfa780562f9cb00962837a /home/drakestapleton/handoffs/allen-omega-L694/L765/full/scene +960460506ca9ebddc79698fd7ec304a17046db995a4b13a15487fc6559dc802f /home/drakestapleton/handoffs/allen-omega-L694/L765/full/presentation +7a41e8b30b0ad60e25addd2d0c1e51408c7440dc645de92d999579849645d5e3 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/pendingwire-mutant +7b2d070333ac2978b19e8ea078fba08935303adc216e0e4ea6d0fb82f7ef657b /home/drakestapleton/handoffs/allen-omega-L694/L765/full/font-output +4c8c39c05cd4480b1418f0dbd604f9d093e4d03021266b04fba65bdb2ef9b94c /home/drakestapleton/handoffs/allen-omega-L694/L765/full/clipright-mutant +5ed8dad655d71cdf037631df85a8f6b36abf97a1e146c13267a789b46f6fa3b0 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/framecheck-mutant +385567741d13264b90536edc4fa56ff2b20f1ed78f5f37fc5226623271c5a407 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/blendbg-mutant +eef60330c475d018bd9ca9f697c6221062ef9ea59197b78e2bb01650d5ebea5a /home/drakestapleton/handoffs/allen-omega-L694/L765/full/scenecap-mutant +fa91a5ec8599c9f7ebcd55886f2d8a164ff5c7413c1347a461f37ec4cf5914e3 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/fontroot-mutant +6209984add5473dcc9dfe774c1679147517f7ee5b9f52aa4ab4cc9674133f83e /home/drakestapleton/handoffs/allen-omega-L694/L765/full/contextjob-mutant +1d5d8331c26baf46b32c00731286fd5b22a7f9139c22c6e43c6c898a27f12ed8 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/paint +a0fc632f29ab6bdc23d1fd0b22d2e82974ae1539e9513f5854b68ced916babb4 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/crc-mutant +b3e567f726eb3395516e4aab5c1fca888d160e784a72ee97df4640cd943f3d25 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/autosent-mutant +96899de9e1c586407a8f8e0455a2fa9b468e8070de4f6aafa65241cf40dfa07f /home/drakestapleton/handoffs/allen-omega-L694/L765/full/provider-output +71f99242bcad6ede239b240602470fcf3d5da3267eb47a1ad522241958222367 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/stdio-overflow-input +e4c883b182f2ae7f5e74cee9e39fbae7d6cf2892dc31bb6415a9edfb36786184 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/keepalive-mutant +661259d4a7158df286f832fd60597d4abae7aa23a8d63bdb08cd5cc6dc554fee /home/drakestapleton/handoffs/allen-omega-L694/L765/full/provider-process +aa3663aff49c9f58f822eae8fd8a1ab58049a4db4c1fe72a007f45408b3dca12 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/memory +9eaf7d395b86a8623307df39b95f29331ad2fb571bf2ea1b4f8fbd7f70a646a9 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/surface-render +6dc3bc8da70430603a03bd7b5d67017a4b62a2bc4a0c535304e47214298eb3ab /home/drakestapleton/handoffs/allen-omega-L694/L765/full/fontalpha-mutant +e28c9b84644c09a8221437f90962855bad58c6d47c087c1aa73f61b4ea442bef /home/drakestapleton/handoffs/allen-omega-L694/L765/full/application +678c6775ae1adb7b2e330ae434df65fbfef1762f809b5e673b7fed64ae174ab1 /home/drakestapleton/handoffs/allen-omega-L694/L765/full/rawreset-mutant diff --git a/evidence/allen-omega-L694/L765/blendbg-mutant.log b/evidence/allen-omega-L694/L765/blendbg-mutant.log new file mode 100644 index 00000000..40ad1f15 --- /dev/null +++ b/evidence/allen-omega-L694/L765/blendbg-mutant.log @@ -0,0 +1,85 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 1 +21 1 +22 1 +23 1 +24 1 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 diff --git a/evidence/allen-omega-L694/L765/clipright-mutant.log b/evidence/allen-omega-L694/L765/clipright-mutant.log new file mode 100644 index 00000000..a23b0e19 --- /dev/null +++ b/evidence/allen-omega-L694/L765/clipright-mutant.log @@ -0,0 +1,85 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 1 +29 0 +30 1 +31 0 +32 0 +33 0 +34 0 +35 0 +36 1 +37 0 +38 0 +39 0 +40 0 +41 0 +42 1 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 1 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 diff --git a/evidence/allen-omega-L694/L765/code.log b/evidence/allen-omega-L694/L765/code.log new file mode 100644 index 00000000..e7e197b7 --- /dev/null +++ b/evidence/allen-omega-L694/L765/code.log @@ -0,0 +1,23 @@ +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 diff --git a/evidence/allen-omega-L694/L765/context.log b/evidence/allen-omega-L694/L765/context.log new file mode 100644 index 00000000..df62cddb --- /dev/null +++ b/evidence/allen-omega-L694/L765/context.log @@ -0,0 +1,142 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 diff --git a/evidence/allen-omega-L694/L765/contextjob-mutant.log b/evidence/allen-omega-L694/L765/contextjob-mutant.log new file mode 100644 index 00000000..3432d4b2 --- /dev/null +++ b/evidence/allen-omega-L694/L765/contextjob-mutant.log @@ -0,0 +1,142 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 1 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 1 +72 1 +73 1 +74 1 +75 1 +76 1 +77 0 +78 0 +79 1 +80 1 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 1 +88 1 +89 0 +90 1 +91 0 +92 1 +93 0 +94 1 +95 0 +96 1 +97 0 +98 1 +99 0 +100 1 +101 0 +102 1 +103 0 +104 1 +105 0 +106 1 +107 0 +108 1 +109 1 +110 1 +111 1 +112 1 +113 1 +114 1 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 1 +123 0 +124 1 +125 0 +126 1 +127 0 +128 1 +129 0 +130 1 +131 0 +132 1 +133 0 +134 1 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 1 +142 1 diff --git a/evidence/allen-omega-L694/L765/contextnote-mutant.log b/evidence/allen-omega-L694/L765/contextnote-mutant.log new file mode 100644 index 00000000..b5c08759 --- /dev/null +++ b/evidence/allen-omega-L694/L765/contextnote-mutant.log @@ -0,0 +1,142 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 1 +38 1 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 1 +47 0 +48 1 +49 0 +50 0 +51 0 +52 0 +53 0 +54 1 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 diff --git a/evidence/allen-omega-L694/L765/courier.log b/evidence/allen-omega-L694/L765/courier.log new file mode 100644 index 00000000..8402df49 --- /dev/null +++ b/evidence/allen-omega-L694/L765/courier.log @@ -0,0 +1,24 @@ +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 diff --git a/evidence/allen-omega-L694/L765/crc-mutant.log b/evidence/allen-omega-L694/L765/crc-mutant.log new file mode 100644 index 00000000..a0d90bd4 --- /dev/null +++ b/evidence/allen-omega-L694/L765/crc-mutant.log @@ -0,0 +1,23 @@ +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 1 +117 1 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 diff --git a/evidence/allen-omega-L694/L765/edges.log b/evidence/allen-omega-L694/L765/edges.log new file mode 100644 index 00000000..e8d0deea --- /dev/null +++ b/evidence/allen-omega-L694/L765/edges.log @@ -0,0 +1,352 @@ +1201 0 +1202 0 +1203 0 +1204 0 +1205 0 +1206 0 +1207 0 +1208 0 +1209 0 +1210 0 +1211 0 +1212 0 +1213 0 +1214 0 +1220 0 +1221 0 +1222 0 +1223 0 +1224 0 +1225 0 +1226 0 +1227 0 +1228 0 +1229 0 +1230 0 +1231 0 +1232 0 +1233 0 +1234 0 +1235 0 +1236 0 +1237 0 +1238 0 +1239 0 +1240 0 +1241 0 +1242 0 +1243 0 +1244 0 +1245 0 +1246 0 +1247 0 +1248 0 +1249 0 +1250 0 +1251 0 +1252 0 +1253 0 +1254 0 +1255 0 +1256 0 +1257 0 +1258 0 +1259 0 +1260 0 +1261 0 +1262 0 +1301 0 +1302 0 +1303 0 +1304 0 +1305 0 +1306 0 +1310 0 +1311 0 +1312 0 +1313 0 +1314 0 +1315 0 +1316 0 +1317 0 +1318 0 +1319 0 +1320 0 +1321 0 +1322 0 +1323 0 +1324 0 +1325 0 +1326 0 +1327 0 +1328 0 +1329 0 +1330 0 +1331 0 +1332 0 +1333 0 +1334 0 +1335 0 +1336 0 +1337 0 +1338 0 +1339 0 +1340 0 +1341 0 +1342 0 +1343 0 +1344 0 +1345 0 +1346 0 +1347 0 +1348 0 +1349 0 +1350 0 +1351 0 +1352 0 +1353 0 +1354 0 +1355 0 +1356 0 +1357 0 +1358 0 +1359 0 +1360 0 +1361 0 +1362 0 +1363 0 +1364 0 +1365 0 +1366 0 +1367 0 +1368 0 +1369 0 +1370 0 +1371 0 +1372 0 +1373 0 +1374 0 +1375 0 +1376 0 +1377 0 +1378 0 +1379 0 +1380 0 +1381 0 +1382 0 +1383 0 +1384 0 +1385 0 +1386 0 +1387 0 +1388 0 +1389 0 +1390 0 +1391 0 +1392 0 +1393 0 +1394 0 +1395 0 +1396 0 +1397 0 +1398 0 +1399 0 +1400 0 +1401 0 +1402 0 +1403 0 +1404 0 +1405 0 +1406 0 +1407 0 +1408 0 +1409 0 +1410 0 +1411 0 +1412 0 +1413 0 +1414 0 +1415 0 +1416 0 +1417 0 +1418 0 +1419 0 +1420 0 +1421 0 +1422 0 +1423 0 +1424 0 +1425 0 +1426 0 +1427 0 +1428 0 +1429 0 +1430 0 +1431 0 +1432 0 +1433 0 +1434 0 +1435 0 +1436 0 +1437 0 +1438 0 +1439 0 +1440 0 +1441 0 +1442 0 +1443 0 +1444 0 +1445 0 +1446 0 +1447 0 +1448 0 +1449 0 +1450 0 +1451 0 +1452 0 +1453 0 +1454 0 +1455 0 +1456 0 +1457 0 +1458 0 +1459 0 +1460 0 +1461 0 +1462 0 +1463 0 +1464 0 +1465 0 +1466 0 +1467 0 +1468 0 +1469 0 +1470 0 +1471 0 +1472 0 +1473 0 +1474 0 +1475 0 +1476 0 +1477 0 +1478 0 +1479 0 +1480 0 +1481 0 +1482 0 +1483 0 +1484 0 +1485 0 +1486 0 +1487 0 +1488 0 +1489 0 +1490 0 +1491 0 +1492 0 +1493 0 +1494 0 +1495 0 +1496 0 +1497 0 +1498 0 +1499 0 +1500 0 +1501 0 +1502 0 +1503 0 +1504 0 +1505 0 +1506 0 +1507 0 +1508 0 +1509 0 +1510 0 +1511 0 +1512 0 +1513 0 +1514 0 +1515 0 +1516 0 +1517 0 +1518 0 +1519 0 +1520 0 +1521 0 +1522 0 +1523 0 +1524 0 +1525 0 +1526 0 +1527 0 +1528 0 +1529 0 +1530 0 +1531 0 +1532 0 +1533 0 +1534 0 +1535 0 +1536 0 +1537 0 +1538 0 +1539 0 +1540 0 +1541 0 +1542 0 +1543 0 +1544 0 +1545 0 +1546 0 +1547 0 +1548 0 +1549 0 +1550 0 +1551 0 +1552 0 +1553 0 +1554 0 +1555 0 +1556 0 +1557 0 +1558 0 +1559 0 +1560 0 +1561 0 +1562 0 +1563 0 +1564 0 +1565 0 +1570 0 +1571 0 +1572 0 +1575 0 +1573 0 +1574 0 +1600 0 +1601 0 +1602 0 +1603 0 +1604 0 +1605 0 +1606 0 +1607 0 +1610 0 +1611 0 +1612 0 +1613 0 +1614 0 +1615 0 +1616 0 +1617 0 +1701 0 +1702 0 +1703 0 +1704 0 +1705 0 +1706 0 +1707 0 +1708 0 +1709 0 +1710 0 +1711 0 diff --git a/evidence/allen-omega-L694/L765/font.log b/evidence/allen-omega-L694/L765/font.log new file mode 100644 index 00000000..1f885320 --- /dev/null +++ b/evidence/allen-omega-L694/L765/font.log @@ -0,0 +1,421 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 +183 0 +184 0 +185 0 +186 0 +187 0 +188 0 +189 0 +190 0 +191 0 +192 0 +193 0 +194 0 +195 0 +196 0 +197 0 +198 0 +199 0 +200 0 +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 +225 0 +226 0 +227 0 +228 0 +229 0 +230 0 +231 0 +232 0 +233 0 +234 0 +235 0 +236 0 +237 0 +238 0 +239 0 +240 0 +241 0 +242 0 +243 0 +244 0 +245 0 +246 0 +247 0 +248 0 +249 0 +250 0 +251 0 +252 0 +253 0 +254 0 +255 0 +256 0 +257 0 +258 0 +259 0 +260 0 +261 0 +262 0 +263 0 +264 0 +265 0 +266 0 +267 0 +268 0 +269 0 +270 0 +271 0 +272 0 +273 0 +274 0 +275 0 +276 0 +277 0 +278 0 +279 0 +280 0 +281 0 +282 0 +283 0 +284 0 +285 0 +286 0 +287 0 +288 0 +289 0 +290 0 +291 0 +292 0 +293 0 +294 0 +295 0 +296 0 +297 0 +298 0 +299 0 +300 0 +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 0 +310 0 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +361 0 +362 0 +363 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 0 +380 0 +381 0 +382 0 +383 0 +384 0 +385 0 +386 0 +387 0 +388 0 +389 0 +390 0 +391 0 +392 0 +393 0 +394 0 +395 0 +396 0 +397 0 +398 0 +399 0 +400 0 +401 0 +402 0 +403 0 +404 0 +405 0 +406 0 +407 0 +408 0 +409 0 +410 0 +411 0 +412 0 +413 0 +414 0 +415 0 +416 0 +417 0 +418 0 +419 0 +420 0 +421 0 diff --git a/evidence/allen-omega-L694/L765/fontalpha-mutant.log b/evidence/allen-omega-L694/L765/fontalpha-mutant.log new file mode 100644 index 00000000..4dba5479 --- /dev/null +++ b/evidence/allen-omega-L694/L765/fontalpha-mutant.log @@ -0,0 +1,421 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 +183 0 +184 0 +185 0 +186 0 +187 0 +188 0 +189 0 +190 0 +191 0 +192 0 +193 0 +194 0 +195 0 +196 0 +197 0 +198 0 +199 0 +200 0 +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 +225 0 +226 0 +227 0 +228 0 +229 0 +230 0 +231 0 +232 0 +233 0 +234 0 +235 0 +236 0 +237 0 +238 0 +239 0 +240 0 +241 0 +242 0 +243 0 +244 0 +245 0 +246 0 +247 0 +248 0 +249 0 +250 0 +251 0 +252 0 +253 0 +254 0 +255 0 +256 0 +257 0 +258 0 +259 0 +260 0 +261 0 +262 0 +263 0 +264 0 +265 0 +266 0 +267 0 +268 0 +269 0 +270 0 +271 0 +272 0 +273 0 +274 0 +275 0 +276 0 +277 0 +278 0 +279 0 +280 0 +281 0 +282 0 +283 0 +284 0 +285 0 +286 0 +287 0 +288 0 +289 0 +290 0 +291 0 +292 0 +293 0 +294 0 +295 0 +296 0 +297 0 +298 0 +299 0 +300 0 +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 0 +310 0 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +361 0 +362 0 +363 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 0 +380 0 +381 0 +382 0 +383 0 +384 0 +385 0 +386 0 +387 0 +388 0 +389 0 +390 0 +391 0 +392 0 +393 0 +394 0 +395 0 +396 0 +397 0 +398 0 +399 0 +400 0 +401 0 +402 0 +403 0 +404 0 +405 0 +406 0 +407 0 +408 0 +409 0 +410 0 +411 0 +412 0 +413 1 +414 0 +415 0 +416 0 +417 0 +418 0 +419 1 +420 0 +421 0 diff --git a/evidence/allen-omega-L694/L765/fontroot-mutant.log b/evidence/allen-omega-L694/L765/fontroot-mutant.log new file mode 100644 index 00000000..326cd397 --- /dev/null +++ b/evidence/allen-omega-L694/L765/fontroot-mutant.log @@ -0,0 +1,421 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 1 +11 1 +12 1 +13 1 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 +183 0 +184 0 +185 0 +186 0 +187 0 +188 0 +189 0 +190 0 +191 0 +192 0 +193 0 +194 0 +195 0 +196 0 +197 0 +198 0 +199 0 +200 0 +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 +225 0 +226 0 +227 0 +228 0 +229 0 +230 0 +231 0 +232 0 +233 0 +234 0 +235 0 +236 0 +237 0 +238 0 +239 0 +240 0 +241 0 +242 0 +243 0 +244 0 +245 0 +246 0 +247 0 +248 0 +249 0 +250 0 +251 0 +252 0 +253 0 +254 0 +255 0 +256 0 +257 0 +258 0 +259 0 +260 0 +261 0 +262 0 +263 0 +264 0 +265 0 +266 0 +267 0 +268 0 +269 0 +270 0 +271 0 +272 0 +273 0 +274 0 +275 0 +276 0 +277 0 +278 0 +279 0 +280 0 +281 0 +282 0 +283 0 +284 0 +285 0 +286 0 +287 0 +288 0 +289 0 +290 0 +291 0 +292 0 +293 0 +294 0 +295 0 +296 0 +297 0 +298 0 +299 0 +300 0 +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 0 +310 0 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +361 0 +362 0 +363 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 0 +380 0 +381 0 +382 0 +383 0 +384 0 +385 0 +386 0 +387 0 +388 0 +389 0 +390 0 +391 0 +392 0 +393 0 +394 0 +395 0 +396 0 +397 0 +398 0 +399 0 +400 0 +401 0 +402 0 +403 0 +404 0 +405 0 +406 0 +407 0 +408 0 +409 0 +410 0 +411 0 +412 0 +413 0 +414 1 +415 1 +416 1 +417 1 +418 1 +419 0 +420 1 +421 1 diff --git a/evidence/allen-omega-L694/L765/framecheck-mutant.log b/evidence/allen-omega-L694/L765/framecheck-mutant.log new file mode 100644 index 00000000..2849aedb --- /dev/null +++ b/evidence/allen-omega-L694/L765/framecheck-mutant.log @@ -0,0 +1,136 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 1 +7 1 +8 1 +9 1 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 diff --git a/evidence/allen-omega-L694/L765/full.exit b/evidence/allen-omega-L694/L765/full.exit new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/L765/full.exit @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/L765/full.log b/evidence/allen-omega-L694/L765/full.log new file mode 100644 index 00000000..de61e79f --- /dev/null +++ b/evidence/allen-omega-L694/L765/full.log @@ -0,0 +1,59 @@ +runtime compile=0 native-exit=0 +code compile=0 native-exit=0 +courier compile=0 native-exit=0 +scheduler compile=0 native-exit=0 +application compile=0 native-exit=0 +provider-core compile=0 native-exit=0 +presentation compile=0 native-exit=0 +font compile=0 native-exit=0 +surface compile=0 native-exit=0 +memory compile=0 native-exit=0 +context compile=0 native-exit=0 +intent compile=0 native-exit=0 +reply compile=0 native-exit=0 +view compile=0 native-exit=0 +scene compile=0 native-exit=0 +scene-input compile=0 native-exit=0 +paint compile=0 native-exit=0 +edges compile=0 native-exit=0 +fixture compile=0 native-exit=0 +golden compile=0 native-exit=0 +render compile=0 native-exit=0 +font-output compile=0 native-exit=0 +font-render compile=0 native-exit=0 +surface-render compile=0 native-exit=0 +font native masks match frozen external legacy oracle +stdio native-exit=0 golden-cmp=0 +stdio overflow native-exit=65 no-later-command=PASS +provider malformed mode=1 exit=65 no-later-command=PASS +provider malformed mode=2 exit=65 no-later-command=PASS +provider malformed mode=3 exit=65 no-later-command=PASS +provider malformed mode=4 exit=65 no-later-command=PASS +provider malformed mode=5 exit=65 no-later-command=PASS +provider malformed mode=6 exit=65 no-later-command=PASS +provider native-exit=0 fragmented-pipe=0 output-verifier=0 +stale mutant compile=0 rejected-exit=3 +crc mutant compile=0 rejected-exit=2 +hash mutant compile=0 rejected-exit=2 +readback mutant compile=0 rejected-exit=7 +session mutant compile=0 rejected-exit=1 +keepalive mutant compile=0 rejected-exit=40 +ackstop mutant compile=0 rejected-exit=27 +pendingwire mutant compile=0 rejected-exit=1 +appcode mutant compile=0 rejected-exit=3 +thinking mutant compile=0 rejected-exit=6 +scenecap mutant compile=0 rejected-exit=3 +contextnote mutant compile=0 rejected-exit=5 +contextjob mutant compile=0 rejected-exit=36 +autosent mutant compile=0 rejected-exit=1 +framecheck mutant compile=0 rejected-exit=1 +staleview mutant compile=0 rejected-exit=1 +inputtail mutant compile=0 rejected-exit=1 +fontroot mutant compile=0 rejected-exit=1 +fontalpha mutant compile=0 rejected-exit=1 +rawask mutant compile=0 rejected-exit=1 +rawrecv mutant compile=0 rejected-exit=1 +rawreset mutant compile=0 rejected-exit=1 +clipright mutant compile=0 rejected-exit=1 +blendbg mutant compile=0 rejected-exit=1 +ALLEN_OMEGA_HOST: PASS; target=NOT_RUN; live=NOT_RUN diff --git a/evidence/allen-omega-L694/L765/green.exit b/evidence/allen-omega-L694/L765/green.exit new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/L765/green.exit @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/L765/green.log b/evidence/allen-omega-L694/L765/green.log new file mode 100644 index 00000000..dfd50508 --- /dev/null +++ b/evidence/allen-omega-L694/L765/green.log @@ -0,0 +1,79 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 diff --git a/evidence/allen-omega-L694/L765/green2.log b/evidence/allen-omega-L694/L765/green2.log new file mode 100644 index 00000000..b0699580 --- /dev/null +++ b/evidence/allen-omega-L694/L765/green2.log @@ -0,0 +1,81 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 diff --git a/evidence/allen-omega-L694/L765/hash-mutant.log b/evidence/allen-omega-L694/L765/hash-mutant.log new file mode 100644 index 00000000..c75cfefb --- /dev/null +++ b/evidence/allen-omega-L694/L765/hash-mutant.log @@ -0,0 +1,79 @@ +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 1 +310 1 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +362 0 +363 0 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 0 +361 0 diff --git a/evidence/allen-omega-L694/L765/inputtail-mutant.log b/evidence/allen-omega-L694/L765/inputtail-mutant.log new file mode 100644 index 00000000..c0415908 --- /dev/null +++ b/evidence/allen-omega-L694/L765/inputtail-mutant.log @@ -0,0 +1,75 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 1 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 diff --git a/evidence/allen-omega-L694/L765/intent.log b/evidence/allen-omega-L694/L765/intent.log new file mode 100644 index 00000000..5371bd36 --- /dev/null +++ b/evidence/allen-omega-L694/L765/intent.log @@ -0,0 +1,8 @@ +501 0 +502 0 +503 0 +504 0 +505 0 +506 0 +507 0 +508 0 diff --git a/evidence/allen-omega-L694/L765/inventory.json b/evidence/allen-omega-L694/L765/inventory.json new file mode 100644 index 00000000..5160987a --- /dev/null +++ b/evidence/allen-omega-L694/L765/inventory.json @@ -0,0 +1,84 @@ +{ + "README.md": "2d46cf33dfc1bce34265358ff52ac1c3f17021051e40018fabd1e470e9f70e5d", + "ackstop-mutant.log": "e35f80780a1c1769657287485e65ca25ab222d99277482c91900418d6dc6d433", + "appcode-mutant.log": "087522069b49d76999d8a495fccbff79cad4ff1fdf1d3ebf1e15855d6c959dc1", + "application.log": "799a91676cc7a8b0f4d027392ad8dda0e26af0501906ad906ae1ec8b1703d30a", + "autosent-mutant.log": "0a87e6bc447a7f5a73b519e4894331584138c0efa69baa3d66af99b4cadd5f2a", + "binaries.sha256": "0021bee42f30154ff98f0a965d06e54b4db9ce397ae07e311e0b1e6b77bd53a2", + "blendbg-mutant.log": "89c87c87a0b7cbff1515b194ab1f6af5dd80d005fd0537f299932843b6c879d3", + "clipright-mutant.log": "fed1bc66f29d0878cd2a155fe8679344267fbc6806f87397bc1e3eb2983fa34c", + "code.log": "f4d91fae8c90949b5538689d148384c72984c34d8f84507b499cbb75349ec390", + "context.log": "a93a138b2ffb8a544174d9bc55e3e5e8b7d0f2531f4aff76030eba22e7c7b5e0", + "contextjob-mutant.log": "4f32375d7357e7ebd07106f23fada35d235ad7756a9aba91f6a556fae4d39c3b", + "contextnote-mutant.log": "528e41cd827af033d9f5391f011aba3c9e348051a57916c0c5d52c9e263f87a5", + "courier.log": "466116a0daf08d362ded3aab678a6213671cc17e82ead4bd6fdc5dcedf1674f1", + "crc-mutant.log": "d640ebbfc3be10156ce28e7972bd9931390e4a2c18f90099997e4bd94d941835", + "edges.log": "c3c33b435c05aebcb2c86e76121ca0681bcc58c52bc1388b5a8b47258c5603ed", + "font.log": "e740379ab582a55deec96e1e2cc0ad550b217409e78ea906b415765b522c028d", + "fontalpha-mutant.log": "4a9357c64f7baaff5d6ccce7396f34ae76c40d22b2df4e0262df3c90ba8b77f3", + "fontroot-mutant.log": "877fce5a15491776440a7318117a847f974aea016b3a2f162c8644302d02d0fc", + "framecheck-mutant.log": "925e213d1b31b91996ca57bcdddfd12c33f5a302d9e2176a11ccedd04f6ae58b", + "full.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa", + "full.log": "c6906c818676ee60a3cd8518570da28068a84e7cf47aa4b203243c13ae96a0ea", + "green.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa", + "green.log": "3dd67e42141a43466d66f80d9718156eb2ee9a5a568daca7f271179d29d68f18", + "green2.log": "61c408c93c729c5a25a6d7b7f7ffd088b154f8282612074dd006c72e43bd38e6", + "hash-mutant.log": "e2900d31ceb87ff95fb84cac73a1e6aa3a0100eebaada0432ec50c2471cd437e", + "inputtail-mutant.log": "48170607e958bb62a28b6a05bf184a3fcf16b5a0ec76bed8b7fa2bcc0b9a9d67", + "intent.log": "920955281e985095ba5d24b01370dcb7fc022559df06892bfc120a9fc6a04345", + "keepalive-mutant.log": "9cf7f699f4c0a01694b4d3d557857d95fa76bdf5d7d2d58571aef3b9e66da10e", + "long.log": "b37fc9e675de395d9cba4c2e74ae7ea210e617927691c9f1df4896ae1bafe508", + "memory.log": "d8ad7727ab1536ed00ab2a63f0a056e4e4cc237571077c36573952a4c49c9a15", + "paint.log": "ab43be8b6b42efc70663a0e14d0b44aec7c0766bbb961af2da77d2737f78a81a", + "pendingwire-mutant.log": "6a48c141724f07b9adf2a4da28802544ab29d2d3f42fe1eacb3ef45df2d96657", + "presentation.log": "c43d43223e83f0d34b868be1fa08b0fa42386f72938a8f59e24811f84aad37e7", + "provider-bad-1.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c", + "provider-bad-1.receipt": "4a4a5cc6008f0286443686c10c17919e7e3a3e2258a6b97bf06311c9afe0dfe4", + "provider-bad-2.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c", + "provider-bad-2.receipt": "437701d7771dcdcc130e256587a9251dbeabef08feb3d518d93f7db29b32619b", + "provider-bad-3.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c", + "provider-bad-3.receipt": "cf271c014ed96ffcad97c0ddde9a784deae63b48ab54ead38a601896a2cdfa05", + "provider-bad-4.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c", + "provider-bad-4.receipt": "3be14d5117cfd9923743dc772ac727cb30372228ca81879e3cac708dc9700d9a", + "provider-bad-5.log": "09a2936c0085b837450a4243fa7d13a60b5e7d7014e0adc66e1c544569e3079c", + "provider-bad-5.receipt": "311ce7da405cd8858718b28b45415028dedec82003dcb862d1b5ceea26c84646", + "provider-bad-6.log": "a0cc795fae1ca892318f47133f6c48e1c8bb6aad118ff7f2b00c8e8967393435", + "provider-bad-6.receipt": "26e7d22e42e36c12f4341bf1e1838f7fa84402571f3127fb91208ac45a05f64b", + "provider-consumer.log": "d8b9c61c09b396c654162f89688f72787756206bfcc70276d6c2682c3e7710f5", + "provider-consumer.receipt": "fb092a176e79462f135ff6f1aea3e2171eada31ad629d8c498104e43b244dabb", + "provider-core.log": "568cc8e9e1f6233e1f3b2e5fa07fafa4ac21f9cab5b006841eff0c2ba429c9fb", + "provider-fragment.log": "49c437a2551e71a10bc26bc969f55103611991adea98696503cbdb8e686d1ba3", + "provider-process.log": "d8b9c61c09b396c654162f89688f72787756206bfcc70276d6c2682c3e7710f5", + "provider-process.receipt": "fb092a176e79462f135ff6f1aea3e2171eada31ad629d8c498104e43b244dabb", + "provider-producer.log": "d8b9c61c09b396c654162f89688f72787756206bfcc70276d6c2682c3e7710f5", + "provider-producer.receipt": "b710cb935724406c7cf4e459857b58c47f6026696cc11727da2815675bfec4d9", + "provider-stream.log": "49c437a2551e71a10bc26bc969f55103611991adea98696503cbdb8e686d1ba3", + "provider-surface.png": "1b2a7fc8f6fe1287462c4833ff1012848b8a7f735affd552fba50ea5bfbd8069", + "provider-surface.ppm": "676f3d56de19603e07766f2b859b58a55090071cb4a43081b4e7800031872066", + "rawask-mutant.log": "148f8896f9220cbbecb641a6fe49c137260bf437bec937d1f09afbd46b5451fb", + "rawrecv-mutant.log": "2e45054213301b34842645a40bc5e0e19498c1a26653b7bde451b4c36a4e6fb1", + "rawreset-mutant.log": "2acccf216cb9aaf9b5864661973daccbab733c0f1eef5cc37f7b386e55926826", + "readback-mutant.log": "c841304340c8e11f4412f33a05d63a76dfc6329270c33f30a4d5fb38c9339c61", + "red.om": "e9f448cf45e9b01c4e5fb016a77510dd4d0bccc413b30abca431a2e0a450d3ee", + "red2.exit": "4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865", + "red2.log": "326b77d7e7dceede76d198f43da9f91d4b2562f84fa6e10680f9876b58b54c15", + "red2.om": "0798511dba86b3b96e80e39b5df72cd7db053b114ce3fce467546c5e448edc62", + "red3.exit": "4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865", + "red3.log": "d4f25e8194ef9b79713d4326ef2c569bb1e677eac7c02b47fef3500b10186ece", + "red3.om": "c74c03c173deec76d0d602a1bba01cda74c9200466906bd417d66ca6daf7b136", + "reply.log": "32d6f801fcebf933a573005fdb8d16376c56b01c34b1004101b0c0f047216162", + "runtime.log": "3113eae822a3529bfeb10a00da4130799a2e951a77ce4d468a7e94ff5a312c51", + "scene-input.log": "613312ef2e6ad6eb62d19f9a161a65dbefd867af59a260d4dd82adef18ff88c9", + "scene.log": "bec37a817909cb5af22c3d82c962698ab0ddaf8a2c16debe86a84ea2a0889bc8", + "scenecap-mutant.log": "aaecc0a85ed361c2a5f6823a85f76ea5c8c60e3bef3d88ef225175ca7c3c090d", + "scheduler.log": "b73f09405c612284cb7eecacb51fbabe60f5f7c6ec11f504cbb76a1e4e83f948", + "session-mutant.log": "b6320567e748c4f1ab264c07c76e22f7091d6bf77c004aae67ecef4d8115e8f2", + "short.log": "b8ed8e2db46290298415a96dbb9f64580f5ff79f631cdcf3b0257f3fb836f8a2", + "source.sha256": "9aefde7a15a1a04d4b9f583b04d69499e653e24d38017a278f0f1b0832a14fb2", + "stale-mutant.log": "59a77d4cd8683beb2a101425071eafef48c9afba89ac8b6e10edb8ed1098b42b", + "staleview-mutant.log": "0968ca91bbecca4bf9f6dda44d115d3a162170b23ce21fa798a32a9617cd425b", + "summary.json": "2a7182ab93d75dd8e92c6c580fe6137b56fbad928fe4ab428acb5683bcf547e2", + "surface.log": "912b904b061622c26b5a727dfd46be8e1639d476d2db19086b29a0359b8b5fdd", + "thinking-mutant.log": "908c76c450a2ae6643694cc1f41e2a868792bcc3e20e96c317de6fa764d7f474", + "view.log": "2d117e033fea3f325a11c5cd70be5a181eb4d7d6b08e45b5fd73447d4159550e" +} diff --git a/evidence/allen-omega-L694/L765/keepalive-mutant.log b/evidence/allen-omega-L694/L765/keepalive-mutant.log new file mode 100644 index 00000000..2e3415df --- /dev/null +++ b/evidence/allen-omega-L694/L765/keepalive-mutant.log @@ -0,0 +1,213 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 1 +19 1 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 1 +54 1 +55 1 +56 1 +57 0 +58 0 +59 1 +60 0 +61 0 +62 0 +63 0 +64 0 +65 1 +66 0 +67 0 +68 0 +69 1 +70 1 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 1 +170 0 +171 1 +172 1 +173 0 +174 1 +175 0 +176 0 +177 0 +178 1 +179 1 +180 1 +181 1 +182 1 +183 1 +184 1 +185 1 +186 1 +187 1 +188 1 +189 1 +190 1 +191 1 +192 1 +193 1 +194 1 +195 1 +196 1 +197 1 +198 0 +199 1 +200 0 +201 0 +202 1 +203 1 +204 1 +205 0 +206 1 +207 1 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 diff --git a/evidence/allen-omega-L694/L765/long.log b/evidence/allen-omega-L694/L765/long.log new file mode 100644 index 00000000..0a060bc8 --- /dev/null +++ b/evidence/allen-omega-L694/L765/long.log @@ -0,0 +1,292 @@ +401 0 +410 0 +411 0 +412 0 +413 0 +414 0 +415 0 +416 0 +417 0 +418 0 +419 0 +420 0 +421 0 +422 0 +423 0 +424 0 +425 0 +426 0 +427 0 +428 0 +429 0 +430 0 +431 0 +432 0 +433 0 +434 0 +435 0 +436 0 +437 0 +438 0 +439 0 +440 0 +441 0 +442 0 +443 0 +444 0 +445 0 +446 0 +447 0 +448 0 +449 0 +450 0 +451 0 +452 0 +453 0 +454 0 +455 0 +456 0 +457 0 +458 0 +459 0 +460 0 +461 0 +462 0 +463 0 +464 0 +465 0 +466 0 +467 0 +468 0 +469 0 +470 0 +471 0 +472 0 +473 0 +474 0 +475 0 +476 0 +477 0 +478 0 +479 0 +480 0 +481 0 +482 0 +483 0 +484 0 +485 0 +486 0 +487 0 +488 0 +489 0 +490 0 +491 0 +492 0 +493 0 +494 0 +495 0 +496 0 +497 0 +498 0 +499 0 +500 0 +501 0 +502 0 +503 0 +504 0 +505 0 +506 0 +507 0 +508 0 +509 0 +510 0 +511 0 +512 0 +513 0 +514 0 +515 0 +516 0 +517 0 +518 0 +519 0 +520 0 +521 0 +522 0 +523 0 +524 0 +525 0 +526 0 +527 0 +528 0 +529 0 +530 0 +531 0 +532 0 +533 0 +534 0 +535 0 +536 0 +537 0 +538 0 +539 0 +540 0 +541 0 +542 0 +543 0 +544 0 +545 0 +546 0 +547 0 +548 0 +549 0 +550 0 +402 0 +403 0 +404 0 +405 0 +406 0 +700 0 +701 0 +702 0 +703 0 +704 0 +705 0 +706 0 +707 0 +708 0 +709 0 +710 0 +711 0 +712 0 +713 0 +714 0 +715 0 +716 0 +717 0 +718 0 +719 0 +720 0 +721 0 +722 0 +723 0 +724 0 +725 0 +726 0 +727 0 +728 0 +729 0 +730 0 +731 0 +732 0 +733 0 +734 0 +735 0 +736 0 +737 0 +738 0 +739 0 +740 0 +741 0 +742 0 +743 0 +744 0 +745 0 +746 0 +747 0 +748 0 +749 0 +750 0 +751 0 +752 0 +753 0 +754 0 +755 0 +756 0 +757 0 +758 0 +759 0 +760 0 +761 0 +762 0 +763 0 +764 0 +765 0 +766 0 +767 0 +768 0 +769 0 +770 0 +771 0 +772 0 +773 0 +774 0 +775 0 +776 0 +777 0 +778 0 +779 0 +780 0 +781 0 +782 0 +783 0 +784 0 +785 0 +786 0 +787 0 +788 0 +789 0 +790 0 +791 0 +792 0 +793 0 +794 0 +795 0 +796 0 +797 0 +798 0 +799 0 +800 0 +801 0 +802 0 +803 0 +804 0 +805 0 +806 0 +807 0 +808 0 +809 0 +810 0 +811 0 +812 0 +813 0 +814 0 +815 0 +816 0 +817 0 +818 0 +819 0 +820 0 +821 0 +822 0 +823 0 +824 0 +825 0 +826 0 +827 0 +828 0 +829 0 +830 0 +831 0 +832 0 +833 0 +834 0 +835 0 +836 0 +837 0 +838 0 +839 0 +840 0 +841 0 +407 0 +408 0 +409 0 diff --git a/evidence/allen-omega-L694/L765/memory.log b/evidence/allen-omega-L694/L765/memory.log new file mode 100644 index 00000000..5928102e --- /dev/null +++ b/evidence/allen-omega-L694/L765/memory.log @@ -0,0 +1,79 @@ +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 0 +310 0 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +362 0 +363 0 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 0 +361 0 diff --git a/evidence/allen-omega-L694/L765/paint.log b/evidence/allen-omega-L694/L765/paint.log new file mode 100644 index 00000000..281a5bd2 --- /dev/null +++ b/evidence/allen-omega-L694/L765/paint.log @@ -0,0 +1,11 @@ +1101 0 +1102 0 +1103 0 +1104 0 +1105 0 +1106 0 +1107 0 +1108 0 +1109 0 +1110 0 +1111 0 diff --git a/evidence/allen-omega-L694/L765/pendingwire-mutant.log b/evidence/allen-omega-L694/L765/pendingwire-mutant.log new file mode 100644 index 00000000..48fb2008 --- /dev/null +++ b/evidence/allen-omega-L694/L765/pendingwire-mutant.log @@ -0,0 +1,182 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 1 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 diff --git a/evidence/allen-omega-L694/L765/presentation.log b/evidence/allen-omega-L694/L765/presentation.log new file mode 100644 index 00000000..84fd2470 --- /dev/null +++ b/evidence/allen-omega-L694/L765/presentation.log @@ -0,0 +1,75 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 diff --git a/evidence/allen-omega-L694/L765/provider-bad-1.log b/evidence/allen-omega-L694/L765/provider-bad-1.log new file mode 100644 index 00000000..7da8e511 --- /dev/null +++ b/evidence/allen-omega-L694/L765/provider-bad-1.log @@ -0,0 +1,5 @@ +1 0 +2 0 +3 0 +4 0 +5 0 diff --git a/evidence/allen-omega-L694/L765/provider-bad-1.receipt b/evidence/allen-omega-L694/L765/provider-bad-1.receipt new file mode 100644 index 00000000..2b29860a --- /dev/null +++ b/evidence/allen-omega-L694/L765/provider-bad-1.receipt @@ -0,0 +1,4 @@ +1 +65 +0 +0 diff --git a/evidence/allen-omega-L694/L765/provider-bad-2.log b/evidence/allen-omega-L694/L765/provider-bad-2.log new file mode 100644 index 00000000..7da8e511 --- /dev/null +++ b/evidence/allen-omega-L694/L765/provider-bad-2.log @@ -0,0 +1,5 @@ +1 0 +2 0 +3 0 +4 0 +5 0 diff --git a/evidence/allen-omega-L694/L765/provider-bad-2.receipt b/evidence/allen-omega-L694/L765/provider-bad-2.receipt new file mode 100644 index 00000000..9ba12cca --- /dev/null +++ b/evidence/allen-omega-L694/L765/provider-bad-2.receipt @@ -0,0 +1,4 @@ +2 +65 +0 +0 diff --git a/evidence/allen-omega-L694/L765/provider-bad-3.log b/evidence/allen-omega-L694/L765/provider-bad-3.log new file mode 100644 index 00000000..7da8e511 --- /dev/null +++ b/evidence/allen-omega-L694/L765/provider-bad-3.log @@ -0,0 +1,5 @@ +1 0 +2 0 +3 0 +4 0 +5 0 diff --git a/evidence/allen-omega-L694/L765/provider-bad-3.receipt b/evidence/allen-omega-L694/L765/provider-bad-3.receipt new file mode 100644 index 00000000..199cc204 --- /dev/null +++ b/evidence/allen-omega-L694/L765/provider-bad-3.receipt @@ -0,0 +1,4 @@ +3 +65 +0 +0 diff --git a/evidence/allen-omega-L694/L765/provider-bad-4.log b/evidence/allen-omega-L694/L765/provider-bad-4.log new file mode 100644 index 00000000..7da8e511 --- /dev/null +++ b/evidence/allen-omega-L694/L765/provider-bad-4.log @@ -0,0 +1,5 @@ +1 0 +2 0 +3 0 +4 0 +5 0 diff --git a/evidence/allen-omega-L694/L765/provider-bad-4.receipt b/evidence/allen-omega-L694/L765/provider-bad-4.receipt new file mode 100644 index 00000000..26a81c4a --- /dev/null +++ b/evidence/allen-omega-L694/L765/provider-bad-4.receipt @@ -0,0 +1,4 @@ +4 +65 +0 +0 diff --git a/evidence/allen-omega-L694/L765/provider-bad-5.log b/evidence/allen-omega-L694/L765/provider-bad-5.log new file mode 100644 index 00000000..7da8e511 --- /dev/null +++ b/evidence/allen-omega-L694/L765/provider-bad-5.log @@ -0,0 +1,5 @@ +1 0 +2 0 +3 0 +4 0 +5 0 diff --git a/evidence/allen-omega-L694/L765/provider-bad-5.receipt b/evidence/allen-omega-L694/L765/provider-bad-5.receipt new file mode 100644 index 00000000..d79f5995 --- /dev/null +++ b/evidence/allen-omega-L694/L765/provider-bad-5.receipt @@ -0,0 +1,4 @@ +5 +65 +0 +0 diff --git a/evidence/allen-omega-L694/L765/provider-bad-6.log b/evidence/allen-omega-L694/L765/provider-bad-6.log new file mode 100644 index 00000000..3f9cc45d --- /dev/null +++ b/evidence/allen-omega-L694/L765/provider-bad-6.log @@ -0,0 +1,17 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 diff --git a/evidence/allen-omega-L694/L765/provider-bad-6.receipt b/evidence/allen-omega-L694/L765/provider-bad-6.receipt new file mode 100644 index 00000000..d0b7cd17 Binary files /dev/null and b/evidence/allen-omega-L694/L765/provider-bad-6.receipt differ diff --git a/evidence/allen-omega-L694/L765/provider-consumer.log b/evidence/allen-omega-L694/L765/provider-consumer.log new file mode 100644 index 00000000..9c0592e2 --- /dev/null +++ b/evidence/allen-omega-L694/L765/provider-consumer.log @@ -0,0 +1,3 @@ +1 0 +2 0 +3 0 diff --git a/evidence/allen-omega-L694/L765/provider-consumer.receipt b/evidence/allen-omega-L694/L765/provider-consumer.receipt new file mode 100644 index 00000000..31d93b9d Binary files /dev/null and b/evidence/allen-omega-L694/L765/provider-consumer.receipt differ diff --git a/evidence/allen-omega-L694/L765/provider-core.log b/evidence/allen-omega-L694/L765/provider-core.log new file mode 100644 index 00000000..1f06fc57 --- /dev/null +++ b/evidence/allen-omega-L694/L765/provider-core.log @@ -0,0 +1,136 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 diff --git a/evidence/allen-omega-L694/L765/provider-fragment.log b/evidence/allen-omega-L694/L765/provider-fragment.log new file mode 100644 index 00000000..d91084d1 --- /dev/null +++ b/evidence/allen-omega-L694/L765/provider-fragment.log @@ -0,0 +1,292 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 +183 0 +184 0 +185 0 +186 0 +187 0 +188 0 +189 0 +190 0 +191 0 +192 0 +193 0 +194 0 +195 0 +196 0 +197 0 +198 0 +199 0 +200 0 +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 +225 0 +226 0 +227 0 +228 0 +229 0 +230 0 +231 0 +232 0 +233 0 +234 0 +235 0 +236 0 +237 0 +238 0 +239 0 +240 0 +241 0 +242 0 +243 0 +244 0 +245 0 +246 0 +247 0 +248 0 +249 0 +250 0 +251 0 +252 0 +253 0 +254 0 +255 0 +256 0 +257 0 +258 0 +259 0 +260 0 +261 0 +262 0 +263 0 +264 0 +265 0 +266 0 +267 0 +268 0 +269 0 +270 0 +271 0 +272 0 +273 0 +274 0 +275 0 +276 0 +277 0 +278 0 +279 0 +280 0 +281 0 +282 0 +283 0 +284 0 +285 0 +286 0 +287 0 +288 0 +289 0 +290 0 +291 0 +292 0 diff --git a/evidence/allen-omega-L694/L765/provider-process.log b/evidence/allen-omega-L694/L765/provider-process.log new file mode 100644 index 00000000..9c0592e2 --- /dev/null +++ b/evidence/allen-omega-L694/L765/provider-process.log @@ -0,0 +1,3 @@ +1 0 +2 0 +3 0 diff --git a/evidence/allen-omega-L694/L765/provider-process.receipt b/evidence/allen-omega-L694/L765/provider-process.receipt new file mode 100644 index 00000000..31d93b9d Binary files /dev/null and b/evidence/allen-omega-L694/L765/provider-process.receipt differ diff --git a/evidence/allen-omega-L694/L765/provider-producer.log b/evidence/allen-omega-L694/L765/provider-producer.log new file mode 100644 index 00000000..9c0592e2 --- /dev/null +++ b/evidence/allen-omega-L694/L765/provider-producer.log @@ -0,0 +1,3 @@ +1 0 +2 0 +3 0 diff --git a/evidence/allen-omega-L694/L765/provider-producer.receipt b/evidence/allen-omega-L694/L765/provider-producer.receipt new file mode 100644 index 00000000..0967800c --- /dev/null +++ b/evidence/allen-omega-L694/L765/provider-producer.receipt @@ -0,0 +1,4 @@ +7 +0 +0 +0 diff --git a/evidence/allen-omega-L694/L765/provider-stream.log b/evidence/allen-omega-L694/L765/provider-stream.log new file mode 100644 index 00000000..d91084d1 --- /dev/null +++ b/evidence/allen-omega-L694/L765/provider-stream.log @@ -0,0 +1,292 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 +183 0 +184 0 +185 0 +186 0 +187 0 +188 0 +189 0 +190 0 +191 0 +192 0 +193 0 +194 0 +195 0 +196 0 +197 0 +198 0 +199 0 +200 0 +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 +225 0 +226 0 +227 0 +228 0 +229 0 +230 0 +231 0 +232 0 +233 0 +234 0 +235 0 +236 0 +237 0 +238 0 +239 0 +240 0 +241 0 +242 0 +243 0 +244 0 +245 0 +246 0 +247 0 +248 0 +249 0 +250 0 +251 0 +252 0 +253 0 +254 0 +255 0 +256 0 +257 0 +258 0 +259 0 +260 0 +261 0 +262 0 +263 0 +264 0 +265 0 +266 0 +267 0 +268 0 +269 0 +270 0 +271 0 +272 0 +273 0 +274 0 +275 0 +276 0 +277 0 +278 0 +279 0 +280 0 +281 0 +282 0 +283 0 +284 0 +285 0 +286 0 +287 0 +288 0 +289 0 +290 0 +291 0 +292 0 diff --git a/evidence/allen-omega-L694/L765/provider-surface.png b/evidence/allen-omega-L694/L765/provider-surface.png new file mode 100644 index 00000000..3f0540a3 Binary files /dev/null and b/evidence/allen-omega-L694/L765/provider-surface.png differ diff --git a/evidence/allen-omega-L694/L765/provider-surface.ppm b/evidence/allen-omega-L694/L765/provider-surface.ppm new file mode 100644 index 00000000..47dac85e --- /dev/null +++ b/evidence/allen-omega-L694/L765/provider-surface.ppm @@ -0,0 +1,49 @@ +P6 +768 384 +255 +?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL‰Œ—ÏÒÞ‰Œ—‰Œ—ÏÒÞ‰Œ—?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÆÉÕ®²½‹Ž™ILV?BL½À̽ÀÌ?BL½ÀÌìðüìðü½À̽ÀÌìðüìðü½ÀÌNP[ìðüìðüìðüNP[NP[ìðüìðüìðüNP[½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÙÜènq|½ÀÌìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÅÈÔ8:EÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÜàììðüìðüìðüìðüìðüìðüìðü]`kÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞSV`ª­¹ìðüìðüìðüìðüìðüSV`ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞOR]Ûßëìðüìðüìðüìðü47AÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ$&1ÊÎÚìðüìðüìðü¶ºÅÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ,/9Þâîìðüìðüìðüps~ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ\_jìðüìðüìðüÕÙåÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞª­¹ìðüìðüìðükmxÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞDFQìðüìðüìðü´·ÃÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÆÉÕìðüìðüìðü ",ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞLNY�”Ÿº½ÉÍÑÜ»¾ÊŽ‘œNP[[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iOQ\�’�»¾ÊÏÒÞ¼¿Ë�“žOQ\ÏÒÞìðüìðüÏÒÞ}�ŒìðüìðüìðüUXb?BL½À̽ÀÌ?BL\_j—š¥¿ÃÏÍÑܾÁÍ—š¥\_jOQ\�’�»¾ÊÏÒÞ¼¿Ë�“žOQ\?BL½À̽ÀÌ?BLÏÒÞìðüìðüÏÒÞ‰Œ—ÏÒÞ‰Œ—LNY�”Ÿº½ÉÍÑÜ»¾ÊŽ‘œNP[ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ<>I¸¼Çìðüìðüìðüìðüìðüìðüìðü¼¿Ë9;F[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i;=H¹½Èìðüìðüìðüìðüìðüìðüìðü¹½È<>IÏÒÞìðüìðüÏÒÞGJTìðüìðüìðü�„�½ÀÌìðüìðü½ÀÌehsÚÞêìðüìðüìðüìðüìðüìðüìðü›Ÿª;=H¹½Èìðüìðüìðüìðüìðüìðüìðü¹½È<>I½ÀÌìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞ%'2³¶ÂìðüìðüìðüNP[<>I¸¼Çìðüìðüìðüìðüìðüìðüìðü¼¿Ë9;FÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞbdoìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü]`k[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i]`kìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü]`kÏÒÞìðüìðüÏÒÞ(ìðüìðüìðü«¯ºÏÒÞìðüìðüÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüÝáí]`kìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞNP[ÛßëìðüìðüìðüìðüNP[bdoìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü]`kÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞìðüìðüÏÒÞSV`ìðüìðüìðüìðüìðüéíùÓ×ãìðüìðüìðüìðüìðüìðüQT_[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iQT_ìðüìðüìðüìðüìðüìðüÑÕáëïûìðüìðüìðüìðüìðüQT_ÏÒÞìðüìðüÏÒÞæêöìðüìðüº½ÉÏÒÞìðüìðüìðüìðüìðüìðüìðüæêöÓ×ãäèôìðüìðü�’�QT_ìðüìðüìðüìðüìðüìðüÑÕáëïûìðüìðüìðüìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞuxƒìðüìðüìðüìðüìðüŠ�˜SV`ìðüìðüìðüìðüìðüéíùÓ×ãìðüìðüìðüìðüìðüìðüQT_ÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞ"ØÛçìðüìðüìðüÙÜè_bl  `bmÚÞêìðüìðüìðüØÛç'[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i'ØÛçìðüìðüìðüÙÜè`bm  `bmÙÜèìðüìðüìðü×Ûæ'ÏÒÞìðüìðüÏÒÞØÛçìðüìðüÈÌØÏÒÞìðüìðüìðüìðüìðü®²½GJT>AKFIT'ØÛçìðüìðüìðüÙÜè`bm  `bmÙÜèìðüìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞŸ¢®ìðüìðüìðüìðüìðübdo"ØÛçìðüìðüìðüÙÜè_bl  `bmÚÞêìðüìðüìðüØÛç'ÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞ†Š•ìðüìðüìðüÉÍÙ"%/"%/ÇË×ìðüìðüìðü†‰”[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i†‰”ìðüìðüìðüÇË×"%/"%/ÇË×ìðüìðüìðü…ˆ“ÏÒÞìðüìðüÏÒÞ×ÛæìðüìðüÉÍÙÏÒÞìðüìðüìðüìðü‚…�†‰”ìðüìðüìðüÇË×"%/"%/ÇË×ìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ9;FÇÊÖìðüìðüìðüìðüÇÊÖ9;F†Š•ìðüìðüìðüÉÍÙ"%/"%/ÇË×ìðüìðüìðü†‰”ÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞìðüìðüÏÒÞ êîúìðüìðüìðü;=H;=Hìðüìðüìðüëïû[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iëïûìðüìðüìðü;=H;=HìðüìðüìðüêîúÏÒÞìðüìðüÏÒÞåéõìðüìðü»¾ÊÏÒÞìðüìðüìðü®²½ëïûìðüìðüìðü;=H;=HìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞbdoìðüìðüìðüìðüìðüŸ¢® êîúìðüìðüìðü;=H;=HìðüìðüìðüëïûÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞXZeìðüìðüìðü•˜£“–¢ìðüìðüìðü\_j[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i\_jìðüìðüìðü“–¢“–¢ìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞ(ìðüìðüìðü«¯ºÏÒÞìðüìðüìðüFIT\_jìðüìðüìðü“–¢“–¢ìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞŠ�˜ìðüìðüìðüìðüìðüuxƒXZeìðüìðüìðü•˜£“–¢ìðüìðüìðü\_jÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ�“žìðüìðüìðüEGRCEPìðüìðüìðü�“ž[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i�“žìðüìðüìðüCEPDFQìðüìðüìðü�’�ÏÒÞìðüìðüÏÒÞFITìðüìðüìðü‚…�ÏÒÞìðüìðüäèô�“žìðüìðüìðüCEPDFQìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ³¶ÂìðüìðüìðüìðüÛßëNP[�“žìðüìðüìðüEGRCEPìðüìðüìðü�“žÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ¶ºÅìðüìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞìðüìðüìðüº½É[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iº½Éìðüìðüìðü ìðüìðüìðü¹½ÈÏÒÞìðüìðüÏÒÞ}€‹ìðüìðüìðüVXcÏÒÞìðüìðüÐÓߺ½Éìðüìðüìðü ìðüìðüìðüÏÒÞÏÒÞìðüìðüÛßëìðüìðüìðüìðüâæò?BL¶ºÅìðüìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞìðüìðüìðüº½ÉÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÇÊÖìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÉÍÙ[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iÉÍÙìðüìðüØÛçÙÜèìðüìðüÈÌØÏÒÞìðüìðüÏÒÞÆÉÕìðüìðüìðü!#-ÏÒÞìðüìðüÏÒÞÉÍÙìðüìðüØÛçÙÜèìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüâæò?BLÇÊÖìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÉÍÙÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞÌÐÛìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌ[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iÈÌØìðüìðüÙÜèØÛçìðüìðüÉÍÙÏÒÞìðüìðüÏÒÞDFQìðüìðüìðü´·ÃÏÒÞìðüìðüÏÒÞÈÌØìðüìðüÙÜèØÛçìðüìðüÏÒÞÏÒÞìðüìðüìðüìðüìðüâæòìðüìðüìðüâæò?BLÌÐÛìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü½ÀÌÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ´·ÃìðüìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BL[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i¹½Èìðüìðüìðü ìðüìðüìðüº½ÉÏÒÞìðüìðüÏÒÞ©¬¸ìðüìðüìðükmxÏÒÞìðüìðüÏÒÞ¹½Èìðüìðüìðü ìðüìðüìðüÏÒÞÏÒÞìðüìðüìðüÇÊÖ9;F?BLâæòìðüìðüìðüâæò?BL´·ÃìðüìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞ½ÀÌ?BLÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ‘• ìðüìðüìðüADN[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i�’�ìðüìðüìðüDFQCEPìðüìðüìðü�“žÏÒÞìðüìðüÏÒÞ\_jìðüìðüìðüÖÚå ÏÒÞìðüìðüÏÒÞ�’�ìðüìðüìðüDFQCEPìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ?BLâæòìðüìðüìðüâæò?BL‘• ìðüìðüìðüADNÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞZ]hìðüìðüìðü”—¢$[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i[^iìðüìðüìðü“–¢“–¢ìðüìðüìðü\_jÏÒÞìðüìðüÏÒÞ,/9Þâîìðüìðüìðüps~ÏÒÞìðüìðüÏÒÞ[^iìðüìðüìðü“–¢“–¢ìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ?BLâæòìðüìðüìðüâæò?BLZ]hìðüìðüìðü”—¢$ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞæêöìðüìðüìðü8:E69CÓ×ãìðü‹Ž™[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iêîúìðüìðüìðü;=H;=HìðüìðüìðüëïûÏÒÞìðüìðüÏÒÞ$&1ÊÎÚìðüìðüìðü·»ÆÏÒÞìðüìðüÏÒÞêîúìðüìðüìðü;=H;=HìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ?BLâæòìðüìðüìðüâæò?BLæêöìðüìðüìðü8:E69CÓ×ãìðü‹Ž™ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞˆ‹—ìðüìðüìðüÇË×$&1$&1ÊÎÚìðüìðüìðü([^iìðüìðüìðü[^i[^iìðüìðüìðü[^i…ˆ“ìðüìðüìðüÇË×"%/"%/ÇË×ìðüìðüìðü†‰”%'2[^i%'2ÏÒÞìðüìðüÏÒÞOR]Ûßëìðüìðüìðüìðü47AÏÒÞìðüìðüÏÒÞ…ˆ“ìðüìðüìðüÇË×"%/"%/ÇË×ìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ?BLâæòìðüìðüìðüâæò?BLˆ‹—ìðüìðüìðüÇË×$&1$&1ÊÎÚìðüìðüìðü(ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ"Üàììðüìðüìðü×Ûæ_bl  + ]`kÔØäìðüìðüìðüÛßë[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i'×ÛæìðüìðüìðüÙÜè`bm  `bmÙÜèìðüìðüìðüØÛç'%'2âæòìðüâæò%'2ÏÒÞìðüìðüÏÒÞSV`ª­¹ìðüìðüìðüìðüìðüSV`ÏÒÞìðüìðüÏÒÞ'×ÛæìðüìðüìðüÙÜè`bm  `bmÙÜèìðüìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ?BLâæòìðüìðüìðüâæò?BL"Üàììðüìðüìðü×Ûæ_bl  + ]`kÔØäìðüìðüìðüÛßëÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞNP[ìðüìðüìðüìðüìðüìðüÖÚåìðüìðüìðüìðüìðüìðüLNY[^iìðüìðüìðü[^i[^iìðüìðüìðü[^iQT_ìðüìðüìðüìðüìðüëïûÑÕáìðüìðüìðüìðüìðüìðüQT_jlwìðüìðüìðü[^iÏÒÞìðüìðüÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÝáíìðüìðüìðüìðüìðüìðüìðü]`kÏÒÞìðüìðüÏÒÞQT_ìðüìðüìðüìðüìðüëïûÑÕáìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ?BLâæòìðüìðüìðüâæò?BLNP[ìðüìðüìðüìðüìðüìðüÖÚåìðüìðüìðüìðüìðüìðüLNY‰Œ—ÏÒÞ‰Œ—ÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ\_jìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü^ak[^iìðüìðüìðü[^i[^iìðüìðüìðü[^i]`kìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü]`k¢¥°ìðüìðüìðü24>ÏÒÞìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÅÈÔ8:EÏÒÞìðüìðüÏÒÞ]`kìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÏÒÞìðüìðüÏÒÞÏÒÞìðüìðüÏÒÞ?BLâæòìðüìðüìðü½ÀÌ\_jìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðü^akNP[ìðüìðüìðüNP[½ÀÌìðüìðü½À̽ÀÌìðüìðü½ÀÌ<>I¹½Èìðüìðüìðüìðüìðüìðüìðü·»Æ?BLNP[ìðüìðüìðüNP[NP[ìðüìðüìðüNP[<>I¹½Èìðüìðüìðüìðüìðüìðüìðü¹½È;=HÙÜèìðüìðüÙÝé½ÀÌìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüìðüÙÜènq|½ÀÌìðüìðü½ÀÌ<>I¹½Èìðüìðüìðüìðüìðüìðüìðü¹½È;=H½ÀÌìðüìðü½À̽ÀÌìðüìðü½ÀÌ?BLâæòìðüìðü½ÀÌ<>I¹½Èìðüìðüìðüìðüìðüìðüìðü·»Æ?BLNP[ìðüìðüìðüNP[?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BLFIT�”Ÿ¾ÂÎÇË×¼¿Ë’•¡GJT‰Œ—ÏÒÞ‰Œ—‰Œ—ÏÒÞ‰Œ—OQ\�“ž¼¿ËÏÒÞ»¾Ê�’�OQ\13>ìðüìðüìðü¢¥°?BL½ÀÌÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÏÒÞÆÉÕ­±¼Š�˜HKU?BL½À̽ÀÌ?BLOQ\�“ž¼¿ËÏÒÞ»¾Ê�’�OQ\?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BL?BL½À̽ÀÌ?BLFIT�”Ÿ¾ÂÎÇË×¼¿Ë’•¡GJT‰Œ—ÏÒÞ‰Œ—jlwìðüìðüìðükmx¢¥°ìðüìðüìðü24>ÏÒÞìðüìðüÙÝ鉌—ìðüìðü‰Œ—NP[NP[‚‰ªœ¤Êœ¤Êœ¤Êœ¤Êœ¤Êœ¤Êœ¤Êœ¤Êœ¤Êœ¤Êœ¤Êœ¤Êœ¤Ê#&6Ž•¸X^w�—ºV[t?DXx~�“›¾”œ¿v}›>BVŒ”¶¨±Ø¨±Ø¨±Ø¨±Ø¨±Ø¨±ØÇÑþ¨±Ø¨±Ø¨±Ø¨±Ø¨±Ø¨±Ø)-=ÈÒÿ{�¡ + ÈÒÿx~�$'7˜ ÄÈÒÿÈÒÿ³¼å³¼åÈÒÿÈÒÿ•�Á #2~…¤ÇÑþ ÈÒÿ{�¡!8=PÄÎú59L8=PÄÎú59L + ÈÒÿx~�!/3E¾ÇòÈÒÿkq�, .lr�ÈÒÿ¹Âí+.?~…¤ÇÑþ ÈÒÿ{�¡'ÈÒÿag�BG\ÈÒÿ?DXBG\ÈÒÿ?DX + ÈÒÿx~�'ÈÒÿag�±»äÅÏü8=PBVÈÒÿX]v~…¤ÇÑþ ÈÒÿ{�¡BVlr�x~�x~�ÈÒÿx~�x~�x~�x~�X]vlr�@DY[a{X]vEI_jpŒ59Kio‹u|šU[snt‘>BV?DXkrŽu|š\b{ #259Kio‹u|šU[s + ÈÒÿx~�lr�@DY;?SkrŽv}›Z_y+59Kio‹u|šU[snt‘>BVlr�@DY[a{X]vEI_jpŒlr�@DYBV59Kio‹u|šU[snt‘>BV~…¤ÇÑþ ÈÒÿ{�¡•œÀÈÒÿÈÒÿÈÒÿÈÒÿÈÒÿflˆ,ÈÒÿgmˆ%•�ÁÈÒÿÈÒÿÈÒÿÈÒÿÈÒÿci„´¾çÈÒÿÈÒÿÈÒÿÈÒÿÈÒÿÈÒÿÈÒÿ‘™½|ƒ¢ÈÒÿÈÒÿÈÒÿÈÒÿ¾ÈóLQh´¾ç¾Çò(,<gmˆÈÒÿnt‘´¾çÈÒÿÈÒÿÈÒÿÈÒÿÈÒÿÈÒÿÈÒÿ‘™½¼Æñ“›¾¼Æñµ¾è™¡Æµ¾è}„£ÈÒÿÈÒÿÈÒÿÈÒÿ¿ÉôLQhÈÒÿx~�%•�ÁÈÒÿÈÒÿÈÒÿÈÒÿÈÒÿci„}„£ÈÒÿÈÒÿÈÒÿÈÒÿ¿ÉôLQhÈÒÿx~� ÈÒÿ{�¡•�ÁÈÒÿÈÒÿÈÒÿÈÒÿ€‡§}„£ÈÒÿÈÒÿÈÒÿÈÒÿ¿ÉôLQhÈÒÿx~�¼Æñ“›¾¼Æñµ¾è™¡Æµ¾è ÈÒÿ{�¡•œÀÈÒÿÈÒÿÈÒÿÈÒÿÈÒÿflˆ,ÈÒÿgmˆ ÈÒÿ{�¡•œÀÈÒÿÈÒÿÈÒÿÈÒÿÈÒÿflˆ·Àê“›¾™¡Æ°¹â ÈÒÿ{�¡ÈÒÿÈÒÿÈÒÿÈÒÿÁÊöINdMRiÃÍùÈÒÿÈÒÿÈÒÿÈÒÿag�|ƒ¢ÈÒÿÈÒÿÈÒÿÈÒÿ¾ÈóLQh}„£ÈÒÿÈÒÿÈÒÿÈÒÿ¿ÉôLQhÈÒÿx~�}„£ÈÒÿÈÒÿÈÒÿÈÒÿ¿ÉôLQhÈÒÿx~�~…¤ÇÑþ ÈÒÿ¥­ÔÈÒÿhn‰!$38BV8BV¬µÝÈÒÿÈÒÿ¨±Ø<@S 04F•œÀÈÒÿFKa‚‰ªÈÒÿ{�¡%)9DH^¬µÝÈÒÿ>BV�ˆ¨ÈÒÿ{�¡&*9CH]«´ÜÈÒÿÈÒÿx~��ˆ¨ÈÒÿ{�¡&*9CH]«´ÜÈÒÿÈÒÿx~�~…¤ÇÑþ ÈÒÿÈÒÿQVn’š½ÈÒÿ .,ÈÒÿgmˆ#ÈÒÿw~œ +MRiBG\ÈÒÿ?DX@DYÈÒÿv}›"0»Ä葉ÕRWnÈÒÿŒ”¶59LÈÒÿ§¯× BG\ÈÒÿ?DXAEZÈÒÿU[s~…¥ÈÒÿÈÒÿxž[a{ÈÒÿ;?S@DYÈÒÿw~œ"0»ÄïÈÒÿx~�#ÈÒÿw~œ +MRi@DYÈÒÿw~œ"0»ÄïÈÒÿx~� ÈÒÿÈÒÿQVn@DYÈÒÿw~œ"0»ÄïÈÒÿx~�AEZÈÒÿU[s~…¥ÈÒÿÈÒÿxž[a{ÈÒÿ;?S ÈÒÿÈÒÿQVn’š½ÈÒÿ .,ÈÒÿgmˆ ÈÒÿÈÒÿQVn’š½ÈÒÿ .ÄÎú‚‰©‡Ž°¾Èó ÈÒÿ´¾ç + /2DÈÒÿÈÒÿ)-=»ÄÆ@DYÈÒÿv}›"0»Ä葉Õ@DYÈÒÿw~œ"0»ÄïÈÒÿx~�@DYÈÒÿw~œ"0»ÄïÈÒÿx~�~…¤ÇÑþ ÈÒÿ¡©Ï8=PÈÒÿZ_y,ÈÒÿgmˆÈÒÿƒŠ«BG\ÈÒÿ?DXˆ�°ÇÑþ$]c|ÈÒÿ;?SjpŒÈÒÿsz— .²»äÀÊõ+.?BG\ÈÒÿ?DX¼Æñ“›¾¼Æñ“›¾™¡Æµ¾è™¡Æµ¾èˆ�°ÈÒÿ#]c|ÈÒÿx~�ÈÒÿƒŠ«ˆ�°ÈÒÿ#]c|ÈÒÿx~� ÈÒÿ¡©Ïˆ�°ÈÒÿ#]c|ÈÒÿx~�¼Æñ“›¾¼Æñ“›¾™¡Æµ¾è™¡Æµ¾è ÈÒÿ¡©Ï8=PÈÒÿZ_y,ÈÒÿgmˆ ÈÒÿ¡©Ï8=PÈÒÿZ_y·Àê’š½˜ Ä±ºã ÈÒÿ€‡§«´Ü¥­Ô‡Ž°¾Èóˆ�°ÇÑþ$]c|ÈÒÿ;?Sˆ�°ÈÒÿ#]c|ÈÒÿx~�ˆ�°ÈÒÿ#]c|ÈÒÿx~�~…¤ÇÑþ ÈÒÿ~…¥ÈÒÿu{™,ÈÒÿgmˆ|ƒ¢ÈÒÿ‚‰©?CW*.>"BG\ÈÒÿ?DXµ¾è’š½,/@,/@,/@,/@,/@,/@,/@ÈÒÿek‡ƒŠ«ÈÒÿš¢ÇÈÒÿDH^BG\ÈÒÿ?DX~…¥ÈÒÿ)AEZÈÒÿU[s[a{ÈÒÿ;?S"0ÈÒÿxž¶¿é“›¾%)9ÈÒÿx~�|ƒ¢ÈÒÿ‚‰©?CW*.>"¶¿é“›¾%)9ÈÒÿx~� ÈÒÿ~…¥¶¿é“›¾%)9ÈÒÿx~�~…¥ÈÒÿ)AEZÈÒÿU[s[a{ÈÒÿ;?S"0ÈÒÿxž ÈÒÿ~…¥ÈÒÿu{™,ÈÒÿgmˆ ÈÒÿ~…¥ÈÒÿu{™‘™½·Àê½Æñ�•· ÈÒÿ{�¡¥®ÕŸ¨Í�ˆ¨ÄÎúµ¾è’š½,/@,/@,/@,/@,/@,/@,/@ÈÒÿek‡¶¿é“›¾%)9ÈÒÿx~�¶¿é“›¾%)9ÈÒÿx~�~…¤ÇÑþ ÈÒÿ{�¡ + ÈÒÿx~�,ÈÒÿgmˆy€ŸÈÒÿÈÒÿÈÒÿÈÒÿ�•·(,<BG\ÈÒÿ?DXÇÑþÈÒÿÈÒÿÈÒÿÈÒÿÈÒÿÈÒÿÈÒÿÈÒÿÈÒÿw~œ›¤ÉÈÒÿ\b{BG\ÈÒÿ?DXAEZÈÒÿU[s~…¥ÈÒÿ)"0ÈÒÿxž[a{ÈÒÿ;?S ÈÒÿ|ƒ¢ ÈÒÿx~�y€ŸÈÒÿÈÒÿÈÒÿÈÒÿ�•·(,< ÈÒÿ|ƒ¢ ÈÒÿx~� ÈÒÿ{�¡ ÈÒÿ|ƒ¢ ÈÒÿx~�AEZÈÒÿU[s~…¥ÈÒÿ)"0ÈÒÿxž[a{ÈÒÿ;?S ÈÒÿ{�¡ + ÈÒÿx~�,ÈÒÿgmˆ ÈÒÿ{�¡ + ÈÒÿx~�`f€ÈÒÿ6:M<@SÈÒÿ[`z ÈÒÿ{�¡¥®ÕŸ¨Í�ˆ¨ÄÎúÇÑþÈÒÿÈÒÿÈÒÿÈÒÿÈÒÿÈÒÿÈÒÿÈÒÿÈÒÿw~œ ÈÒÿ|ƒ¢ ÈÒÿx~� ÈÒÿ|ƒ¢ ÈÒÿx~�~…¤ÇÑþ ÈÒÿ{�¡ + ÈÒÿx~�,ÈÒÿgmˆ!/KPgY_x}„£ÈÒÿ»Äï!$3BG\ÈÒÿ?DX¼Æñ‹’´V[tV[tV[tV[tV[tV[tV[tV[t%)9gmˆÈÒÿ´¾ç¾Çò(,<BG\ÈÒÿ?DX¼Æñ“›¾¼Æñ“›¾™¡Æµ¾è™¡Æµ¾è¾Èó‹’´-ÈÒÿx~�!/KPgY_x}„£ÈÒÿ»Äï!$3¾Èó‹’´-ÈÒÿx~� ÈÒÿ{�¡¾Èó‹’´-ÈÒÿx~�¼Æñ“›¾¼Æñ“›¾™¡Æµ¾è™¡Æµ¾è ÈÒÿ{�¡ + ÈÒÿx~�,ÈÒÿgmˆ ÈÒÿ{�¡ + ÈÒÿx~�#&6ÈÒÿ†�¯Œ”¶ÈÒÿ . ÈÒÿ{�¡¥®ÕŸ¨Í�ˆ¨ÄÎú¼Æñ‹’´V[tV[tV[tV[tV[tV[tV[tV[t%)9¾Èó‹’´-ÈÒÿx~�¾Èó‹’´-ÈÒÿx~�~…¤ÇÑþ ÈÒÿ{�¡ + ÈÒÿx~�,ÈÒÿgmˆ<@SÈÒÿrx•BG\ÈÒÿ?DX•œÀ¸ÂìOTkÈÒÿŽ–¹8" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Stable application presentation; see PRESENTATION.md for scope and ownership. +global Ds ulong 8 +global Dt ulong 64 +global Dtext uchar 2304 +global Dsay ulong 1 +global Dm ulong 3 +global Dcode uchar 32768 +global Dstart ulong 4096 +global Dlen ulong 4096 +global Dline ulong 4096 +global Dview ulong 3 +global Din uchar 8192 +fn dscene to bool +n = get Inlen 0 +for i ulong 8192 +put Din i get In i +end +for i ulong get R 8 +put In i get Answer i +end +put Inlen 0 get R 8 +ok = scdecode +for i ulong 8192 +put In i get Din i +end +put Inlen 0 n +if not ok +ret false +end +for i ulong 8 +put Ds i get Sc i +end +for i ulong 64 +put Dt i get Things i +end +for i ulong 2304 +put Dtext i 0 +end +for i ulong get Sc 4 +put Dtext i get Stext i +end +put Dsay 0 get Sw 3 +put Dm 0 1 +ret true +end +fn dcode to bool +if or le get R 2 1 ne get R 1 0 +ret false +end +if or eq get R 6 0 ne get C 0 get R 0 +ret false +end +if not rows 80 4096 +ret false +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong get C 2 +put Dcode i get Code i +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong get View 0 +put Dstart i get Rowst i +put Dlen i get Rowlen i +put Dline i get Rowline i +end +put Dview 0 get View 0 +put Dview 1 0 +put Dview 2 get C 2 +put Dm 1 1 +ret true +end +fn dpresent to bool +if or eq get A 0 0 ne get A 2 1 +ret false +end +if or gt get R 8 159 gt get Inlen 0 8192 +ret false +end +shown = dscene +coded = dcode +if or shown coded +put Dm 2 get R 0 +ret true +end +ret false +end +fn dask now ulong to bool +if not appask now +ret false +end +b = dpresent +ret true +end +fn drecv now ulong to bool +if not appreceive now +ret false +end +b = dpresent +ret true +end +fn dreset to void +appreset +for i ulong 8 +put Ds i 0 +end +for i ulong 64 +put Dt i 0 +end +for i ulong 2304 +put Dtext i 0 +end +put Dsay 0 0 +for i ulong 3 +put Dm i 0 +put Dview i 0 +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong 8192 +put Din i 0 +end +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +dreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not dask now +ret 0 +end +else +if not drecv now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +note Declarative Allen glyph designs and integer sine samples, retained from +note native/kernel/ui/allen_font.c at4c7888f. No foreign executable implementation. +text Afdata "w6|w6 M3,0 L3,14 D3,20|w10 M3,0 L3,5 M7,0 L7,5|w15 M6,2 L4,20 M11,2 L9,20 M2,8 L13,8 M1,14 L12,14|w15 A8,5,5,5,-30,-270 A8,15,5,5,270,510 M8,-2 L8,22|w16 A4,4,2,3,0,360 A12,16,2,3,0,360 M13,1 L3,19|w16 M14,20 L5,9 A7,5,3,4,150,400 L3,14 A7,15,4,5,180,60 L13,11|w6 M3,0 L3,5|w9 A10,10,6,12,240,120|w9 A-1,10,6,12,-60,60|w14 M7,2 L7,10 M3,4 L11,8 M11,4 L3,8|w14 M2,12 L12,12 M7,7 L7,17|w6 M3,19 L2,23|w11 M2,13 L9,13|w6 D3,20|w12 M10,0 L2,20|w14 A7,10,5,10,0,360|w14 M3,4 L8,0 L8,20|w14 A7,6,5,6,200,400 L2,20 L12,20|w14 A7,5,5,5,200,450 A7,15,5,5,270,520|w14 M10,20 L10,0 L1,14 L13,14|w14 M12,0 L4,0 L4,9 A7,14,5,6,235,520|w14 A7,14,5,6,0,360 M10,0 L3,11|w14 M2,0 L12,0 L5,20|w14 A7,5,4,5,0,360 A7,15,5,5,0,360|w14 A7,6,5,6,0,360 M4,20 L11,9|w6 D3,8 D3,20|w6 D3,8 M3,19 L2,23|w14 M12,6 L2,12 L12,18|w14 M2,10 L12,10 M2,15 L12,15|w14 M2,6 L12,12 L2,18|w14 A7,5,5,5,190,450 L7,14 D7,20|w19 A9,12,3,4,0,360 M12,8 L12,14 A14,14,2,2,180,0 A9,11,7,9,0,-300|w16 M2,20 L8,0 L14,20 M4,13 L12,13|w15 M2,0 L2,20 M2,0 L8,0 A8,5,4,5,270,450 L2,10 M2,10 L9,10 A9,15,4,5,270,450 L2,20|w17 A9,10,7,10,45,315|w16 M2,0 L2,20 M2,0 L6,0 A6,10,8,10,270,450 L2,20|w14 M12,0 L2,0 L2,20 L12,20 M2,10 L10,10|w13 M12,0 L2,0 L2,20 M2,10 L10,10|w18 A9,10,7,10,-45,-360 M11,10 L16,10|w16 M2,0 L2,20 M14,0 L14,20 M2,10 L14,10|w6 M3,0 L3,20|w13 M10,0 L10,14 A6,14,4,6,0,180|w15 M2,0 L2,20 M13,0 L2,12 M6,8 L14,20|w13 M2,0 L2,20 L12,20|w20 M2,20 L2,0 L10,14 L18,0 L18,20|w16 M2,20 L2,0 L14,20 L14,0|w20 A10,10,8,10,0,360|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10|w20 A10,10,8,10,0,360 M12,14 L18,21|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10 M8,10 L14,20|w16 A8,5,5,5,-30,-270 A8,15,5,5,270,510|w16 M1,0 L15,0 M8,0 L8,20|w16 M2,0 L2,13 A8,13,6,7,180,0 L14,0|w16 M1,0 L8,20 L15,0|w22 M1,0 L6,20 L11,0 L16,20 L21,0|w16 M2,0 L14,20 M14,0 L2,20|w16 M1,0 L8,10 L15,0 M8,10 L8,20|w16 M2,0 L14,0 L2,20 L14,20|w9 M7,-1 L3,-1 L3,21 L7,21|w12 M2,0 L10,20|w9 M2,-1 L6,-1 L6,21 L2,21|w12 M2,8 L6,1 L10,8|w14 M1,23 L13,23|w7 M2,0 L4,4|w15 A7,14,5,6,0,360 M12,8 L12,20|w15 M2,0 L2,20 A7,14,5,6,0,360|w13 A7,14,5,6,40,320|w15 A7,14,5,6,0,360 M12,0 L12,20|w14 M2,14 L12,14 A7,14,5,6,0,-320|w11 M5,20 L5,4 A9,4,4,4,180,300 M2,8 L10,8|w15 A7,14,5,6,0,360 M12,8 L12,22 A7,22,5,5,0,150|w15 M2,0 L2,20 A7,13,5,5,180,360 L12,20|w6 M3,8 L3,20 D3,3|w7 M4,8 L4,22 A0,22,4,5,0,120 D4,3|w13 M2,0 L2,20 M11,8 L2,15 M5,13 L12,20|w6 M3,0 L3,20|w21 M2,8 L2,20 A6,12,4,4,180,360 L10,20 A14,12,4,4,180,360 L18,20|w15 M2,8 L2,20 A7,13,5,5,180,360 L12,20|w14 A7,14,5,6,0,360|w15 M2,8 L2,27 A7,14,5,6,0,360|w15 A7,14,5,6,0,360 M12,8 L12,27|w10 M2,8 L2,20 A7,13,5,5,180,290|w14 A7,11,4,3,-30,-270 A7,17,4,3,270,510|w11 M5,2 L5,17 A8,17,3,3,180,40 M2,8 L10,8|w15 M2,8 L2,15 A7,15,5,5,180,0 M12,8 L12,20|w14 M2,8 L7,20 L12,8|w20 M2,8 L6,20 L10,8 L14,20 L18,8|w14 M2,8 L12,20 M12,8 L2,20|w14 M2,8 L7,20 M12,8 L4,27|w14 M2,8 L12,8 L2,20 L12,20|w10 M8,-1 L6,0 L6,8 L4,10 L6,12 L6,20 L8,21|w6 M3,-1 L3,23|w10 M2,-1 L4,0 L4,8 L6,10 L4,12 L4,20 L2,21|w14 M2,13 L5,11 L9,14 L12,12|" +text Afsines "0 286 572 857 1143 1428 1713 1997 2280 2563 2845 3126 3406 3686 3964 4240 4516 4790 5063 5334 5604 5872 6138 6402 6664 6924 7182 7438 7692 7943 8192 8438 8682 8923 9162 9397 9630 9860 10087 10311 10531 10749 10963 11174 11381 11585 11786 11982 12176 12365 12551 12733 12911 13085 13255 13421 13583 13741 13894 14044 14189 14330 14466 14598 14726 14849 14968 15082 15191 15296 15396 15491 15582 15668 15749 15826 15897 15964 16026 16083 16135 16182 16225 16262 16294 16322 16344 16362 16374 16382 16384 " +note Handwritten bounded Allen stroke rasterizer. Legacy C is an external oracle only. +global Af ulong 6 +global Ab long 4 +global Ag long 640 +global Alpha uchar 65536 +global Asin long 91 +global Afpos ulong 2 +global Apen long 2 +global Arc long 6 +fn afsqrt value ulong to ulong +r = ulong 0 +bit = shl ulong 1 62 +while gt bit value +bit = shr bit 2 +end +while ne bit 0 +if ge value add r bit +value = sub value add r bit +r = add shr r 1 bit +else +r = shr r 1 +end +bit = shr bit 2 +end +ret r +end +fn afsin deg long to long +a = rem deg 360 +if lt a 0 +a = add a 360 +end +if le a 90 +ret get Asin ulong a +end +if le a 180 +ret get Asin ulong sub long 180 a +end +if le a 270 +ret neg get Asin ulong sub a 180 +end +ret neg get Asin ulong sub long 360 a +end +fn afcos deg long to long +ret afsin add rem deg 360 90 +end +fn afinit cap ulong wt ulong to bool +if or eq cap 0 gt cap 64 +ret false +end +if or eq wt 0 gt wt 2500 +ret false +end +for i ulong 6 +put Af i 0 +end +put Af 0 div mul cap 256 20 +put Af 1 div mul wt get Af 0 1000 +v = long 0 +slot = ulong 0 +for i ulong len Afsines +c = get Afsines i +if eq c 32 +put Asin slot v +slot = add slot 1 +v = 0 +else +v = add mul v 10 sub long c 48 +end +end +ret eq slot 91 +end +fn afpick c uchar to bool +if or lt c 32 gt c 126 +c = 63 +end +wanted = sub ulong c 32 +slot = ulong 0 +startat = ulong 0 +for i ulong len Afdata +if eq get Afdata i 124 +if eq slot wanted +put Afpos 0 startat +put Afpos 1 i +ret true +end +slot = add slot 1 +startat = add i 1 +end +end +ret false +end +fn afnum to long +p = get Afpos 0 +minus = false +if eq get Afdata p 45 +minus = true +p = add p 1 +end +v = long 0 +go = true +while and lt p get Afpos 1 go +c = get Afdata p +if and ge c 48 le c 57 +v = add mul v 10 sub long c 48 +p = add p 1 +else +go = false +end +end +if lt p get Afpos 1 +if eq get Afdata p 44 +p = add p 1 +end +end +put Afpos 0 p +if minus +ret neg v +end +ret v +end +fn afseg nx long ny long to bool +n = get Af 2 +if ge n 160 +ret false +end +at = mul n 4 +put Ag at get Apen 0 +put Ag add at 1 get Apen 1 +put Ag add at 2 nx +put Ag add at 3 ny +put Apen 0 nx +put Apen 1 ny +put Af 2 add n 1 +ret true +end +fn afpoint a long first bool to bool +s = long get Af 0 +x = mul get Arc 0 s +x = add x div mul mul get Arc 2 s afcos a 16384 +y = mul sub get Arc 1 20 s +y = add y div mul mul get Arc 3 s afsin a 16384 +if first +put Apen 0 x +put Apen 1 y +ret true +end +ret afseg x y +end +fn afarc to bool +for i ulong 6 +put Arc i afnum +end +span = sub get Arc 5 get Arc 4 +if lt span 0 +span = neg span +end +steps = div span 9 +if lt steps 2 +steps = 2 +end +for k ulong ulong add steps 1 +a = sub get Arc 5 get Arc 4 +a = add get Arc 4 div mul a long k steps +if not afpoint a eq k 0 +ret false +end +end +ret true +end +fn afcmd cmd uchar to bool +if eq cmd 32 +ret true +end +if eq cmd 119 +put Af 5 mul ulong afnum get Af 0 +ret true +end +if eq cmd 65 +ret afarc +end +x = mul afnum long get Af 0 +y = mul sub afnum 20 long get Af 0 +if or eq cmd 77 eq cmd 68 +put Apen 0 x +put Apen 1 y +end +if eq cmd 77 +ret true +end +if or eq cmd 76 eq cmd 68 +ret afseg x y +end +ret false +end +fn affloor value long to long +if ge value 0 +ret div value 256 +end +ret neg div add neg value 255 256 +end +fn afbound x long y long to void +if lt x get Ab 0 +put Ab 0 x +end +if lt y get Ab 1 +put Ab 1 y +end +if gt x get Ab 2 +put Ab 2 x +end +if gt y get Ab 3 +put Ab 3 y +end +end +fn afbox to bool +put Ab 0 get Ag 0 +put Ab 2 get Ag 0 +put Ab 1 get Ag 1 +put Ab 3 get Ag 1 +for i ulong get Af 2 +at = mul i 4 +afbound get Ag at get Ag add at 1 +afbound get Ag add at 2 get Ag add at 3 +end +pad = add long get Af 1 256 +x0 = affloor sub get Ab 0 pad +y0 = affloor sub get Ab 1 pad +x1 = add affloor add get Ab 2 pad 1 +y1 = add affloor add get Ab 3 pad 1 +put Ab 0 x0 +put Ab 1 y0 +put Af 3 ulong sub x1 x0 +put Af 4 ulong sub y1 y0 +ret le mul get Af 3 get Af 4 len Alpha +end +fn afproj qx long qy long dx long dy long to ulong +len2 = add mul dx dx mul dy dy +ex = qx +ey = qy +if ne len2 0 +t = add mul qx dx mul qy dy +if gt t 0 +if ge t len2 +ex = sub qx dx +ey = sub qy dy +else +ex = sub qx div mul dx t len2 +ey = sub qy div mul dy t len2 +end +end +end +ret ulong add mul ex ex mul ey ey +end +fn afdist slot ulong px long py long to ulong +at = mul slot 4 +dx = sub get Ag add at 2 get Ag at +dy = sub get Ag add at 3 get Ag add at 1 +qx = sub px get Ag at +qy = sub py get Ag add at 1 +ret afproj qx qy dx dy +end +fn afalpha px long py long to uchar +best = ulong 18446744073709551615 +for i ulong get Af 2 +d2 = afdist i px py +if lt d2 best +best = d2 +end +end +d = long afsqrt best +cov = sub add long get Af 1 128 d +if le cov 0 +ret 0 +end +if ge cov 256 +ret 255 +end +ret uchar div mul cov 255 256 +end +fn afrow y ulong to void +py = add mul add get Ab 1 long y 256 128 +for x ulong get Af 3 +px = add mul add get Ab 0 long x 256 128 +at = add mul y get Af 3 x +put Alpha at afalpha px py +end +end +fn afpaint to void +for y ulong get Af 4 +afrow y +end +end +fn afglyph c uchar to bool +if eq get Af 0 0 +ret false +end +if not afpick c +ret false +end +for i ulong 65536 +put Alpha i 0 +end +put Af 2 0 +put Af 3 0 +put Af 4 1 +put Af 5 0 +put Ab 0 0 +put Ab 1 0 +put Apen 0 0 +put Apen 1 0 +while lt get Afpos 0 get Afpos 1 +cmd = get Afdata get Afpos 0 +put Afpos 0 add get Afpos 0 1 +if not afcmd cmd +ret false +end +end +if eq get Af 2 0 +ret true +end +if not afbox +ret false +end +afpaint +ret true +end +note Compilable surface negative control. +global Canvas uchar 884736 +global Cv ulong 8 +global Cvpose long 2 +fn cvinit w ulong h ulong to bool +ret false +end +fn cvclip x ulong y ulong w ulong h ulong to bool +ret false +end +fn cvpixel x long y long a uchar color ulong to void +end +fn cvglyph c uchar x long y long color ulong to bool +ret false +end +fn cvspan start ulong size ulong x long y long color ulong to bool +ret false +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +note Surface tests: removing clipping, using constant background or bypassing drawing must fail. +global Csave uchar 4096 +global Cmeta ulong 8 +fn test ok bool to void +check ok add get Checks 0 1 +end +fn cvkeep to void +for i ulong 3072 +put Csave i get Canvas i +end +for i ulong 8 +put Cmeta i get Cv i +end +end +fn cvsame to bool +for i ulong 3072 +if ne get Canvas i get Csave i +ret false +end +end +for i ulong 8 +if ne get Cv i get Cmeta i +ret false +end +end +ret true +end +fn cvrefclip to bool +ink = ulong 0 +for y ulong 32 +for x ulong 32 +at = mul add mul y 32 x 3 +inside = and ge x 8 lt x 16 +inside = and inside and ge y 8 lt y 16 +for k ulong 3 +v = uchar 6 +if eq k 1 +v = 8 +end +if eq k 2 +v = 18 +end +if inside +v = get Csave add at k +if ne v get Canvas add at k +ret false +end +if gt v 18 +ink = add ink 1 +end +else +if ne get Canvas add at k v +ret false +end +end +end +end +end +ret gt ink 0 +end +fn main to int +test not cvglyph 65 0 0 15528188 +test not cvinit 0 32 +test not cvinit 32 0 +test not cvinit 769 32 +test not cvinit 32 385 +test cvinit 32 32 +test eq get Cv 0 32 +test eq get Cv 1 32 +test eq get Cv 4 32 +test eq get Cv 5 32 +test eq get Canvas 0 6 +test eq get Canvas 1 8 +test eq get Canvas 2 18 +test eq get Canvas 3071 18 +test eq get Canvas 3072 0 +test not cvglyph 65 0 0 15528188 +test afinit 20 1000 +note Exact alpha arithmetic and repeated overlap must use current destination. +cvpixel 0 0 0 15528188 +test eq get Canvas 0 6 +cvpixel 0 0 128 15528188 +test eq get Canvas 0 121 +test eq get Canvas 1 124 +test eq get Canvas 2 135 +cvpixel 0 0 128 15528188 +test eq get Canvas 0 178 +test eq get Canvas 1 182 +test eq get Canvas 2 193 +cvpixel 0 0 255 15528188 +test eq get Canvas 0 236 +test eq get Canvas 1 240 +test eq get Canvas 2 252 +cvkeep +cvpixel -1 0 255 0 +cvpixel 0 -1 255 0 +cvpixel 32 0 255 0 +cvpixel 0 32 255 0 +test cvsame +test not cvinit 18446744073709551615 1 +test cvsame +test not cvclip 33 0 0 0 +test not cvclip 0 33 0 0 +test not cvclip 0 0 33 1 +test not cvclip 0 0 1 33 +test not cvclip 1 1 18446744073709551615 1 +test cvsame +test not cvglyph 65 -4097 0 15528188 +test not cvglyph 65 4097 0 15528188 +test not cvglyph 65 0 -4097 15528188 +test not cvglyph 65 0 4097 15528188 +test not cvglyph 65 0 0 16777216 +test cvsame +note Independent reference crop of the already rendered glyph. +test cvinit 32 32 +test cvglyph 65 4 24 15528188 +test gt get Cv 7 0 +cvkeep +test cvinit 32 32 +test cvclip 8 8 8 8 +put Canvas 3072 165 +test cvglyph 65 4 24 15528188 +test cvrefclip +test eq get Canvas 3072 165 +note Zero-area and edge clips cannot draw any pixel. +test cvinit 32 32 +test cvclip 32 32 0 0 +cvkeep +test cvglyph 65 -8 6 15528188 +put Cmeta 7 get Cv 7 +test cvsame +note A negative origin that intersects the surface must draw without wrapping. +test cvclip 0 0 32 32 +test cvglyph 65 -8 6 15528188 +ink = ulong 0 +for i ulong 3072 +if gt get Canvas i 18 +ink = add ink 1 +end +end +test gt ink 0 +test eq get Canvas 3072 0 +note Explicit retained-text span agrees with two separately positioned glyphs. +put Dtext 0 65 +put Dtext 1 65 +test cvinit 32 32 +test cvspan 0 2 1 24 15528188 +advance = get Cv 7 +cvkeep +test cvinit 32 32 +test cvglyph 65 1 24 15528188 +one = get Cv 7 +x = add long 1 long div one 256 +test cvglyph 65 x 24 15528188 +test eq advance mul one 2 +same = true +for i ulong 3072 +if ne get Canvas i get Csave i +same = false +end +end +test same +note Refused spans and extreme offsets preserve pixels and all surface metadata. +cvkeep +test not cvspan 2305 0 0 0 0 +test not cvspan 2304 1 0 0 0 +test not cvspan 1 18446744073709551615 0 0 0 +test not cvspan 0 1 0 0 18446744073709551615 +test not cvspan 0 1 -4097 0 0 +test cvsame +test cvspan 2304 0 0 0 0 +test eq get Cv 7 0 +test eq get Dtext 0 65 +test eq get Dtext 1 65 +test cvinit 768 384 +test eq get Cv 0 768 +test eq get Cv 1 384 +test eq get Canvas 884735 18 +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L765/red2.exit b/evidence/allen-omega-L694/L765/red2.exit new file mode 100644 index 00000000..d00491fd --- /dev/null +++ b/evidence/allen-omega-L694/L765/red2.exit @@ -0,0 +1 @@ +1 diff --git a/evidence/allen-omega-L694/L765/red2.log b/evidence/allen-omega-L694/L765/red2.log new file mode 100644 index 00000000..c3b876af --- /dev/null +++ b/evidence/allen-omega-L694/L765/red2.log @@ -0,0 +1,79 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 1 +7 1 +8 1 +9 1 +10 1 +11 1 +12 1 +13 1 +14 1 +15 0 +16 0 +17 0 +18 1 +19 1 +20 1 +21 1 +22 1 +23 1 +24 1 +25 1 +26 1 +27 1 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 1 +44 1 +45 1 +46 1 +47 1 +48 1 +49 1 +50 0 +51 1 +52 1 +53 1 +54 0 +55 1 +56 1 +57 1 +58 1 +59 1 +60 1 +61 1 +62 1 +63 1 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 1 +73 0 +74 0 +75 0 +76 1 +77 1 +78 1 +79 1 diff --git a/evidence/allen-omega-L694/L765/red2.om b/evidence/allen-omega-L694/L765/red2.om new file mode 100644 index 00000000..d10916aa --- /dev/null +++ b/evidence/allen-omega-L694/L765/red2.om @@ -0,0 +1,4364 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Stable application presentation; see PRESENTATION.md for scope and ownership. +global Ds ulong 8 +global Dt ulong 64 +global Dtext uchar 2304 +global Dsay ulong 1 +global Dm ulong 3 +global Dcode uchar 32768 +global Dstart ulong 4096 +global Dlen ulong 4096 +global Dline ulong 4096 +global Dview ulong 3 +global Din uchar 8192 +fn dscene to bool +n = get Inlen 0 +for i ulong 8192 +put Din i get In i +end +for i ulong get R 8 +put In i get Answer i +end +put Inlen 0 get R 8 +ok = scdecode +for i ulong 8192 +put In i get Din i +end +put Inlen 0 n +if not ok +ret false +end +for i ulong 8 +put Ds i get Sc i +end +for i ulong 64 +put Dt i get Things i +end +for i ulong 2304 +put Dtext i 0 +end +for i ulong get Sc 4 +put Dtext i get Stext i +end +put Dsay 0 get Sw 3 +put Dm 0 1 +ret true +end +fn dcode to bool +if or le get R 2 1 ne get R 1 0 +ret false +end +if or eq get R 6 0 ne get C 0 get R 0 +ret false +end +if not rows 80 4096 +ret false +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong get C 2 +put Dcode i get Code i +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong get View 0 +put Dstart i get Rowst i +put Dlen i get Rowlen i +put Dline i get Rowline i +end +put Dview 0 get View 0 +put Dview 1 0 +put Dview 2 get C 2 +put Dm 1 1 +ret true +end +fn dpresent to bool +if or eq get A 0 0 ne get A 2 1 +ret false +end +if or gt get R 8 159 gt get Inlen 0 8192 +ret false +end +shown = dscene +coded = dcode +if or shown coded +put Dm 2 get R 0 +ret true +end +ret false +end +fn dask now ulong to bool +if not appask now +ret false +end +b = dpresent +ret true +end +fn drecv now ulong to bool +if not appreceive now +ret false +end +b = dpresent +ret true +end +fn dreset to void +appreset +for i ulong 8 +put Ds i 0 +end +for i ulong 64 +put Dt i 0 +end +for i ulong 2304 +put Dtext i 0 +end +put Dsay 0 0 +for i ulong 3 +put Dm i 0 +put Dview i 0 +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong 8192 +put Din i 0 +end +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +dreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not dask now +ret 0 +end +else +if not drecv now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +note Declarative Allen glyph designs and integer sine samples, retained from +note native/kernel/ui/allen_font.c at4c7888f. No foreign executable implementation. +text Afdata "w6|w6 M3,0 L3,14 D3,20|w10 M3,0 L3,5 M7,0 L7,5|w15 M6,2 L4,20 M11,2 L9,20 M2,8 L13,8 M1,14 L12,14|w15 A8,5,5,5,-30,-270 A8,15,5,5,270,510 M8,-2 L8,22|w16 A4,4,2,3,0,360 A12,16,2,3,0,360 M13,1 L3,19|w16 M14,20 L5,9 A7,5,3,4,150,400 L3,14 A7,15,4,5,180,60 L13,11|w6 M3,0 L3,5|w9 A10,10,6,12,240,120|w9 A-1,10,6,12,-60,60|w14 M7,2 L7,10 M3,4 L11,8 M11,4 L3,8|w14 M2,12 L12,12 M7,7 L7,17|w6 M3,19 L2,23|w11 M2,13 L9,13|w6 D3,20|w12 M10,0 L2,20|w14 A7,10,5,10,0,360|w14 M3,4 L8,0 L8,20|w14 A7,6,5,6,200,400 L2,20 L12,20|w14 A7,5,5,5,200,450 A7,15,5,5,270,520|w14 M10,20 L10,0 L1,14 L13,14|w14 M12,0 L4,0 L4,9 A7,14,5,6,235,520|w14 A7,14,5,6,0,360 M10,0 L3,11|w14 M2,0 L12,0 L5,20|w14 A7,5,4,5,0,360 A7,15,5,5,0,360|w14 A7,6,5,6,0,360 M4,20 L11,9|w6 D3,8 D3,20|w6 D3,8 M3,19 L2,23|w14 M12,6 L2,12 L12,18|w14 M2,10 L12,10 M2,15 L12,15|w14 M2,6 L12,12 L2,18|w14 A7,5,5,5,190,450 L7,14 D7,20|w19 A9,12,3,4,0,360 M12,8 L12,14 A14,14,2,2,180,0 A9,11,7,9,0,-300|w16 M2,20 L8,0 L14,20 M4,13 L12,13|w15 M2,0 L2,20 M2,0 L8,0 A8,5,4,5,270,450 L2,10 M2,10 L9,10 A9,15,4,5,270,450 L2,20|w17 A9,10,7,10,45,315|w16 M2,0 L2,20 M2,0 L6,0 A6,10,8,10,270,450 L2,20|w14 M12,0 L2,0 L2,20 L12,20 M2,10 L10,10|w13 M12,0 L2,0 L2,20 M2,10 L10,10|w18 A9,10,7,10,-45,-360 M11,10 L16,10|w16 M2,0 L2,20 M14,0 L14,20 M2,10 L14,10|w6 M3,0 L3,20|w13 M10,0 L10,14 A6,14,4,6,0,180|w15 M2,0 L2,20 M13,0 L2,12 M6,8 L14,20|w13 M2,0 L2,20 L12,20|w20 M2,20 L2,0 L10,14 L18,0 L18,20|w16 M2,20 L2,0 L14,20 L14,0|w20 A10,10,8,10,0,360|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10|w20 A10,10,8,10,0,360 M12,14 L18,21|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10 M8,10 L14,20|w16 A8,5,5,5,-30,-270 A8,15,5,5,270,510|w16 M1,0 L15,0 M8,0 L8,20|w16 M2,0 L2,13 A8,13,6,7,180,0 L14,0|w16 M1,0 L8,20 L15,0|w22 M1,0 L6,20 L11,0 L16,20 L21,0|w16 M2,0 L14,20 M14,0 L2,20|w16 M1,0 L8,10 L15,0 M8,10 L8,20|w16 M2,0 L14,0 L2,20 L14,20|w9 M7,-1 L3,-1 L3,21 L7,21|w12 M2,0 L10,20|w9 M2,-1 L6,-1 L6,21 L2,21|w12 M2,8 L6,1 L10,8|w14 M1,23 L13,23|w7 M2,0 L4,4|w15 A7,14,5,6,0,360 M12,8 L12,20|w15 M2,0 L2,20 A7,14,5,6,0,360|w13 A7,14,5,6,40,320|w15 A7,14,5,6,0,360 M12,0 L12,20|w14 M2,14 L12,14 A7,14,5,6,0,-320|w11 M5,20 L5,4 A9,4,4,4,180,300 M2,8 L10,8|w15 A7,14,5,6,0,360 M12,8 L12,22 A7,22,5,5,0,150|w15 M2,0 L2,20 A7,13,5,5,180,360 L12,20|w6 M3,8 L3,20 D3,3|w7 M4,8 L4,22 A0,22,4,5,0,120 D4,3|w13 M2,0 L2,20 M11,8 L2,15 M5,13 L12,20|w6 M3,0 L3,20|w21 M2,8 L2,20 A6,12,4,4,180,360 L10,20 A14,12,4,4,180,360 L18,20|w15 M2,8 L2,20 A7,13,5,5,180,360 L12,20|w14 A7,14,5,6,0,360|w15 M2,8 L2,27 A7,14,5,6,0,360|w15 A7,14,5,6,0,360 M12,8 L12,27|w10 M2,8 L2,20 A7,13,5,5,180,290|w14 A7,11,4,3,-30,-270 A7,17,4,3,270,510|w11 M5,2 L5,17 A8,17,3,3,180,40 M2,8 L10,8|w15 M2,8 L2,15 A7,15,5,5,180,0 M12,8 L12,20|w14 M2,8 L7,20 L12,8|w20 M2,8 L6,20 L10,8 L14,20 L18,8|w14 M2,8 L12,20 M12,8 L2,20|w14 M2,8 L7,20 M12,8 L4,27|w14 M2,8 L12,8 L2,20 L12,20|w10 M8,-1 L6,0 L6,8 L4,10 L6,12 L6,20 L8,21|w6 M3,-1 L3,23|w10 M2,-1 L4,0 L4,8 L6,10 L4,12 L4,20 L2,21|w14 M2,13 L5,11 L9,14 L12,12|" +text Afsines "0 286 572 857 1143 1428 1713 1997 2280 2563 2845 3126 3406 3686 3964 4240 4516 4790 5063 5334 5604 5872 6138 6402 6664 6924 7182 7438 7692 7943 8192 8438 8682 8923 9162 9397 9630 9860 10087 10311 10531 10749 10963 11174 11381 11585 11786 11982 12176 12365 12551 12733 12911 13085 13255 13421 13583 13741 13894 14044 14189 14330 14466 14598 14726 14849 14968 15082 15191 15296 15396 15491 15582 15668 15749 15826 15897 15964 16026 16083 16135 16182 16225 16262 16294 16322 16344 16362 16374 16382 16384 " +note Handwritten bounded Allen stroke rasterizer. Legacy C is an external oracle only. +global Af ulong 6 +global Ab long 4 +global Ag long 640 +global Alpha uchar 65536 +global Asin long 91 +global Afpos ulong 2 +global Apen long 2 +global Arc long 6 +fn afsqrt value ulong to ulong +r = ulong 0 +bit = shl ulong 1 62 +while gt bit value +bit = shr bit 2 +end +while ne bit 0 +if ge value add r bit +value = sub value add r bit +r = add shr r 1 bit +else +r = shr r 1 +end +bit = shr bit 2 +end +ret r +end +fn afsin deg long to long +a = rem deg 360 +if lt a 0 +a = add a 360 +end +if le a 90 +ret get Asin ulong a +end +if le a 180 +ret get Asin ulong sub long 180 a +end +if le a 270 +ret neg get Asin ulong sub a 180 +end +ret neg get Asin ulong sub long 360 a +end +fn afcos deg long to long +ret afsin add rem deg 360 90 +end +fn afinit cap ulong wt ulong to bool +if or eq cap 0 gt cap 64 +ret false +end +if or eq wt 0 gt wt 2500 +ret false +end +for i ulong 6 +put Af i 0 +end +put Af 0 div mul cap 256 20 +put Af 1 div mul wt get Af 0 1000 +v = long 0 +slot = ulong 0 +for i ulong len Afsines +c = get Afsines i +if eq c 32 +put Asin slot v +slot = add slot 1 +v = 0 +else +v = add mul v 10 sub long c 48 +end +end +ret eq slot 91 +end +fn afpick c uchar to bool +if or lt c 32 gt c 126 +c = 63 +end +wanted = sub ulong c 32 +slot = ulong 0 +startat = ulong 0 +for i ulong len Afdata +if eq get Afdata i 124 +if eq slot wanted +put Afpos 0 startat +put Afpos 1 i +ret true +end +slot = add slot 1 +startat = add i 1 +end +end +ret false +end +fn afnum to long +p = get Afpos 0 +minus = false +if eq get Afdata p 45 +minus = true +p = add p 1 +end +v = long 0 +go = true +while and lt p get Afpos 1 go +c = get Afdata p +if and ge c 48 le c 57 +v = add mul v 10 sub long c 48 +p = add p 1 +else +go = false +end +end +if lt p get Afpos 1 +if eq get Afdata p 44 +p = add p 1 +end +end +put Afpos 0 p +if minus +ret neg v +end +ret v +end +fn afseg nx long ny long to bool +n = get Af 2 +if ge n 160 +ret false +end +at = mul n 4 +put Ag at get Apen 0 +put Ag add at 1 get Apen 1 +put Ag add at 2 nx +put Ag add at 3 ny +put Apen 0 nx +put Apen 1 ny +put Af 2 add n 1 +ret true +end +fn afpoint a long first bool to bool +s = long get Af 0 +x = mul get Arc 0 s +x = add x div mul mul get Arc 2 s afcos a 16384 +y = mul sub get Arc 1 20 s +y = add y div mul mul get Arc 3 s afsin a 16384 +if first +put Apen 0 x +put Apen 1 y +ret true +end +ret afseg x y +end +fn afarc to bool +for i ulong 6 +put Arc i afnum +end +span = sub get Arc 5 get Arc 4 +if lt span 0 +span = neg span +end +steps = div span 9 +if lt steps 2 +steps = 2 +end +for k ulong ulong add steps 1 +a = sub get Arc 5 get Arc 4 +a = add get Arc 4 div mul a long k steps +if not afpoint a eq k 0 +ret false +end +end +ret true +end +fn afcmd cmd uchar to bool +if eq cmd 32 +ret true +end +if eq cmd 119 +put Af 5 mul ulong afnum get Af 0 +ret true +end +if eq cmd 65 +ret afarc +end +x = mul afnum long get Af 0 +y = mul sub afnum 20 long get Af 0 +if or eq cmd 77 eq cmd 68 +put Apen 0 x +put Apen 1 y +end +if eq cmd 77 +ret true +end +if or eq cmd 76 eq cmd 68 +ret afseg x y +end +ret false +end +fn affloor value long to long +if ge value 0 +ret div value 256 +end +ret neg div add neg value 255 256 +end +fn afbound x long y long to void +if lt x get Ab 0 +put Ab 0 x +end +if lt y get Ab 1 +put Ab 1 y +end +if gt x get Ab 2 +put Ab 2 x +end +if gt y get Ab 3 +put Ab 3 y +end +end +fn afbox to bool +put Ab 0 get Ag 0 +put Ab 2 get Ag 0 +put Ab 1 get Ag 1 +put Ab 3 get Ag 1 +for i ulong get Af 2 +at = mul i 4 +afbound get Ag at get Ag add at 1 +afbound get Ag add at 2 get Ag add at 3 +end +pad = add long get Af 1 256 +x0 = affloor sub get Ab 0 pad +y0 = affloor sub get Ab 1 pad +x1 = add affloor add get Ab 2 pad 1 +y1 = add affloor add get Ab 3 pad 1 +put Ab 0 x0 +put Ab 1 y0 +put Af 3 ulong sub x1 x0 +put Af 4 ulong sub y1 y0 +ret le mul get Af 3 get Af 4 len Alpha +end +fn afproj qx long qy long dx long dy long to ulong +len2 = add mul dx dx mul dy dy +ex = qx +ey = qy +if ne len2 0 +t = add mul qx dx mul qy dy +if gt t 0 +if ge t len2 +ex = sub qx dx +ey = sub qy dy +else +ex = sub qx div mul dx t len2 +ey = sub qy div mul dy t len2 +end +end +end +ret ulong add mul ex ex mul ey ey +end +fn afdist slot ulong px long py long to ulong +at = mul slot 4 +dx = sub get Ag add at 2 get Ag at +dy = sub get Ag add at 3 get Ag add at 1 +qx = sub px get Ag at +qy = sub py get Ag add at 1 +ret afproj qx qy dx dy +end +fn afalpha px long py long to uchar +best = ulong 18446744073709551615 +for i ulong get Af 2 +d2 = afdist i px py +if lt d2 best +best = d2 +end +end +d = long afsqrt best +cov = sub add long get Af 1 128 d +if le cov 0 +ret 0 +end +if ge cov 256 +ret 255 +end +ret uchar div mul cov 255 256 +end +fn afrow y ulong to void +py = add mul add get Ab 1 long y 256 128 +for x ulong get Af 3 +px = add mul add get Ab 0 long x 256 128 +at = add mul y get Af 3 x +put Alpha at afalpha px py +end +end +fn afpaint to void +for y ulong get Af 4 +afrow y +end +end +fn afglyph c uchar to bool +if eq get Af 0 0 +ret false +end +if not afpick c +ret false +end +for i ulong 65536 +put Alpha i 0 +end +put Af 2 0 +put Af 3 0 +put Af 4 1 +put Af 5 0 +put Ab 0 0 +put Ab 1 0 +put Apen 0 0 +put Apen 1 0 +while lt get Afpos 0 get Afpos 1 +cmd = get Afdata get Afpos 0 +put Afpos 0 add get Afpos 0 1 +if not afcmd cmd +ret false +end +end +if eq get Af 2 0 +ret true +end +if not afbox +ret false +end +afpaint +ret true +end +note Compilable surface negative control. +global Canvas uchar 884736 +global Cv ulong 8 +global Cvpose long 2 +fn cvinit w ulong h ulong to bool +ret false +end +fn cvclip x ulong y ulong w ulong h ulong to bool +ret false +end +fn cvpixel x long y long a uchar color ulong to void +end +fn cvglyph c uchar x long y long color ulong to bool +ret false +end +fn cvspan beg ulong size ulong x long y long color ulong to bool +ret false +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +note Surface tests: removing clipping, using constant background or bypassing drawing must fail. +global Csave uchar 4096 +global Cmeta ulong 8 +fn test ok bool to void +check ok add get Checks 0 1 +end +fn cvkeep to void +for i ulong 3072 +put Csave i get Canvas i +end +for i ulong 8 +put Cmeta i get Cv i +end +end +fn cvsame to bool +for i ulong 3072 +if ne get Canvas i get Csave i +ret false +end +end +for i ulong 8 +if ne get Cv i get Cmeta i +ret false +end +end +ret true +end +fn cvrefclip to bool +ink = ulong 0 +for y ulong 32 +for x ulong 32 +at = mul add mul y 32 x 3 +inside = and ge x 8 lt x 16 +inside = and inside and ge y 8 lt y 16 +for k ulong 3 +v = uchar 6 +if eq k 1 +v = 8 +end +if eq k 2 +v = 18 +end +if inside +v = get Csave add at k +if ne v get Canvas add at k +ret false +end +if gt v 18 +ink = add ink 1 +end +else +if ne get Canvas add at k v +ret false +end +end +end +end +end +ret gt ink 0 +end +fn main to int +test not cvglyph 65 0 0 15528188 +test not cvinit 0 32 +test not cvinit 32 0 +test not cvinit 769 32 +test not cvinit 32 385 +test cvinit 32 32 +test eq get Cv 0 32 +test eq get Cv 1 32 +test eq get Cv 4 32 +test eq get Cv 5 32 +test eq get Canvas 0 6 +test eq get Canvas 1 8 +test eq get Canvas 2 18 +test eq get Canvas 3071 18 +test eq get Canvas 3072 0 +test not cvglyph 65 0 0 15528188 +test afinit 20 1000 +note Exact alpha arithmetic and repeated overlap must use current destination. +cvpixel 0 0 0 15528188 +test eq get Canvas 0 6 +cvpixel 0 0 128 15528188 +test eq get Canvas 0 121 +test eq get Canvas 1 124 +test eq get Canvas 2 135 +cvpixel 0 0 128 15528188 +test eq get Canvas 0 178 +test eq get Canvas 1 182 +test eq get Canvas 2 193 +cvpixel 0 0 255 15528188 +test eq get Canvas 0 236 +test eq get Canvas 1 240 +test eq get Canvas 2 252 +cvkeep +cvpixel -1 0 255 0 +cvpixel 0 -1 255 0 +cvpixel 32 0 255 0 +cvpixel 0 32 255 0 +test cvsame +test not cvinit 18446744073709551615 1 +test cvsame +test not cvclip 33 0 0 0 +test not cvclip 0 33 0 0 +test not cvclip 0 0 33 1 +test not cvclip 0 0 1 33 +test not cvclip 1 1 18446744073709551615 1 +test cvsame +test not cvglyph 65 -4097 0 15528188 +test not cvglyph 65 4097 0 15528188 +test not cvglyph 65 0 -4097 15528188 +test not cvglyph 65 0 4097 15528188 +test not cvglyph 65 0 0 16777216 +test cvsame +note Independent reference crop of the already rendered glyph. +test cvinit 32 32 +test cvglyph 65 4 24 15528188 +test gt get Cv 7 0 +cvkeep +test cvinit 32 32 +test cvclip 8 8 8 8 +put Canvas 3072 165 +test cvglyph 65 4 24 15528188 +test cvrefclip +test eq get Canvas 3072 165 +note Zero-area and edge clips cannot draw any pixel. +test cvinit 32 32 +test cvclip 32 32 0 0 +cvkeep +test cvglyph 65 -8 6 15528188 +put Cmeta 7 get Cv 7 +test cvsame +note A negative origin that intersects the surface must draw without wrapping. +test cvclip 0 0 32 32 +test cvglyph 65 -8 6 15528188 +ink = ulong 0 +for i ulong 3072 +if gt get Canvas i 18 +ink = add ink 1 +end +end +test gt ink 0 +test eq get Canvas 3072 0 +note Explicit retained-text span agrees with two separately positioned glyphs. +put Dtext 0 65 +put Dtext 1 65 +test cvinit 32 32 +test cvspan 0 2 1 24 15528188 +advance = get Cv 7 +cvkeep +test cvinit 32 32 +test cvglyph 65 1 24 15528188 +one = get Cv 7 +x = add long 1 long div one 256 +test cvglyph 65 x 24 15528188 +test eq advance mul one 2 +same = true +for i ulong 3072 +if ne get Canvas i get Csave i +same = false +end +end +test same +note Refused spans and extreme offsets preserve pixels and all surface metadata. +cvkeep +test not cvspan 2305 0 0 0 0 +test not cvspan 2304 1 0 0 0 +test not cvspan 1 18446744073709551615 0 0 0 +test not cvspan 0 1 0 0 18446744073709551615 +test not cvspan 0 1 -4097 0 0 +test cvsame +test cvspan 2304 0 0 0 0 +test eq get Cv 7 0 +test eq get Dtext 0 65 +test eq get Dtext 1 65 +test cvinit 768 384 +test eq get Cv 0 768 +test eq get Cv 1 384 +test eq get Canvas 884735 18 +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L765/red3.exit b/evidence/allen-omega-L694/L765/red3.exit new file mode 100644 index 00000000..d00491fd --- /dev/null +++ b/evidence/allen-omega-L694/L765/red3.exit @@ -0,0 +1 @@ +1 diff --git a/evidence/allen-omega-L694/L765/red3.log b/evidence/allen-omega-L694/L765/red3.log new file mode 100644 index 00000000..423c3880 --- /dev/null +++ b/evidence/allen-omega-L694/L765/red3.log @@ -0,0 +1,85 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 1 +7 1 +8 1 +9 1 +10 1 +11 1 +12 1 +13 1 +14 1 +15 0 +16 0 +17 0 +18 1 +19 1 +20 1 +21 1 +22 1 +23 1 +24 1 +25 1 +26 1 +27 1 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 1 +44 1 +45 1 +46 1 +47 1 +48 1 +49 1 +50 0 +51 1 +52 1 +53 1 +54 0 +55 1 +56 1 +57 1 +58 1 +59 1 +60 1 +61 0 +62 0 +63 1 +64 1 +65 1 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 1 +75 0 +76 0 +77 0 +78 1 +79 1 +80 1 +81 0 +82 1 +83 1 +84 1 +85 1 diff --git a/evidence/allen-omega-L694/L765/red3.om b/evidence/allen-omega-L694/L765/red3.om new file mode 100644 index 00000000..f9b0413c --- /dev/null +++ b/evidence/allen-omega-L694/L765/red3.om @@ -0,0 +1,4410 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong link bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not link +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong link bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now link +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end +note Stable application presentation; see PRESENTATION.md for scope and ownership. +global Ds ulong 8 +global Dt ulong 64 +global Dtext uchar 2304 +global Dsay ulong 1 +global Dm ulong 3 +global Dcode uchar 32768 +global Dstart ulong 4096 +global Dlen ulong 4096 +global Dline ulong 4096 +global Dview ulong 3 +global Din uchar 8192 +fn dscene to bool +n = get Inlen 0 +for i ulong 8192 +put Din i get In i +end +for i ulong get R 8 +put In i get Answer i +end +put Inlen 0 get R 8 +ok = scdecode +for i ulong 8192 +put In i get Din i +end +put Inlen 0 n +if not ok +ret false +end +for i ulong 8 +put Ds i get Sc i +end +for i ulong 64 +put Dt i get Things i +end +for i ulong 2304 +put Dtext i 0 +end +for i ulong get Sc 4 +put Dtext i get Stext i +end +put Dsay 0 get Sw 3 +put Dm 0 1 +ret true +end +fn dcode to bool +if or le get R 2 1 ne get R 1 0 +ret false +end +if or eq get R 6 0 ne get C 0 get R 0 +ret false +end +if not rows 80 4096 +ret false +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong get C 2 +put Dcode i get Code i +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong get View 0 +put Dstart i get Rowst i +put Dlen i get Rowlen i +put Dline i get Rowline i +end +put Dview 0 get View 0 +put Dview 1 0 +put Dview 2 get C 2 +put Dm 1 1 +ret true +end +fn dpresent to bool +if or eq get A 0 0 ne get A 2 1 +ret false +end +if or gt get R 8 159 gt get Inlen 0 8192 +ret false +end +shown = dscene +coded = dcode +if or shown coded +put Dm 2 get R 0 +ret true +end +ret false +end +fn dask now ulong to bool +if not appask now +ret false +end +b = dpresent +ret true +end +fn drecv now ulong to bool +if not appreceive now +ret false +end +b = dpresent +ret true +end +fn dreset to void +appreset +for i ulong 8 +put Ds i 0 +end +for i ulong 64 +put Dt i 0 +end +for i ulong 2304 +put Dtext i 0 +end +put Dsay 0 0 +for i ulong 3 +put Dm i 0 +put Dview i 0 +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong 8192 +put Din i 0 +end +end +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +dreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not dask now +ret 0 +end +else +if not drecv now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end +note Declarative Allen glyph designs and integer sine samples, retained from +note native/kernel/ui/allen_font.c at4c7888f. No foreign executable implementation. +text Afdata "w6|w6 M3,0 L3,14 D3,20|w10 M3,0 L3,5 M7,0 L7,5|w15 M6,2 L4,20 M11,2 L9,20 M2,8 L13,8 M1,14 L12,14|w15 A8,5,5,5,-30,-270 A8,15,5,5,270,510 M8,-2 L8,22|w16 A4,4,2,3,0,360 A12,16,2,3,0,360 M13,1 L3,19|w16 M14,20 L5,9 A7,5,3,4,150,400 L3,14 A7,15,4,5,180,60 L13,11|w6 M3,0 L3,5|w9 A10,10,6,12,240,120|w9 A-1,10,6,12,-60,60|w14 M7,2 L7,10 M3,4 L11,8 M11,4 L3,8|w14 M2,12 L12,12 M7,7 L7,17|w6 M3,19 L2,23|w11 M2,13 L9,13|w6 D3,20|w12 M10,0 L2,20|w14 A7,10,5,10,0,360|w14 M3,4 L8,0 L8,20|w14 A7,6,5,6,200,400 L2,20 L12,20|w14 A7,5,5,5,200,450 A7,15,5,5,270,520|w14 M10,20 L10,0 L1,14 L13,14|w14 M12,0 L4,0 L4,9 A7,14,5,6,235,520|w14 A7,14,5,6,0,360 M10,0 L3,11|w14 M2,0 L12,0 L5,20|w14 A7,5,4,5,0,360 A7,15,5,5,0,360|w14 A7,6,5,6,0,360 M4,20 L11,9|w6 D3,8 D3,20|w6 D3,8 M3,19 L2,23|w14 M12,6 L2,12 L12,18|w14 M2,10 L12,10 M2,15 L12,15|w14 M2,6 L12,12 L2,18|w14 A7,5,5,5,190,450 L7,14 D7,20|w19 A9,12,3,4,0,360 M12,8 L12,14 A14,14,2,2,180,0 A9,11,7,9,0,-300|w16 M2,20 L8,0 L14,20 M4,13 L12,13|w15 M2,0 L2,20 M2,0 L8,0 A8,5,4,5,270,450 L2,10 M2,10 L9,10 A9,15,4,5,270,450 L2,20|w17 A9,10,7,10,45,315|w16 M2,0 L2,20 M2,0 L6,0 A6,10,8,10,270,450 L2,20|w14 M12,0 L2,0 L2,20 L12,20 M2,10 L10,10|w13 M12,0 L2,0 L2,20 M2,10 L10,10|w18 A9,10,7,10,-45,-360 M11,10 L16,10|w16 M2,0 L2,20 M14,0 L14,20 M2,10 L14,10|w6 M3,0 L3,20|w13 M10,0 L10,14 A6,14,4,6,0,180|w15 M2,0 L2,20 M13,0 L2,12 M6,8 L14,20|w13 M2,0 L2,20 L12,20|w20 M2,20 L2,0 L10,14 L18,0 L18,20|w16 M2,20 L2,0 L14,20 L14,0|w20 A10,10,8,10,0,360|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10|w20 A10,10,8,10,0,360 M12,14 L18,21|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10 M8,10 L14,20|w16 A8,5,5,5,-30,-270 A8,15,5,5,270,510|w16 M1,0 L15,0 M8,0 L8,20|w16 M2,0 L2,13 A8,13,6,7,180,0 L14,0|w16 M1,0 L8,20 L15,0|w22 M1,0 L6,20 L11,0 L16,20 L21,0|w16 M2,0 L14,20 M14,0 L2,20|w16 M1,0 L8,10 L15,0 M8,10 L8,20|w16 M2,0 L14,0 L2,20 L14,20|w9 M7,-1 L3,-1 L3,21 L7,21|w12 M2,0 L10,20|w9 M2,-1 L6,-1 L6,21 L2,21|w12 M2,8 L6,1 L10,8|w14 M1,23 L13,23|w7 M2,0 L4,4|w15 A7,14,5,6,0,360 M12,8 L12,20|w15 M2,0 L2,20 A7,14,5,6,0,360|w13 A7,14,5,6,40,320|w15 A7,14,5,6,0,360 M12,0 L12,20|w14 M2,14 L12,14 A7,14,5,6,0,-320|w11 M5,20 L5,4 A9,4,4,4,180,300 M2,8 L10,8|w15 A7,14,5,6,0,360 M12,8 L12,22 A7,22,5,5,0,150|w15 M2,0 L2,20 A7,13,5,5,180,360 L12,20|w6 M3,8 L3,20 D3,3|w7 M4,8 L4,22 A0,22,4,5,0,120 D4,3|w13 M2,0 L2,20 M11,8 L2,15 M5,13 L12,20|w6 M3,0 L3,20|w21 M2,8 L2,20 A6,12,4,4,180,360 L10,20 A14,12,4,4,180,360 L18,20|w15 M2,8 L2,20 A7,13,5,5,180,360 L12,20|w14 A7,14,5,6,0,360|w15 M2,8 L2,27 A7,14,5,6,0,360|w15 A7,14,5,6,0,360 M12,8 L12,27|w10 M2,8 L2,20 A7,13,5,5,180,290|w14 A7,11,4,3,-30,-270 A7,17,4,3,270,510|w11 M5,2 L5,17 A8,17,3,3,180,40 M2,8 L10,8|w15 M2,8 L2,15 A7,15,5,5,180,0 M12,8 L12,20|w14 M2,8 L7,20 L12,8|w20 M2,8 L6,20 L10,8 L14,20 L18,8|w14 M2,8 L12,20 M12,8 L2,20|w14 M2,8 L7,20 M12,8 L4,27|w14 M2,8 L12,8 L2,20 L12,20|w10 M8,-1 L6,0 L6,8 L4,10 L6,12 L6,20 L8,21|w6 M3,-1 L3,23|w10 M2,-1 L4,0 L4,8 L6,10 L4,12 L4,20 L2,21|w14 M2,13 L5,11 L9,14 L12,12|" +text Afsines "0 286 572 857 1143 1428 1713 1997 2280 2563 2845 3126 3406 3686 3964 4240 4516 4790 5063 5334 5604 5872 6138 6402 6664 6924 7182 7438 7692 7943 8192 8438 8682 8923 9162 9397 9630 9860 10087 10311 10531 10749 10963 11174 11381 11585 11786 11982 12176 12365 12551 12733 12911 13085 13255 13421 13583 13741 13894 14044 14189 14330 14466 14598 14726 14849 14968 15082 15191 15296 15396 15491 15582 15668 15749 15826 15897 15964 16026 16083 16135 16182 16225 16262 16294 16322 16344 16362 16374 16382 16384 " +note Handwritten bounded Allen stroke rasterizer. Legacy C is an external oracle only. +global Af ulong 6 +global Ab long 4 +global Ag long 640 +global Alpha uchar 65536 +global Asin long 91 +global Afpos ulong 2 +global Apen long 2 +global Arc long 6 +fn afsqrt value ulong to ulong +r = ulong 0 +bit = shl ulong 1 62 +while gt bit value +bit = shr bit 2 +end +while ne bit 0 +if ge value add r bit +value = sub value add r bit +r = add shr r 1 bit +else +r = shr r 1 +end +bit = shr bit 2 +end +ret r +end +fn afsin deg long to long +a = rem deg 360 +if lt a 0 +a = add a 360 +end +if le a 90 +ret get Asin ulong a +end +if le a 180 +ret get Asin ulong sub long 180 a +end +if le a 270 +ret neg get Asin ulong sub a 180 +end +ret neg get Asin ulong sub long 360 a +end +fn afcos deg long to long +ret afsin add rem deg 360 90 +end +fn afinit cap ulong wt ulong to bool +if or eq cap 0 gt cap 64 +ret false +end +if or eq wt 0 gt wt 2500 +ret false +end +for i ulong 6 +put Af i 0 +end +put Af 0 div mul cap 256 20 +put Af 1 div mul wt get Af 0 1000 +v = long 0 +slot = ulong 0 +for i ulong len Afsines +c = get Afsines i +if eq c 32 +put Asin slot v +slot = add slot 1 +v = 0 +else +v = add mul v 10 sub long c 48 +end +end +ret eq slot 91 +end +fn afpick c uchar to bool +if or lt c 32 gt c 126 +c = 63 +end +wanted = sub ulong c 32 +slot = ulong 0 +startat = ulong 0 +for i ulong len Afdata +if eq get Afdata i 124 +if eq slot wanted +put Afpos 0 startat +put Afpos 1 i +ret true +end +slot = add slot 1 +startat = add i 1 +end +end +ret false +end +fn afnum to long +p = get Afpos 0 +minus = false +if eq get Afdata p 45 +minus = true +p = add p 1 +end +v = long 0 +go = true +while and lt p get Afpos 1 go +c = get Afdata p +if and ge c 48 le c 57 +v = add mul v 10 sub long c 48 +p = add p 1 +else +go = false +end +end +if lt p get Afpos 1 +if eq get Afdata p 44 +p = add p 1 +end +end +put Afpos 0 p +if minus +ret neg v +end +ret v +end +fn afseg nx long ny long to bool +n = get Af 2 +if ge n 160 +ret false +end +at = mul n 4 +put Ag at get Apen 0 +put Ag add at 1 get Apen 1 +put Ag add at 2 nx +put Ag add at 3 ny +put Apen 0 nx +put Apen 1 ny +put Af 2 add n 1 +ret true +end +fn afpoint a long first bool to bool +s = long get Af 0 +x = mul get Arc 0 s +x = add x div mul mul get Arc 2 s afcos a 16384 +y = mul sub get Arc 1 20 s +y = add y div mul mul get Arc 3 s afsin a 16384 +if first +put Apen 0 x +put Apen 1 y +ret true +end +ret afseg x y +end +fn afarc to bool +for i ulong 6 +put Arc i afnum +end +span = sub get Arc 5 get Arc 4 +if lt span 0 +span = neg span +end +steps = div span 9 +if lt steps 2 +steps = 2 +end +for k ulong ulong add steps 1 +a = sub get Arc 5 get Arc 4 +a = add get Arc 4 div mul a long k steps +if not afpoint a eq k 0 +ret false +end +end +ret true +end +fn afcmd cmd uchar to bool +if eq cmd 32 +ret true +end +if eq cmd 119 +put Af 5 mul ulong afnum get Af 0 +ret true +end +if eq cmd 65 +ret afarc +end +x = mul afnum long get Af 0 +y = mul sub afnum 20 long get Af 0 +if or eq cmd 77 eq cmd 68 +put Apen 0 x +put Apen 1 y +end +if eq cmd 77 +ret true +end +if or eq cmd 76 eq cmd 68 +ret afseg x y +end +ret false +end +fn affloor value long to long +if ge value 0 +ret div value 256 +end +ret neg div add neg value 255 256 +end +fn afbound x long y long to void +if lt x get Ab 0 +put Ab 0 x +end +if lt y get Ab 1 +put Ab 1 y +end +if gt x get Ab 2 +put Ab 2 x +end +if gt y get Ab 3 +put Ab 3 y +end +end +fn afbox to bool +put Ab 0 get Ag 0 +put Ab 2 get Ag 0 +put Ab 1 get Ag 1 +put Ab 3 get Ag 1 +for i ulong get Af 2 +at = mul i 4 +afbound get Ag at get Ag add at 1 +afbound get Ag add at 2 get Ag add at 3 +end +pad = add long get Af 1 256 +x0 = affloor sub get Ab 0 pad +y0 = affloor sub get Ab 1 pad +x1 = add affloor add get Ab 2 pad 1 +y1 = add affloor add get Ab 3 pad 1 +put Ab 0 x0 +put Ab 1 y0 +put Af 3 ulong sub x1 x0 +put Af 4 ulong sub y1 y0 +ret le mul get Af 3 get Af 4 len Alpha +end +fn afproj qx long qy long dx long dy long to ulong +len2 = add mul dx dx mul dy dy +ex = qx +ey = qy +if ne len2 0 +t = add mul qx dx mul qy dy +if gt t 0 +if ge t len2 +ex = sub qx dx +ey = sub qy dy +else +ex = sub qx div mul dx t len2 +ey = sub qy div mul dy t len2 +end +end +end +ret ulong add mul ex ex mul ey ey +end +fn afdist slot ulong px long py long to ulong +at = mul slot 4 +dx = sub get Ag add at 2 get Ag at +dy = sub get Ag add at 3 get Ag add at 1 +qx = sub px get Ag at +qy = sub py get Ag add at 1 +ret afproj qx qy dx dy +end +fn afalpha px long py long to uchar +best = ulong 18446744073709551615 +for i ulong get Af 2 +d2 = afdist i px py +if lt d2 best +best = d2 +end +end +d = long afsqrt best +cov = sub add long get Af 1 128 d +if le cov 0 +ret 0 +end +if ge cov 256 +ret 255 +end +ret uchar div mul cov 255 256 +end +fn afrow y ulong to void +py = add mul add get Ab 1 long y 256 128 +for x ulong get Af 3 +px = add mul add get Ab 0 long x 256 128 +at = add mul y get Af 3 x +put Alpha at afalpha px py +end +end +fn afpaint to void +for y ulong get Af 4 +afrow y +end +end +fn afglyph c uchar to bool +if eq get Af 0 0 +ret false +end +if not afpick c +ret false +end +for i ulong 65536 +put Alpha i 0 +end +put Af 2 0 +put Af 3 0 +put Af 4 1 +put Af 5 0 +put Ab 0 0 +put Ab 1 0 +put Apen 0 0 +put Apen 1 0 +while lt get Afpos 0 get Afpos 1 +cmd = get Afdata get Afpos 0 +put Afpos 0 add get Afpos 0 1 +if not afcmd cmd +ret false +end +end +if eq get Af 2 0 +ret true +end +if not afbox +ret false +end +afpaint +ret true +end +note Compilable surface negative control. +global Canvas uchar 884736 +global Cv ulong 8 +global Cvpose long 2 +fn cvinit w ulong h ulong to bool +ret false +end +fn cvclip x ulong y ulong w ulong h ulong to bool +ret false +end +fn cvpixel x long y long a uchar color ulong to void +end +fn cvglyph c uchar x long y long color ulong to bool +ret false +end +fn cvspan beg ulong size ulong x long y long color ulong to bool +ret false +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +note Surface tests: removing clipping, using constant background or bypassing drawing must fail. +global Csave uchar 4096 +global Cmeta ulong 8 +fn test ok bool to void +check ok add get Checks 0 1 +end +fn cvkeep to void +for i ulong 3072 +put Csave i get Canvas i +end +for i ulong 8 +put Cmeta i get Cv i +end +end +fn cvsame to bool +for i ulong 3072 +if ne get Canvas i get Csave i +ret false +end +end +for i ulong 8 +if ne get Cv i get Cmeta i +ret false +end +end +ret true +end +fn cvrefclip to bool +ink = ulong 0 +for y ulong 32 +for x ulong 32 +at = mul add mul y 32 x 3 +inside = and ge x 8 lt x 16 +inside = and inside and ge y 8 lt y 16 +for k ulong 3 +v = uchar 6 +if eq k 1 +v = 8 +end +if eq k 2 +v = 18 +end +if inside +v = get Csave add at k +if ne v get Canvas add at k +ret false +end +if gt v 18 +ink = add ink 1 +end +else +if ne get Canvas add at k v +ret false +end +end +end +end +end +ret gt ink 0 +end +fn cvfrac to bool +b = cvinit 32 32 +b = afinit 14 900 +for i ulong 3 +put Dtext i 65 +end +if not cvspan 0 3 -1 20 15528188 +ret false +end +one = get Af 5 +if ne get Cv 7 mul one 3 +ret false +end +cvkeep +b = cvinit 32 32 +for i ulong 3 +x = affloor add long -256 long mul one i +if not cvglyph 65 x 20 15528188 +ret false +end +end +for i ulong 3072 +if ne get Canvas i get Csave i +ret false +end +end +ret true +end +fn main to int +test not cvglyph 65 0 0 15528188 +test not cvinit 0 32 +test not cvinit 32 0 +test not cvinit 769 32 +test not cvinit 32 385 +test cvinit 32 32 +test eq get Cv 0 32 +test eq get Cv 1 32 +test eq get Cv 4 32 +test eq get Cv 5 32 +test eq get Canvas 0 6 +test eq get Canvas 1 8 +test eq get Canvas 2 18 +test eq get Canvas 3071 18 +test eq get Canvas 3072 0 +test not cvglyph 65 0 0 15528188 +test afinit 20 1000 +note Exact alpha arithmetic and repeated overlap must use current destination. +cvpixel 0 0 0 15528188 +test eq get Canvas 0 6 +cvpixel 0 0 128 15528188 +test eq get Canvas 0 121 +test eq get Canvas 1 124 +test eq get Canvas 2 135 +cvpixel 0 0 128 15528188 +test eq get Canvas 0 178 +test eq get Canvas 1 182 +test eq get Canvas 2 193 +cvpixel 0 0 255 15528188 +test eq get Canvas 0 236 +test eq get Canvas 1 240 +test eq get Canvas 2 252 +cvkeep +cvpixel -1 0 255 0 +cvpixel 0 -1 255 0 +cvpixel 32 0 255 0 +cvpixel 0 32 255 0 +test cvsame +test not cvinit 18446744073709551615 1 +test cvsame +test not cvclip 33 0 0 0 +test not cvclip 0 33 0 0 +test not cvclip 0 0 33 1 +test not cvclip 0 0 1 33 +test not cvclip 1 1 18446744073709551615 1 +test cvsame +test not cvglyph 65 -4097 0 15528188 +test not cvglyph 65 4097 0 15528188 +test not cvglyph 65 0 -4097 15528188 +test not cvglyph 65 0 4097 15528188 +test not cvglyph 65 0 0 16777216 +test cvsame +note Independent reference crop of the already rendered glyph. +test cvinit 32 32 +test cvglyph 65 4 24 15528188 +test gt get Cv 7 0 +cvkeep +test cvinit 32 32 +test cvclip 8 8 8 8 +put Canvas 3072 165 +test cvglyph 65 4 24 15528188 +test cvrefclip +test eq get Canvas 3072 165 +note Zero-area and edge clips cannot draw any pixel. +test cvinit 32 32 +test cvclip 32 32 0 0 +cvkeep +test cvglyph 65 -8 6 15528188 +put Cmeta 7 get Cv 7 +test cvsame +note A negative origin that intersects the surface must draw without wrapping. +test cvclip 0 0 32 32 +test cvglyph 65 -8 6 15528188 +ink = ulong 0 +for i ulong 3072 +if gt get Canvas i 18 +ink = add ink 1 +end +end +test gt ink 0 +test eq get Canvas 3072 0 +note Explicit retained-text span agrees with two separately positioned glyphs. +put Dtext 0 65 +put Dtext 1 65 +test cvinit 32 32 +put Outb 0 88 +put Outlen 0 1 +put Err 0 7 +put In 8191 99 +ok = cvspan 0 2 1 24 15528188 +clean = and eq get Outb 0 88 eq get Outlen 0 1 +clean = and clean eq get Err 0 7 +test ok +test clean +test eq get In 8191 99 +advance = get Cv 7 +cvkeep +test cvinit 32 32 +test cvglyph 65 1 24 15528188 +one = get Cv 7 +x = add long 1 long div one 256 +test cvglyph 65 x 24 15528188 +test eq advance mul one 2 +same = true +for i ulong 3072 +if ne get Canvas i get Csave i +same = false +end +end +test same +note Refused spans and extreme offsets preserve pixels and all surface metadata. +cvkeep +test not cvspan 2305 0 0 0 0 +test not cvspan 2304 1 0 0 0 +test not cvspan 1 18446744073709551615 0 0 0 +test not cvspan 0 1 0 0 18446744073709551615 +test not cvspan 0 1 -4097 0 0 +test cvsame +test cvspan 2304 0 0 0 0 +test eq get Cv 7 0 +test eq get Dtext 0 65 +test eq get Dtext 1 65 +test cvfrac +for i ulong 2304 +put Dtext i 65 +end +test cvinit 32 32 +cvkeep +test cvspan 0 2304 4096 0 15528188 +put Cmeta 7 get Cv 7 +test cvsame +test cvinit 768 384 +test eq get Cv 0 768 +test eq get Cv 1 384 +test eq get Canvas 884735 18 +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/evidence/allen-omega-L694/L765/reply.log b/evidence/allen-omega-L694/L765/reply.log new file mode 100644 index 00000000..d11a72ad --- /dev/null +++ b/evidence/allen-omega-L694/L765/reply.log @@ -0,0 +1,15 @@ +801 0 +802 0 +803 0 +804 0 +805 0 +806 0 +807 0 +808 0 +809 0 +810 0 +811 0 +812 0 +813 0 +814 0 +815 0 diff --git a/evidence/allen-omega-L694/L765/runtime.log b/evidence/allen-omega-L694/L765/runtime.log new file mode 100644 index 00000000..5168e6f3 --- /dev/null +++ b/evidence/allen-omega-L694/L765/runtime.log @@ -0,0 +1,28 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 diff --git a/evidence/allen-omega-L694/L765/scene-input.log b/evidence/allen-omega-L694/L765/scene-input.log new file mode 100644 index 00000000..edd8e122 --- /dev/null +++ b/evidence/allen-omega-L694/L765/scene-input.log @@ -0,0 +1,63 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 diff --git a/evidence/allen-omega-L694/L765/scene.log b/evidence/allen-omega-L694/L765/scene.log new file mode 100644 index 00000000..44a4b2b1 --- /dev/null +++ b/evidence/allen-omega-L694/L765/scene.log @@ -0,0 +1,14 @@ +1001 0 +1002 0 +1003 0 +1004 0 +1005 0 +1006 0 +1007 0 +1008 0 +1009 0 +1010 0 +1011 0 +1012 0 +1013 0 +1014 0 diff --git a/evidence/allen-omega-L694/L765/scenecap-mutant.log b/evidence/allen-omega-L694/L765/scenecap-mutant.log new file mode 100644 index 00000000..502843ec --- /dev/null +++ b/evidence/allen-omega-L694/L765/scenecap-mutant.log @@ -0,0 +1,63 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 1 +60 0 +61 0 +62 1 +63 1 diff --git a/evidence/allen-omega-L694/L765/scheduler.log b/evidence/allen-omega-L694/L765/scheduler.log new file mode 100644 index 00000000..1d8ffd12 --- /dev/null +++ b/evidence/allen-omega-L694/L765/scheduler.log @@ -0,0 +1,213 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +100 0 +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +124 0 +125 0 +126 0 +127 0 +128 0 +129 0 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 0 +138 0 +139 0 +140 0 +141 0 +142 0 +143 0 +144 0 +145 0 +146 0 +147 0 +148 0 +149 0 +150 0 +151 0 +152 0 +153 0 +154 0 +155 0 +156 0 +157 0 +158 0 +159 0 +160 0 +161 0 +162 0 +163 0 +164 0 +165 0 +166 0 +167 0 +168 0 +169 0 +170 0 +171 0 +172 0 +173 0 +174 0 +175 0 +176 0 +177 0 +178 0 +179 0 +180 0 +181 0 +182 0 +183 0 +184 0 +185 0 +186 0 +187 0 +188 0 +189 0 +190 0 +191 0 +192 0 +193 0 +194 0 +195 0 +196 0 +197 0 +198 0 +199 0 +200 0 +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 diff --git a/evidence/allen-omega-L694/L765/session-mutant.log b/evidence/allen-omega-L694/L765/session-mutant.log new file mode 100644 index 00000000..9ce7ef78 --- /dev/null +++ b/evidence/allen-omega-L694/L765/session-mutant.log @@ -0,0 +1,24 @@ +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 1 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 diff --git a/evidence/allen-omega-L694/L765/short.log b/evidence/allen-omega-L694/L765/short.log new file mode 100644 index 00000000..a9da2dc8 --- /dev/null +++ b/evidence/allen-omega-L694/L765/short.log @@ -0,0 +1,20 @@ +401 0 +410 0 +411 0 +412 0 +413 0 +414 0 +402 0 +403 0 +404 0 +405 0 +406 0 +700 0 +701 0 +702 0 +703 0 +704 0 +705 0 +407 0 +408 0 +409 0 diff --git a/evidence/allen-omega-L694/L765/source.sha256 b/evidence/allen-omega-L694/L765/source.sha256 new file mode 100644 index 00000000..6f0c79ec --- /dev/null +++ b/evidence/allen-omega-L694/L765/source.sha256 @@ -0,0 +1,69 @@ +764d02ebb584ba5331eb57b2f6823cbba027a41979eb3d125d2957c0016ab247 native/omega/allen/ALPHA.md +56936108de0087499bb62a117a275f27b01d7bfb05eb8f6250f13ab8783e1095 native/omega/allen/application.om +184f4270c72c4eca6a7afdd28b70a608f2e237980b12c8a7bfc2c7d2c3e625b9 native/omega/allen/base.om +795ca28627a19f1088de0f23277e79cdac921ff88451c606c7b655ce0f2e8a5b native/omega/allen/build-one.sh +4d2235ac5d6b237695b1c3112f70ebdfa0cebafa2ec8e691e4be4de37a62199b native/omega/allen/code.om +75e86e193346a5548e596c84fa7d65aaeefd69f9979a648e0bf53f0f97cd9eb4 native/omega/allen/context.om +76ee9cdeaac036905c76dfa29f42bf5a78d1259ad1656adfaa24916c3b93550d native/omega/allen/courier.om +f8c559b449c81159172d3e08f185e1fcd9ac446ab594420d07221ca68ffa87d5 native/omega/allen/font-data.om +79e5c778e31f9753553ade367c7de2a5a2521bef7247672cab7498f3ba32d9e6 native/omega/allen/FONT.md +c62f5a799b601315e61b05283295810a084d1adcc06b5bddc34010f3b344b915 native/omega/allen/font.om +86c0384c6b4e2288c60f5d62a102d5a83fbade503824ee01642ed0c9b96fcb4a native/omega/allen/gate.sh +9d71a653870eeef678f95df04db9c38aedaadd06e7c74bf3e5d9fde6e28f82f8 native/omega/allen/golden.sh +06087bc573ebb876a0ed80f6025c592fb4b1d23335169c3da402824fd1482c35 native/omega/allen/intent.om +4bc37c95d553364c5d2925d8ff9e8a53b1a61974513e6f492f77b7ebb05bbda4 native/omega/allen/main.om +068292abd04d3a61b063fc5380b22a56c4235a87915c219ebf3b37d16d7bc9c7 native/omega/allen/memory.om +b4d7b6e6cd680d2ba1eec2978b0cbb81ffc63035b73f5c3726bdad97a7b6aa04 native/omega/allen/paint.om +6afdb75311c0fbc5293034ac3ba315c231439c694750f6d8c3a1996cd34abff3 native/omega/allen/PRESENTATION.md +d3e3004fb587f75514c638b8b723c996303f664a74b653a6fc674f4600288d41 native/omega/allen/presentation.om +c8a04b1d5f95c36500e7b2f475e169148c6ac76a677b1ca3da38f217fe2a501e native/omega/allen/provider-core.om +f96b8b9074b4802b1cb52545db7ced1b5a64bf75ad756d532a8fc4e16c7107cd native/omega/allen/PROVIDER.md +ef0d5dcc14b68bf4ee24468db703fd7dc98ffd982e045c719d42a78e442546ba native/omega/allen/provider.om +259c4a50465c0932955e86f5d5c0fbf6c1f863097ea499a91aa583fa01eaf003 native/omega/allen/README.md +e50a7f673aaee92aba4a3aec303aa93b071121c09ad05d4ad1dcc2deb9706dcc native/omega/allen/reply.om +5b01eae03204d08f6d207ef29f2ba09a1d9f249f1738f68f151214675a4ff2ed native/omega/allen/runtime.om +c16d61dbcb81f7ef8196c937929a53e47de3de0015e5d663bcd8e49b3cb05002 native/omega/allen/scene-input.om +c8d4a437b41538cc1eeb62a2029c6993d41e5ef90cc7b26c8e1c92bc98ec57d3 native/omega/allen/scene.om +615dff78462a715153b3d891b2cfe146c318d3a0a26ae1aaa642484f965c12df native/omega/allen/scheduler.om +74f13b4200af0a87401b1ba4ceea71e85e38adefd5829382b84116be273ca0c5 native/omega/allen/SURFACE.md +7bdff806421f6a07b12e17750f07e9b8e482a1ae67565a9e1bf0ff9e8237be0b native/omega/allen/surface.om +f4e6bb5571a0700febdecfc6209ae1c088eab50a82bce4d8a10179408e3abb5f native/omega/allen/tests/application.om +f085198549d1c235a97574ff6f6560ce82217611f4051fc3dbbc8286aab6d536 native/omega/allen/tests/check.om +b76438a85257bd95768115047be286c107e3723628a16a0541870732d0849a42 native/omega/allen/tests/code.om +c61bb0ca8f70114e6fd180e9f9a48ec4d2f927152269c11bfc9df55dc13bc1bc native/omega/allen/tests/context.om +98105e1c30626f54da07940fe0415637730b7e112ea39ba2aae1f2d648993373 native/omega/allen/tests/courier.om +f524aab74657dc2e9e4330bf42bc05ef01ce3e8f08a05c80371be0c0a33764d3 native/omega/allen/tests/edges.om +a2e8bcde92d522216a4fa99559dd3bcba096aea86127364587dadcc2bfb585af native/omega/allen/tests/fixture.om +9c293d9f46e8815d96701ef9084deb34c24269d65677682a7be731e589e260bc native/omega/allen/tests/font-mutants.om +cf836ead7ced76a528bd2df1738a2255d9b37b4ab51702d593488bc94726f75a native/omega/allen/tests/font.om +7ef1280488f17ac3001876ca8f1d9a48e202f8fb3305d974e6cd33166458f8eb native/omega/allen/tests/font-output.om +259a9b32c4945bdc08aa6836c666027aa5438ad11165e5c0dfdfdc695d7d3829 native/omega/allen/tests/font-render.om +c9ef2bee7cbd1c072c6045d62c55f3bdd938901e91792cee72ea57fb8f25a198 native/omega/allen/tests/golden.om +8ba742d85ea510586f3cf86661bc0f28c5d99b59981c2d3fb220705efad24564 native/omega/allen/tests/intent.om +861d9af698b021056cceb6c00ae3458558db415963fe832d3fca7da55731cf7b native/omega/allen/tests/memory.om +13e4db7436165783c6aad48497ffe89fa6e5ba3de928e66a766c29e1e817fcf5 native/omega/allen/tests/paint.om +a36e1168fb5b19f5d1b444c6e0d171a6b55a0ffd7e1920438304afd0415d09ba native/omega/allen/tests/presentation-mutants.om +b051af93057752c3d361e1aa5a4dc31bd0853e09d2d2a213d82a282f5709f641 native/omega/allen/tests/presentation.om +e6d232d92d74d88423cebbbbfc6e403ea9b865b80c909e1d23087001d905035a native/omega/allen/tests/probe.om +ebc300f5c8737543acec6397bf7a82000594e13c424df20e203ea7ab09da46c4 native/omega/allen/tests/provider-core.om +0c611ef5d6fe9c5d951fa8886e6425a4cb538c308d99f2723634f253d755cbbb native/omega/allen/tests/provider-display-mutants.om +b98923bd7df278ed0cd8a46c90d90fda296e27c8d60afdd4848ed86dba8221cc native/omega/allen/tests/provider-input.om +37480ca89922dea787a7acb72835a0109b3549461791e7499789ed25932b397c native/omega/allen/tests/provider-mutants.om +d1b1338b2cabe207c1cd9a4bd92b11f51502c29af4b754e2b39fac06d80b28ed native/omega/allen/tests/provider-output.om +8616252944ac2f2903427a6cbf165137087addf3eff169f05f6801d38dac0962 native/omega/allen/tests/provider-process.om +8fbc8a0517900efd771a994686356416a0fea5e20cfd9bc26c787850398113df native/omega/allen/tests/render.om +094a5e833bae7dfd3b013e3f015f143e9d7bd3efe9b9c896a7f58b09e1ec14b8 native/omega/allen/tests/reply.om +bab9b0e853aa4b62918353a5d1625a3171deebfb639e599fe9751b5a61a3df62 native/omega/allen/tests/runtime.om +c5847b4ea0c7df81691fadf9af2f258ad02d3fa588a400448f6d34d7819570b4 native/omega/allen/tests/scene-input.om +b9c84d9a58658589137764fe60209d8320550dd8ed99fa6026df65ba48737e4f native/omega/allen/tests/scene.om +bf984fa9cf63ddb569147afc2a028ccdafdbeae2067125cf35d658e5d00f4c94 native/omega/allen/tests/scheduler.om +521fff50f312b64801017b1349d9a31dac6eac50eb989d93d2dbac4e100f5007 native/omega/allen/tests/stdio-overflow.om +6e1ca3bbe22884ff29f124b04d646165532f9a5d0dc212d093a11f3bcd9c7740 native/omega/allen/tests/surface-mutants.om +612c747d52b34c4861c5a6bfcba05d420bd2d49fe55e27017356a9cc4277178b native/omega/allen/tests/surface.om +5f9c02c51367276ef16019d3755b41013c5055ab8bb7f0d19a138565845af54e native/omega/allen/tests/surface-render.om +89aee5326b428147ea6da9aa739b6679e214ed114ae5f41d3b70299cf864092c native/omega/allen/tests/view.om +0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0 native/omega/allen/vendor/OMEGA-LICENSE +b234738e8ce81b3d67586deb41fdaab4543169d4b69e86fd3dc28a08432ab5fc native/omega/allen/vendor/PROVENANCE.md +992ec4a4957271b442740598136887a5c610effcd8ae9fb9480a006a4f181097 native/omega/allen/vendor/sha256-core.om +0781cdcec18570a57afbe3be4a6717dd2d1fa4c887b49a3e4cb542b594f8a041 native/omega/allen/vendor/sha256.om +abbefd2f7dc48f2ac28b9526f5c2e5b369da4b7c5e84dde6e6a3cd20bd5687ac native/omega/allen/view.om diff --git a/evidence/allen-omega-L694/L765/stale-mutant.log b/evidence/allen-omega-L694/L765/stale-mutant.log new file mode 100644 index 00000000..ac2e3d09 --- /dev/null +++ b/evidence/allen-omega-L694/L765/stale-mutant.log @@ -0,0 +1,28 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 1 +7 1 +8 1 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 diff --git a/evidence/allen-omega-L694/L765/staleview-mutant.log b/evidence/allen-omega-L694/L765/staleview-mutant.log new file mode 100644 index 00000000..c0c96c65 --- /dev/null +++ b/evidence/allen-omega-L694/L765/staleview-mutant.log @@ -0,0 +1,75 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 1 +35 1 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 diff --git a/evidence/allen-omega-L694/L765/summary.json b/evidence/allen-omega-L694/L765/summary.json new file mode 100644 index 00000000..176320ab --- /dev/null +++ b/evidence/allen-omega-L694/L765/summary.json @@ -0,0 +1,69 @@ +{ + "base": "92b405477cfdff40dda25c5afcac5b65cb04122a", + "checks": { + "runtime": 28, + "code": 23, + "courier": 24, + "scheduler": 213, + "application": 182, + "provider-core": 136, + "memory": 79, + "context": 142, + "intent": 8, + "reply": 15, + "view": 13, + "scene": 14, + "scene-input": 63, + "paint": 11, + "edges": 352, + "short": 20, + "long": 292, + "provider-stream": 292, + "provider-fragment": 292, + "provider-process": 3, + "provider-consumer": 3, + "provider-producer": 3, + "provider-bad-1": 5, + "provider-bad-2": 5, + "provider-bad-3": 5, + "provider-bad-4": 5, + "provider-bad-5": 5, + "provider-bad-6": 17, + "presentation": 75, + "font": 421, + "surface": 85 + }, + "total_checks": 2831, + "compiled_rejected_mutants": { + "inputtail-mutant": 1, + "session-mutant": 1, + "appcode-mutant": 3, + "contextjob-mutant": 36, + "readback-mutant": 7, + "staleview-mutant": 2, + "blendbg-mutant": 5, + "clipright-mutant": 5, + "fontroot-mutant": 11, + "fontalpha-mutant": 2, + "hash-mutant": 2, + "contextnote-mutant": 5, + "autosent-mutant": 8, + "thinking-mutant": 6, + "pendingwire-mutant": 1, + "scenecap-mutant": 3, + "crc-mutant": 2, + "ackstop-mutant": 27, + "stale-mutant": 3, + "rawrecv-mutant": 17, + "rawreset-mutant": 8, + "framecheck-mutant": 4, + "rawask-mutant": 2, + "keepalive-mutant": 40 + }, + "focused_checks": 85, + "red_failures": 46, + "surface_ppm_sha256": "676f3d56de19603e07766f2b859b58a55090071cb4a43081b4e7800031872066", + "surface_render_elf_sha256": "9eaf7d395b86a8623307df39b95f29331ad2fb571bf2ea1b4f8fbd7f70a646a9", + "compiler_sha256": "191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9", + "scope": "Provider fixture through retained scene to real Omega pixels; no live inference/hosted window/device qualification." +} diff --git a/evidence/allen-omega-L694/L765/surface.log b/evidence/allen-omega-L694/L765/surface.log new file mode 100644 index 00000000..dd6cb9e2 --- /dev/null +++ b/evidence/allen-omega-L694/L765/surface.log @@ -0,0 +1,85 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 diff --git a/evidence/allen-omega-L694/L765/thinking-mutant.log b/evidence/allen-omega-L694/L765/thinking-mutant.log new file mode 100644 index 00000000..74b41a12 --- /dev/null +++ b/evidence/allen-omega-L694/L765/thinking-mutant.log @@ -0,0 +1,63 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 1 +15 1 +16 0 +17 0 +18 0 +19 1 +20 1 +21 1 +22 1 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 diff --git a/evidence/allen-omega-L694/L765/view.log b/evidence/allen-omega-L694/L765/view.log new file mode 100644 index 00000000..8b194f11 --- /dev/null +++ b/evidence/allen-omega-L694/L765/view.log @@ -0,0 +1,13 @@ +901 0 +902 0 +903 0 +904 0 +905 0 +906 0 +907 0 +908 0 +909 0 +910 0 +911 0 +912 0 +913 0 diff --git a/evidence/allen-omega-L694/README.md b/evidence/allen-omega-L694/README.md new file mode 100644 index 00000000..cb531ded --- /dev/null +++ b/evidence/allen-omega-L694/README.md @@ -0,0 +1,46 @@ +# L694 native acceptance (WIP) + +All execution is Linux AArch64 host execution, no QEMU/iMac/physical/live claim. +Frozen behavioral source is baseline da55660ea7337f2b6a42095fcd1fb6ddebe1cc7c. +Native product/test sources: native/omega/allen. `accepted/` is replay5 history; +final immutable-source replay is recorded by the later closure receipt. + +Current implemented acceptance: runtime28, CODE23, courier24, memory/notes79, +intent8, reply15, code-view13, scene14, paint11, boundary/recovery352, +legacy short fixture20 and long fixture292 =879 checks, zero failed. +Five valid compiled mutants fail original gates: stale-ID3, CRC2, SHA2, +readback7 and session1 failed assertions, all native exits1..99. +Independent full4096-byte memory golden comparison passes. Native render produces +mind-component.ppm with the actual Omega pixel loop, not a fabricated screenshot. +Standalone stdio code exchange outputs JOB and immediate acknowledgement/fixture +completion. Input is canned **test data**, never model output or live attachment. + +Exact commands: + +```sh +quiet-build native/omega/allen/gate.sh target/allen-omega-L694/new-empty-output +quiet-build env AIENOS_STRICT=1 ./scripts/verify_all.sh +quiet-build cargo clippy --offline --all-targets -- -D warnings +``` + +Repository strict suite: FAIL exit101. Formatting passed; four existing +allen-courier socket tests hit OS EPERM. verify-all.log preserves full output. +Clippy is separately recorded in clippy.log. No assertion was skipped or waived. +Legacy suite is compatibility evidence only, not an Omega acceptance backend. + +Fixtures short.wire/long.wire were emitted by the unchanged existing +`target/release/allen-courier --split native/kernel/svc/tests/fixtures/code/{short,long}.txt` +after `quiet-build cargo build --offline -q --release -p allen-courier --bin allen-courier`. +Its implementation is a fixture oracle, not an execution-closure dependency. +Full code CRC32768 x bytes is independently frozen from GNU gzip trailer: +CRC ba3e1bc1; native boundary test checks acceptance, then CRC corruption refusal. +Memory reference is independently assembled from layout with dd/printf, sealed +using sha256sum and xxd, then compared byte-for-byte. No new C/Rust/Python/JS +program or test backend exists. Shell merely constructs references/builds/runs. + +Original failed receipts and exact behavioral RED sources remain here. See +[development-failures.md](development-failures.md). Receipt replay2 is invalid; +only corrected later replays count. Source/compiler/executable hashes and native +per-check outputs are retained. Output binaries live under target/allen-omega-L694 +and the permitted handoff tree, not in Git. Target/platform gates and remaining +portable compatibility are listed in native/omega/allen/README.md. diff --git a/evidence/allen-omega-L694/accepted/binaries.sha256 b/evidence/allen-omega-L694/accepted/binaries.sha256 new file mode 100644 index 00000000..f5754352 --- /dev/null +++ b/evidence/allen-omega-L694/accepted/binaries.sha256 @@ -0,0 +1,19 @@ +da36a1ca8ceb536ad5e831560c10ef2f4e995e256f9525fb256470109d840810 target/allen-omega-L694/replay5/readback-mutant +798543784942f29bc405e5a560a73ec50025553d5190f0d00fc59aa8e5376c69 target/allen-omega-L694/replay5/view +c22923a20f4bd9f30a3bc8e51544b10533a7c0a20bc65856a107a163362312e8 target/allen-omega-L694/replay5/allen +ac0bc89319605462156184f3f39e62e7cc12e2748d8feb3d39c80e91d383dbef target/allen-omega-L694/replay5/reply +f75db42bc8ee80899ccfda45022a6be3d80c439922edd6c36eee2c36de30ffec target/allen-omega-L694/replay5/hash-mutant +0039a6d288e11ec70b12b1af15909bb308c6b72f08cb39c51fe06aad245e2690 target/allen-omega-L694/replay5/golden +d3ed86f446ac73fc813f8cb905e0fa30e8fc26d9984c3e47ced86424690fc3d9 target/allen-omega-L694/replay5/session-mutant +bb17eefbb058191b0669ab15529051c5de99e0f25448e05501d8fc7f9532b3af target/allen-omega-L694/replay5/intent +9bbf95a44321be8d57043d5daa68f4945d2eac63be7e5befa260db79a6defea8 target/allen-omega-L694/replay5/fixture +52f05863a960da4e021bae3eecb161792663ce3dfcc701a685a9f93b65570ff7 target/allen-omega-L694/replay5/runtime +b6d231c1a1b1cb2fcdea6fcbbc3419aa5aec92ff9fc9984d261dcbc26943b737 target/allen-omega-L694/replay5/code +d30797bb341012516081fb6620ec21c6e3f428194ab9968b2181f8074786eba6 target/allen-omega-L694/replay5/edges +87676023c7d49e5ea9346f84c71aed4511046bd29f76ed91eea3fd727660ad8d target/allen-omega-L694/replay5/render +7391168db6c88324a04881498ad7b671fd306226921e050d9777e090d0e6cc6e target/allen-omega-L694/replay5/stale-mutant +3031d8376ce13d13b8ff55005600e36caf14ac4a59362611f2f5aefd639fe238 target/allen-omega-L694/replay5/courier +44601a3b526c1e799b908342454f1fd3992ac70b83a396a04f2daef8e06ef21c target/allen-omega-L694/replay5/scene +fd080b24d5b5833f70237e966c4bc8688dc4aadba8486b739dc7694fcaf99f6d target/allen-omega-L694/replay5/paint +0e1de4f532b286d8a0fe320bb9b9d61a0724b545e65d27e1fc43e497fac2ec7f target/allen-omega-L694/replay5/crc-mutant +1a210071b068ef5e527dc66651ab635c53971add8b9cfab09c2fdff2290ff6dd target/allen-omega-L694/replay5/memory diff --git a/evidence/allen-omega-L694/accepted/code.log b/evidence/allen-omega-L694/accepted/code.log new file mode 100644 index 00000000..e7e197b7 --- /dev/null +++ b/evidence/allen-omega-L694/accepted/code.log @@ -0,0 +1,23 @@ +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 diff --git a/evidence/allen-omega-L694/accepted/courier.log b/evidence/allen-omega-L694/accepted/courier.log new file mode 100644 index 00000000..8402df49 --- /dev/null +++ b/evidence/allen-omega-L694/accepted/courier.log @@ -0,0 +1,24 @@ +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 diff --git a/evidence/allen-omega-L694/accepted/crc-mutant.log b/evidence/allen-omega-L694/accepted/crc-mutant.log new file mode 100644 index 00000000..a0d90bd4 --- /dev/null +++ b/evidence/allen-omega-L694/accepted/crc-mutant.log @@ -0,0 +1,23 @@ +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 1 +117 1 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 diff --git a/evidence/allen-omega-L694/accepted/edges.log b/evidence/allen-omega-L694/accepted/edges.log new file mode 100644 index 00000000..e8d0deea --- /dev/null +++ b/evidence/allen-omega-L694/accepted/edges.log @@ -0,0 +1,352 @@ +1201 0 +1202 0 +1203 0 +1204 0 +1205 0 +1206 0 +1207 0 +1208 0 +1209 0 +1210 0 +1211 0 +1212 0 +1213 0 +1214 0 +1220 0 +1221 0 +1222 0 +1223 0 +1224 0 +1225 0 +1226 0 +1227 0 +1228 0 +1229 0 +1230 0 +1231 0 +1232 0 +1233 0 +1234 0 +1235 0 +1236 0 +1237 0 +1238 0 +1239 0 +1240 0 +1241 0 +1242 0 +1243 0 +1244 0 +1245 0 +1246 0 +1247 0 +1248 0 +1249 0 +1250 0 +1251 0 +1252 0 +1253 0 +1254 0 +1255 0 +1256 0 +1257 0 +1258 0 +1259 0 +1260 0 +1261 0 +1262 0 +1301 0 +1302 0 +1303 0 +1304 0 +1305 0 +1306 0 +1310 0 +1311 0 +1312 0 +1313 0 +1314 0 +1315 0 +1316 0 +1317 0 +1318 0 +1319 0 +1320 0 +1321 0 +1322 0 +1323 0 +1324 0 +1325 0 +1326 0 +1327 0 +1328 0 +1329 0 +1330 0 +1331 0 +1332 0 +1333 0 +1334 0 +1335 0 +1336 0 +1337 0 +1338 0 +1339 0 +1340 0 +1341 0 +1342 0 +1343 0 +1344 0 +1345 0 +1346 0 +1347 0 +1348 0 +1349 0 +1350 0 +1351 0 +1352 0 +1353 0 +1354 0 +1355 0 +1356 0 +1357 0 +1358 0 +1359 0 +1360 0 +1361 0 +1362 0 +1363 0 +1364 0 +1365 0 +1366 0 +1367 0 +1368 0 +1369 0 +1370 0 +1371 0 +1372 0 +1373 0 +1374 0 +1375 0 +1376 0 +1377 0 +1378 0 +1379 0 +1380 0 +1381 0 +1382 0 +1383 0 +1384 0 +1385 0 +1386 0 +1387 0 +1388 0 +1389 0 +1390 0 +1391 0 +1392 0 +1393 0 +1394 0 +1395 0 +1396 0 +1397 0 +1398 0 +1399 0 +1400 0 +1401 0 +1402 0 +1403 0 +1404 0 +1405 0 +1406 0 +1407 0 +1408 0 +1409 0 +1410 0 +1411 0 +1412 0 +1413 0 +1414 0 +1415 0 +1416 0 +1417 0 +1418 0 +1419 0 +1420 0 +1421 0 +1422 0 +1423 0 +1424 0 +1425 0 +1426 0 +1427 0 +1428 0 +1429 0 +1430 0 +1431 0 +1432 0 +1433 0 +1434 0 +1435 0 +1436 0 +1437 0 +1438 0 +1439 0 +1440 0 +1441 0 +1442 0 +1443 0 +1444 0 +1445 0 +1446 0 +1447 0 +1448 0 +1449 0 +1450 0 +1451 0 +1452 0 +1453 0 +1454 0 +1455 0 +1456 0 +1457 0 +1458 0 +1459 0 +1460 0 +1461 0 +1462 0 +1463 0 +1464 0 +1465 0 +1466 0 +1467 0 +1468 0 +1469 0 +1470 0 +1471 0 +1472 0 +1473 0 +1474 0 +1475 0 +1476 0 +1477 0 +1478 0 +1479 0 +1480 0 +1481 0 +1482 0 +1483 0 +1484 0 +1485 0 +1486 0 +1487 0 +1488 0 +1489 0 +1490 0 +1491 0 +1492 0 +1493 0 +1494 0 +1495 0 +1496 0 +1497 0 +1498 0 +1499 0 +1500 0 +1501 0 +1502 0 +1503 0 +1504 0 +1505 0 +1506 0 +1507 0 +1508 0 +1509 0 +1510 0 +1511 0 +1512 0 +1513 0 +1514 0 +1515 0 +1516 0 +1517 0 +1518 0 +1519 0 +1520 0 +1521 0 +1522 0 +1523 0 +1524 0 +1525 0 +1526 0 +1527 0 +1528 0 +1529 0 +1530 0 +1531 0 +1532 0 +1533 0 +1534 0 +1535 0 +1536 0 +1537 0 +1538 0 +1539 0 +1540 0 +1541 0 +1542 0 +1543 0 +1544 0 +1545 0 +1546 0 +1547 0 +1548 0 +1549 0 +1550 0 +1551 0 +1552 0 +1553 0 +1554 0 +1555 0 +1556 0 +1557 0 +1558 0 +1559 0 +1560 0 +1561 0 +1562 0 +1563 0 +1564 0 +1565 0 +1570 0 +1571 0 +1572 0 +1575 0 +1573 0 +1574 0 +1600 0 +1601 0 +1602 0 +1603 0 +1604 0 +1605 0 +1606 0 +1607 0 +1610 0 +1611 0 +1612 0 +1613 0 +1614 0 +1615 0 +1616 0 +1617 0 +1701 0 +1702 0 +1703 0 +1704 0 +1705 0 +1706 0 +1707 0 +1708 0 +1709 0 +1710 0 +1711 0 diff --git a/evidence/allen-omega-L694/accepted/hash-mutant.log b/evidence/allen-omega-L694/accepted/hash-mutant.log new file mode 100644 index 00000000..c75cfefb --- /dev/null +++ b/evidence/allen-omega-L694/accepted/hash-mutant.log @@ -0,0 +1,79 @@ +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 1 +310 1 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +362 0 +363 0 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 0 +361 0 diff --git a/evidence/allen-omega-L694/accepted/intent.log b/evidence/allen-omega-L694/accepted/intent.log new file mode 100644 index 00000000..5371bd36 --- /dev/null +++ b/evidence/allen-omega-L694/accepted/intent.log @@ -0,0 +1,8 @@ +501 0 +502 0 +503 0 +504 0 +505 0 +506 0 +507 0 +508 0 diff --git a/evidence/allen-omega-L694/accepted/long.log b/evidence/allen-omega-L694/accepted/long.log new file mode 100644 index 00000000..0a060bc8 --- /dev/null +++ b/evidence/allen-omega-L694/accepted/long.log @@ -0,0 +1,292 @@ +401 0 +410 0 +411 0 +412 0 +413 0 +414 0 +415 0 +416 0 +417 0 +418 0 +419 0 +420 0 +421 0 +422 0 +423 0 +424 0 +425 0 +426 0 +427 0 +428 0 +429 0 +430 0 +431 0 +432 0 +433 0 +434 0 +435 0 +436 0 +437 0 +438 0 +439 0 +440 0 +441 0 +442 0 +443 0 +444 0 +445 0 +446 0 +447 0 +448 0 +449 0 +450 0 +451 0 +452 0 +453 0 +454 0 +455 0 +456 0 +457 0 +458 0 +459 0 +460 0 +461 0 +462 0 +463 0 +464 0 +465 0 +466 0 +467 0 +468 0 +469 0 +470 0 +471 0 +472 0 +473 0 +474 0 +475 0 +476 0 +477 0 +478 0 +479 0 +480 0 +481 0 +482 0 +483 0 +484 0 +485 0 +486 0 +487 0 +488 0 +489 0 +490 0 +491 0 +492 0 +493 0 +494 0 +495 0 +496 0 +497 0 +498 0 +499 0 +500 0 +501 0 +502 0 +503 0 +504 0 +505 0 +506 0 +507 0 +508 0 +509 0 +510 0 +511 0 +512 0 +513 0 +514 0 +515 0 +516 0 +517 0 +518 0 +519 0 +520 0 +521 0 +522 0 +523 0 +524 0 +525 0 +526 0 +527 0 +528 0 +529 0 +530 0 +531 0 +532 0 +533 0 +534 0 +535 0 +536 0 +537 0 +538 0 +539 0 +540 0 +541 0 +542 0 +543 0 +544 0 +545 0 +546 0 +547 0 +548 0 +549 0 +550 0 +402 0 +403 0 +404 0 +405 0 +406 0 +700 0 +701 0 +702 0 +703 0 +704 0 +705 0 +706 0 +707 0 +708 0 +709 0 +710 0 +711 0 +712 0 +713 0 +714 0 +715 0 +716 0 +717 0 +718 0 +719 0 +720 0 +721 0 +722 0 +723 0 +724 0 +725 0 +726 0 +727 0 +728 0 +729 0 +730 0 +731 0 +732 0 +733 0 +734 0 +735 0 +736 0 +737 0 +738 0 +739 0 +740 0 +741 0 +742 0 +743 0 +744 0 +745 0 +746 0 +747 0 +748 0 +749 0 +750 0 +751 0 +752 0 +753 0 +754 0 +755 0 +756 0 +757 0 +758 0 +759 0 +760 0 +761 0 +762 0 +763 0 +764 0 +765 0 +766 0 +767 0 +768 0 +769 0 +770 0 +771 0 +772 0 +773 0 +774 0 +775 0 +776 0 +777 0 +778 0 +779 0 +780 0 +781 0 +782 0 +783 0 +784 0 +785 0 +786 0 +787 0 +788 0 +789 0 +790 0 +791 0 +792 0 +793 0 +794 0 +795 0 +796 0 +797 0 +798 0 +799 0 +800 0 +801 0 +802 0 +803 0 +804 0 +805 0 +806 0 +807 0 +808 0 +809 0 +810 0 +811 0 +812 0 +813 0 +814 0 +815 0 +816 0 +817 0 +818 0 +819 0 +820 0 +821 0 +822 0 +823 0 +824 0 +825 0 +826 0 +827 0 +828 0 +829 0 +830 0 +831 0 +832 0 +833 0 +834 0 +835 0 +836 0 +837 0 +838 0 +839 0 +840 0 +841 0 +407 0 +408 0 +409 0 diff --git a/evidence/allen-omega-L694/accepted/memory.log b/evidence/allen-omega-L694/accepted/memory.log new file mode 100644 index 00000000..5928102e --- /dev/null +++ b/evidence/allen-omega-L694/accepted/memory.log @@ -0,0 +1,79 @@ +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 0 +310 0 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +362 0 +363 0 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 0 +361 0 diff --git a/evidence/allen-omega-L694/accepted/paint.log b/evidence/allen-omega-L694/accepted/paint.log new file mode 100644 index 00000000..281a5bd2 --- /dev/null +++ b/evidence/allen-omega-L694/accepted/paint.log @@ -0,0 +1,11 @@ +1101 0 +1102 0 +1103 0 +1104 0 +1105 0 +1106 0 +1107 0 +1108 0 +1109 0 +1110 0 +1111 0 diff --git a/evidence/allen-omega-L694/accepted/readback-mutant.log b/evidence/allen-omega-L694/accepted/readback-mutant.log new file mode 100644 index 00000000..268002ad --- /dev/null +++ b/evidence/allen-omega-L694/accepted/readback-mutant.log @@ -0,0 +1,79 @@ +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 0 +310 0 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 1 +339 1 +340 0 +341 0 +342 0 +343 0 +344 1 +345 0 +346 0 +347 0 +348 0 +349 1 +350 1 +351 0 +352 0 +362 0 +363 0 +353 1 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 1 +361 0 diff --git a/evidence/allen-omega-L694/accepted/reply.log b/evidence/allen-omega-L694/accepted/reply.log new file mode 100644 index 00000000..d11a72ad --- /dev/null +++ b/evidence/allen-omega-L694/accepted/reply.log @@ -0,0 +1,15 @@ +801 0 +802 0 +803 0 +804 0 +805 0 +806 0 +807 0 +808 0 +809 0 +810 0 +811 0 +812 0 +813 0 +814 0 +815 0 diff --git a/evidence/allen-omega-L694/accepted/runtime.log b/evidence/allen-omega-L694/accepted/runtime.log new file mode 100644 index 00000000..5168e6f3 --- /dev/null +++ b/evidence/allen-omega-L694/accepted/runtime.log @@ -0,0 +1,28 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 diff --git a/evidence/allen-omega-L694/accepted/scene.log b/evidence/allen-omega-L694/accepted/scene.log new file mode 100644 index 00000000..44a4b2b1 --- /dev/null +++ b/evidence/allen-omega-L694/accepted/scene.log @@ -0,0 +1,14 @@ +1001 0 +1002 0 +1003 0 +1004 0 +1005 0 +1006 0 +1007 0 +1008 0 +1009 0 +1010 0 +1011 0 +1012 0 +1013 0 +1014 0 diff --git a/evidence/allen-omega-L694/accepted/session-mutant.log b/evidence/allen-omega-L694/accepted/session-mutant.log new file mode 100644 index 00000000..9ce7ef78 --- /dev/null +++ b/evidence/allen-omega-L694/accepted/session-mutant.log @@ -0,0 +1,24 @@ +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 1 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 diff --git a/evidence/allen-omega-L694/accepted/short.log b/evidence/allen-omega-L694/accepted/short.log new file mode 100644 index 00000000..a9da2dc8 --- /dev/null +++ b/evidence/allen-omega-L694/accepted/short.log @@ -0,0 +1,20 @@ +401 0 +410 0 +411 0 +412 0 +413 0 +414 0 +402 0 +403 0 +404 0 +405 0 +406 0 +700 0 +701 0 +702 0 +703 0 +704 0 +705 0 +407 0 +408 0 +409 0 diff --git a/evidence/allen-omega-L694/accepted/source.sha256 b/evidence/allen-omega-L694/accepted/source.sha256 new file mode 100644 index 00000000..61319829 --- /dev/null +++ b/evidence/allen-omega-L694/accepted/source.sha256 @@ -0,0 +1,28 @@ +184f4270c72c4eca6a7afdd28b70a608f2e237980b12c8a7bfc2c7d2c3e625b9 native/omega/allen/base.om +4d2235ac5d6b237695b1c3112f70ebdfa0cebafa2ec8e691e4be4de37a62199b native/omega/allen/code.om +76ee9cdeaac036905c76dfa29f42bf5a78d1259ad1656adfaa24916c3b93550d native/omega/allen/courier.om +06087bc573ebb876a0ed80f6025c592fb4b1d23335169c3da402824fd1482c35 native/omega/allen/intent.om +2346077ef78cf54124f777016cf44e1034546f400bb6642e73713c8987875f0f native/omega/allen/main.om +068292abd04d3a61b063fc5380b22a56c4235a87915c219ebf3b37d16d7bc9c7 native/omega/allen/memory.om +b4d7b6e6cd680d2ba1eec2978b0cbb81ffc63035b73f5c3726bdad97a7b6aa04 native/omega/allen/paint.om +e50a7f673aaee92aba4a3aec303aa93b071121c09ad05d4ad1dcc2deb9706dcc native/omega/allen/reply.om +5b01eae03204d08f6d207ef29f2ba09a1d9f249f1738f68f151214675a4ff2ed native/omega/allen/runtime.om +c8d4a437b41538cc1eeb62a2029c6993d41e5ef90cc7b26c8e1c92bc98ec57d3 native/omega/allen/scene.om +abbefd2f7dc48f2ac28b9526f5c2e5b369da4b7c5e84dde6e6a3cd20bd5687ac native/omega/allen/view.om +f085198549d1c235a97574ff6f6560ce82217611f4051fc3dbbc8286aab6d536 native/omega/allen/tests/check.om +b76438a85257bd95768115047be286c107e3723628a16a0541870732d0849a42 native/omega/allen/tests/code.om +98105e1c30626f54da07940fe0415637730b7e112ea39ba2aae1f2d648993373 native/omega/allen/tests/courier.om +f524aab74657dc2e9e4330bf42bc05ef01ce3e8f08a05c80371be0c0a33764d3 native/omega/allen/tests/edges.om +a2e8bcde92d522216a4fa99559dd3bcba096aea86127364587dadcc2bfb585af native/omega/allen/tests/fixture.om +c9ef2bee7cbd1c072c6045d62c55f3bdd938901e91792cee72ea57fb8f25a198 native/omega/allen/tests/golden.om +8ba742d85ea510586f3cf86661bc0f28c5d99b59981c2d3fb220705efad24564 native/omega/allen/tests/intent.om +861d9af698b021056cceb6c00ae3458558db415963fe832d3fca7da55731cf7b native/omega/allen/tests/memory.om +13e4db7436165783c6aad48497ffe89fa6e5ba3de928e66a766c29e1e817fcf5 native/omega/allen/tests/paint.om +e6d232d92d74d88423cebbbbfc6e403ea9b865b80c909e1d23087001d905035a native/omega/allen/tests/probe.om +8fbc8a0517900efd771a994686356416a0fea5e20cfd9bc26c787850398113df native/omega/allen/tests/render.om +094a5e833bae7dfd3b013e3f015f143e9d7bd3efe9b9c896a7f58b09e1ec14b8 native/omega/allen/tests/reply.om +bab9b0e853aa4b62918353a5d1625a3171deebfb639e599fe9751b5a61a3df62 native/omega/allen/tests/runtime.om +b9c84d9a58658589137764fe60209d8320550dd8ed99fa6026df65ba48737e4f native/omega/allen/tests/scene.om +89aee5326b428147ea6da9aa739b6679e214ed114ae5f41d3b70299cf864092c native/omega/allen/tests/view.om +992ec4a4957271b442740598136887a5c610effcd8ae9fb9480a006a4f181097 native/omega/allen/vendor/sha256-core.om +0781cdcec18570a57afbe3be4a6717dd2d1fa4c887b49a3e4cb542b594f8a041 native/omega/allen/vendor/sha256.om diff --git a/evidence/allen-omega-L694/accepted/stale-mutant.log b/evidence/allen-omega-L694/accepted/stale-mutant.log new file mode 100644 index 00000000..ac2e3d09 --- /dev/null +++ b/evidence/allen-omega-L694/accepted/stale-mutant.log @@ -0,0 +1,28 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 1 +7 1 +8 1 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 diff --git a/evidence/allen-omega-L694/accepted/view.log b/evidence/allen-omega-L694/accepted/view.log new file mode 100644 index 00000000..8b194f11 --- /dev/null +++ b/evidence/allen-omega-L694/accepted/view.log @@ -0,0 +1,13 @@ +901 0 +902 0 +903 0 +904 0 +905 0 +906 0 +907 0 +908 0 +909 0 +910 0 +911 0 +912 0 +913 0 diff --git a/evidence/allen-omega-L694/bootstrap.log b/evidence/allen-omega-L694/bootstrap.log new file mode 100644 index 00000000..4b4f49ed --- /dev/null +++ b/evidence/allen-omega-L694/bootstrap.log @@ -0,0 +1,3 @@ +/home/drakestapleton/.local/bin/quiet-build: 47: cannot create /home/drakestapleton/.local/state/quiet/waits.log: Read-only file system +/home/drakestapleton/.local/bin/quiet-build: 47: printf: printf: I/O error +PASS source-only seed bootstrap and compiler fixpoint diff --git a/evidence/allen-omega-L694/checkpoint1.md b/evidence/allen-omega-L694/checkpoint1.md new file mode 100644 index 00000000..610df8eb --- /dev/null +++ b/evidence/allen-omega-L694/checkpoint1.md @@ -0,0 +1,14 @@ +# Checkpoint 1 WIP + +Compiler probe: exit0, static AArch64 ELF. Runtime behavioral stub: compiled ELF, +exit15 (15 assertions failed). Implemented runtime: 28/28 checks, exit0. +Intermediate implementation compile refused line224 error5 (extra operand in +put R); corrected before execution. Failed/empty compiler output was not executed +successfully; shell invocation refused with126, no acceptance claimed from it. +quiet-build invoked for builds; its external ~/.local/state log is read-only in +this sandbox and reports logging errors; compiler invocation itself succeeds. + +Product: typed chat/code/follow-up admission, monotonic request IDs, busy/length/ +ASCII refusal, immediate coding acknowledgment, model answer input, cancellation, +slow-once and silence timeout, bounded transcript history and restoration entry. +Not yet all runtime edge cases covered. No model connection, target or live claim. diff --git a/evidence/allen-omega-L694/checkpoint1.sha256 b/evidence/allen-omega-L694/checkpoint1.sha256 new file mode 100644 index 00000000..9cdce55b --- /dev/null +++ b/evidence/allen-omega-L694/checkpoint1.sha256 @@ -0,0 +1,5 @@ +0781cdcec18570a57afbe3be4a6717dd2d1fa4c887b49a3e4cb542b594f8a041 native/omega/allen/vendor/sha256.om +e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 target/allen-omega-L694/runtime-green +a7b22416dc6ed824fe2888fa158c73148ab01bd3aa8586605780c0f7c5052725 target/allen-omega-L694/runtime-green.om +ceeb5e2b7b5d7dc7883fb6c043b6da64e52f193ed7853de4c8b96452e3cc706d target/allen-omega-L694/runtime-red +82aaecff6a33dcef7101e3c35f84b0f1121a569173984b3bb42bf023832025c6 target/allen-omega-L694/runtime-red.om diff --git a/evidence/allen-omega-L694/clippy.log b/evidence/allen-omega-L694/clippy.log new file mode 100644 index 00000000..dae09550 --- /dev/null +++ b/evidence/allen-omega-L694/clippy.log @@ -0,0 +1,43 @@ +/home/drakestapleton/.local/bin/quiet-build: 47: cannot create /home/drakestapleton/.local/state/quiet/waits.log: Read-only file system +/home/drakestapleton/.local/bin/quiet-build: 47: printf: printf: I/O error + Checking typenum v1.20.1 + Checking aienos-crypto v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-crypto) + Checking cfg-if v1.0.5 + Checking subtle v2.6.1 + Checking signature v2.2.0 + Checking zeroize v1.9.0 + Checking aienos-capability v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-capability) + Checking aienos-accel v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-accel) + Checking memchr v2.8.3 + Checking itoa v1.0.18 + Checking aienos-infer v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-infer) + Checking allen-design-tokens v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/allen-design-tokens) + Checking libc v0.2.189 + Checking serde_core v1.0.229 + Checking zmij v1.0.23 + Checking allen-courier v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/allen-courier) + Checking aienos-boot v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-boot) + Checking ed25519 v2.2.3 + Checking aienos-capability-ffi v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-capability-ffi) + Checking allen-reflex v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/allen-reflex) + Checking generic-array v0.14.7 + Checking cpufeatures v0.2.17 + Checking crypto-common v0.1.7 + Checking block-buffer v0.10.4 + Checking digest v0.10.7 + Checking sha2 v0.10.9 + Checking curve25519-dalek v4.1.3 + Checking ed25519-dalek v2.2.0 + Checking serde_json v1.0.151 + Checking serde v1.0.229 + Checking aienos-artifact v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-artifact) + Checking aienos-kernel v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-kernel) + Checking aienos-artifact-tool v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-artifact-tool) + Checking aienos-agent-state v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-agent-state) + Checking aienos-cortex v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-cortex) + Checking aienos-evidence v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-evidence) + Checking aienos-store-tool v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-store-tool) + Checking aienos-explain v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-explain) + Checking aienos-c1-tree v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-c1-tree) + Checking aienos-aegis v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-aegis) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 3.80s diff --git a/evidence/allen-omega-L694/code1.txt b/evidence/allen-omega-L694/code1.txt new file mode 100644 index 00000000..e7e197b7 --- /dev/null +++ b/evidence/allen-omega-L694/code1.txt @@ -0,0 +1,23 @@ +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 diff --git a/evidence/allen-omega-L694/compiler.sha256 b/evidence/allen-omega-L694/compiler.sha256 new file mode 100644 index 00000000..783beb8d --- /dev/null +++ b/evidence/allen-omega-L694/compiler.sha256 @@ -0,0 +1,2 @@ +191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9 /home/drakestapleton/handoffs/allen-omega-L694/omc +191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9 target/allen-omega-L694/compiler-source/build/bootstrap/omc diff --git a/evidence/allen-omega-L694/courier1.txt b/evidence/allen-omega-L694/courier1.txt new file mode 100644 index 00000000..e69de29b diff --git a/evidence/allen-omega-L694/courier2.txt b/evidence/allen-omega-L694/courier2.txt new file mode 100644 index 00000000..414d7e4f --- /dev/null +++ b/evidence/allen-omega-L694/courier2.txt @@ -0,0 +1,24 @@ +201 1 +202 1 +203 1 +204 1 +205 1 +206 1 +207 0 +208 0 +209 1 +210 0 +211 0 +212 1 +213 1 +214 1 +215 1 +216 0 +217 1 +218 0 +219 1 +220 1 +221 0 +222 1 +223 1 +224 1 diff --git a/evidence/allen-omega-L694/courier3.txt b/evidence/allen-omega-L694/courier3.txt new file mode 100644 index 00000000..883f77b5 --- /dev/null +++ b/evidence/allen-omega-L694/courier3.txt @@ -0,0 +1,24 @@ +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 1 +213 1 +214 1 +215 1 +216 0 +217 1 +218 0 +219 1 +220 1 +221 0 +222 1 +223 1 +224 1 diff --git a/evidence/allen-omega-L694/courier4.txt b/evidence/allen-omega-L694/courier4.txt new file mode 100644 index 00000000..8402df49 --- /dev/null +++ b/evidence/allen-omega-L694/courier4.txt @@ -0,0 +1,24 @@ +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 diff --git a/evidence/allen-omega-L694/development-failures.md b/evidence/allen-omega-L694/development-failures.md new file mode 100644 index 00000000..c638a185 --- /dev/null +++ b/evidence/allen-omega-L694/development-failures.md @@ -0,0 +1,35 @@ +# Preserved development failures + +These are debugging history, not accepted gates or TDD RED counts. + +* runtime-green first compile: extra put operand, error5; shell attempt returned126 + on empty non-executable output. Corrected. No invalid ELF ran or earned a pass. +* courier1: register budget error12. Split/reduced locals. courier2 exit17 and + courier3 exit10 exposed header offsets and a test clobbering the packet output + through its own check printer. courier4 and fresh replays pass. +* intent1/2, view1, paint1: error12; simplified functions/condition temporaries. +* scene1 native exit1: mood token indexing; corrected. scene2 passes. +* allen1: error7, function `want` conflicted with local name; renamed jobwant. + allen2: error7 (write fd type); allen3: error3 (text declaration order). +* replay1: error10 (scene parameter `start` conflicted with runtime function). +* replay2 printed PASS with session mutant exit0: INVALID acceptance receipt. + Found a weak test corrupting header syntax instead of session digits and an + external shell AND-list missing explicit failure. Corrected both. replay3+ + reject the session mutant with nonzero native behavioral assertion failures. + +Behavioral RED records (valid compiled static AArch64 ELFs): runtime stubs exit15; +intent-edge-red exit1; load-edge-red exit2. Their exact combined Omega sources +and native assertion output are committed here. Remaining tests were incremental +regression development; no claim every module had a pre-implementation RED. + +Original quiet-build reports its ~/.local/state log cannot be written in the +sandbox. It still runs the compiler while holding its shared lock; errors are +preserved in bootstrap/replay/strict/clippy logs. Compiler/builder exit statuses +are enforced in gate.sh. Empty/nonstatic/wrong-machine outputs cannot proceed. + +Publication attempts: git add/commit at original metadata fail with read-only +index.lock under aienos-imac-allen/.git/worktrees/aienos-allen-omega-L694. +`git push origin feat/allen-omega-L694` fails: cannot resolve github.com. +No approval bypass or service/network changes attempted. Separate publication +metadata under the permitted handoff root records this same worktree's commits; +it is not another worktree or implementation worker. diff --git a/evidence/allen-omega-L694/edges1.txt b/evidence/allen-omega-L694/edges1.txt new file mode 100644 index 00000000..b8e2f521 --- /dev/null +++ b/evidence/allen-omega-L694/edges1.txt @@ -0,0 +1,351 @@ +1201 0 +1202 0 +1203 0 +1204 0 +1205 0 +1206 0 +1207 0 +1208 0 +1209 0 +1210 0 +1211 0 +1212 0 +1213 0 +1214 0 +1220 0 +1221 0 +1222 0 +1223 0 +1224 0 +1225 0 +1226 0 +1227 0 +1228 0 +1229 0 +1230 0 +1231 0 +1232 0 +1233 0 +1234 0 +1235 0 +1236 0 +1237 0 +1238 0 +1239 0 +1240 0 +1241 0 +1242 0 +1243 0 +1244 0 +1245 0 +1246 0 +1247 0 +1248 0 +1249 0 +1250 0 +1251 0 +1252 0 +1253 0 +1254 0 +1255 0 +1256 0 +1257 0 +1258 0 +1259 0 +1260 0 +1261 0 +1262 0 +1301 0 +1302 0 +1303 0 +1304 0 +1305 0 +1306 0 +1310 0 +1311 0 +1312 0 +1313 0 +1314 0 +1315 0 +1316 0 +1317 0 +1318 0 +1319 0 +1320 0 +1321 0 +1322 0 +1323 0 +1324 0 +1325 0 +1326 0 +1327 0 +1328 0 +1329 0 +1330 0 +1331 0 +1332 0 +1333 0 +1334 0 +1335 0 +1336 0 +1337 0 +1338 0 +1339 0 +1340 0 +1341 0 +1342 0 +1343 0 +1344 0 +1345 0 +1346 0 +1347 0 +1348 0 +1349 0 +1350 0 +1351 0 +1352 0 +1353 0 +1354 0 +1355 0 +1356 0 +1357 0 +1358 0 +1359 0 +1360 0 +1361 0 +1362 0 +1363 0 +1364 0 +1365 0 +1366 0 +1367 0 +1368 0 +1369 0 +1370 0 +1371 0 +1372 0 +1373 0 +1374 0 +1375 0 +1376 0 +1377 0 +1378 0 +1379 0 +1380 0 +1381 0 +1382 0 +1383 0 +1384 0 +1385 0 +1386 0 +1387 0 +1388 0 +1389 0 +1390 0 +1391 0 +1392 0 +1393 0 +1394 0 +1395 0 +1396 0 +1397 0 +1398 0 +1399 0 +1400 0 +1401 0 +1402 0 +1403 0 +1404 0 +1405 0 +1406 0 +1407 0 +1408 0 +1409 0 +1410 0 +1411 0 +1412 0 +1413 0 +1414 0 +1415 0 +1416 0 +1417 0 +1418 0 +1419 0 +1420 0 +1421 0 +1422 0 +1423 0 +1424 0 +1425 0 +1426 0 +1427 0 +1428 0 +1429 0 +1430 0 +1431 0 +1432 0 +1433 0 +1434 0 +1435 0 +1436 0 +1437 0 +1438 0 +1439 0 +1440 0 +1441 0 +1442 0 +1443 0 +1444 0 +1445 0 +1446 0 +1447 0 +1448 0 +1449 0 +1450 0 +1451 0 +1452 0 +1453 0 +1454 0 +1455 0 +1456 0 +1457 0 +1458 0 +1459 0 +1460 0 +1461 0 +1462 0 +1463 0 +1464 0 +1465 0 +1466 0 +1467 0 +1468 0 +1469 0 +1470 0 +1471 0 +1472 0 +1473 0 +1474 0 +1475 0 +1476 0 +1477 0 +1478 0 +1479 0 +1480 0 +1481 0 +1482 0 +1483 0 +1484 0 +1485 0 +1486 0 +1487 0 +1488 0 +1489 0 +1490 0 +1491 0 +1492 0 +1493 0 +1494 0 +1495 0 +1496 0 +1497 0 +1498 0 +1499 0 +1500 0 +1501 0 +1502 0 +1503 0 +1504 0 +1505 0 +1506 0 +1507 0 +1508 0 +1509 0 +1510 0 +1511 0 +1512 0 +1513 0 +1514 0 +1515 0 +1516 0 +1517 0 +1518 0 +1519 0 +1520 0 +1521 0 +1522 0 +1523 0 +1524 0 +1525 0 +1526 0 +1527 0 +1528 0 +1529 0 +1530 0 +1531 0 +1532 0 +1533 0 +1534 0 +1535 0 +1536 0 +1537 0 +1538 0 +1539 0 +1540 0 +1541 0 +1542 0 +1543 0 +1544 0 +1545 0 +1546 0 +1547 0 +1548 0 +1549 0 +1550 0 +1551 0 +1552 0 +1553 0 +1554 0 +1555 0 +1556 0 +1557 0 +1558 0 +1559 0 +1560 0 +1561 0 +1562 0 +1563 0 +1564 0 +1565 0 +1570 0 +1571 0 +1572 0 +1573 0 +1574 0 +1600 0 +1601 0 +1602 0 +1603 0 +1604 0 +1605 0 +1606 0 +1607 0 +1610 0 +1611 0 +1612 0 +1613 0 +1614 0 +1615 0 +1616 0 +1617 0 +1701 0 +1702 0 +1703 0 +1704 0 +1705 0 +1706 0 +1707 0 +1708 0 +1709 0 +1710 0 +1711 0 diff --git a/evidence/allen-omega-L694/final-replay.log b/evidence/allen-omega-L694/final-replay.log new file mode 100644 index 00000000..29b40aa8 --- /dev/null +++ b/evidence/allen-omega-L694/final-replay.log @@ -0,0 +1,22 @@ +/home/drakestapleton/.local/bin/quiet-build: 47: cannot create /home/drakestapleton/.local/state/quiet/waits.log: Read-only file system +/home/drakestapleton/.local/bin/quiet-build: 47: printf: printf: I/O error +runtime compile=0 native-exit=0 +code compile=0 native-exit=0 +courier compile=0 native-exit=0 +memory compile=0 native-exit=0 +intent compile=0 native-exit=0 +reply compile=0 native-exit=0 +view compile=0 native-exit=0 +scene compile=0 native-exit=0 +paint compile=0 native-exit=0 +edges compile=0 native-exit=0 +fixture compile=0 native-exit=0 +golden compile=0 native-exit=0 +render compile=0 native-exit=0 +stdio native-exit=0 golden-cmp=0 +stale mutant compile=0 rejected-exit=3 +crc mutant compile=0 rejected-exit=2 +hash mutant compile=0 rejected-exit=2 +readback mutant compile=0 rejected-exit=7 +session mutant compile=0 rejected-exit=1 +ALLEN_OMEGA_HOST: PASS; target=NOT_RUN; live=NOT_RUN diff --git a/evidence/allen-omega-L694/final/binaries.sha256 b/evidence/allen-omega-L694/final/binaries.sha256 new file mode 100644 index 00000000..00cf6c70 --- /dev/null +++ b/evidence/allen-omega-L694/final/binaries.sha256 @@ -0,0 +1,19 @@ +da36a1ca8ceb536ad5e831560c10ef2f4e995e256f9525fb256470109d840810 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/readback-mutant +798543784942f29bc405e5a560a73ec50025553d5190f0d00fc59aa8e5376c69 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/view +c22923a20f4bd9f30a3bc8e51544b10533a7c0a20bc65856a107a163362312e8 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/allen +ac0bc89319605462156184f3f39e62e7cc12e2748d8feb3d39c80e91d383dbef /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/reply +f75db42bc8ee80899ccfda45022a6be3d80c439922edd6c36eee2c36de30ffec /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/hash-mutant +0039a6d288e11ec70b12b1af15909bb308c6b72f08cb39c51fe06aad245e2690 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/golden +d3ed86f446ac73fc813f8cb905e0fa30e8fc26d9984c3e47ced86424690fc3d9 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/session-mutant +bb17eefbb058191b0669ab15529051c5de99e0f25448e05501d8fc7f9532b3af /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/intent +9bbf95a44321be8d57043d5daa68f4945d2eac63be7e5befa260db79a6defea8 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/fixture +52f05863a960da4e021bae3eecb161792663ce3dfcc701a685a9f93b65570ff7 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/runtime +b6d231c1a1b1cb2fcdea6fcbbc3419aa5aec92ff9fc9984d261dcbc26943b737 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/code +d30797bb341012516081fb6620ec21c6e3f428194ab9968b2181f8074786eba6 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/edges +87676023c7d49e5ea9346f84c71aed4511046bd29f76ed91eea3fd727660ad8d /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/render +7391168db6c88324a04881498ad7b671fd306226921e050d9777e090d0e6cc6e /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/stale-mutant +3031d8376ce13d13b8ff55005600e36caf14ac4a59362611f2f5aefd639fe238 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/courier +44601a3b526c1e799b908342454f1fd3992ac70b83a396a04f2daef8e06ef21c /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/scene +fd080b24d5b5833f70237e966c4bc8688dc4aadba8486b739dc7694fcaf99f6d /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/paint +0e1de4f532b286d8a0fe320bb9b9d61a0724b545e65d27e1fc43e497fac2ec7f /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/crc-mutant +1a210071b068ef5e527dc66651ab635c53971add8b9cfab09c2fdff2290ff6dd /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/memory diff --git a/evidence/allen-omega-L694/final/code.log b/evidence/allen-omega-L694/final/code.log new file mode 100644 index 00000000..e7e197b7 --- /dev/null +++ b/evidence/allen-omega-L694/final/code.log @@ -0,0 +1,23 @@ +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 diff --git a/evidence/allen-omega-L694/final/courier.log b/evidence/allen-omega-L694/final/courier.log new file mode 100644 index 00000000..8402df49 --- /dev/null +++ b/evidence/allen-omega-L694/final/courier.log @@ -0,0 +1,24 @@ +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 diff --git a/evidence/allen-omega-L694/final/crc-mutant.log b/evidence/allen-omega-L694/final/crc-mutant.log new file mode 100644 index 00000000..a0d90bd4 --- /dev/null +++ b/evidence/allen-omega-L694/final/crc-mutant.log @@ -0,0 +1,23 @@ +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 1 +117 1 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 diff --git a/evidence/allen-omega-L694/final/edges.log b/evidence/allen-omega-L694/final/edges.log new file mode 100644 index 00000000..e8d0deea --- /dev/null +++ b/evidence/allen-omega-L694/final/edges.log @@ -0,0 +1,352 @@ +1201 0 +1202 0 +1203 0 +1204 0 +1205 0 +1206 0 +1207 0 +1208 0 +1209 0 +1210 0 +1211 0 +1212 0 +1213 0 +1214 0 +1220 0 +1221 0 +1222 0 +1223 0 +1224 0 +1225 0 +1226 0 +1227 0 +1228 0 +1229 0 +1230 0 +1231 0 +1232 0 +1233 0 +1234 0 +1235 0 +1236 0 +1237 0 +1238 0 +1239 0 +1240 0 +1241 0 +1242 0 +1243 0 +1244 0 +1245 0 +1246 0 +1247 0 +1248 0 +1249 0 +1250 0 +1251 0 +1252 0 +1253 0 +1254 0 +1255 0 +1256 0 +1257 0 +1258 0 +1259 0 +1260 0 +1261 0 +1262 0 +1301 0 +1302 0 +1303 0 +1304 0 +1305 0 +1306 0 +1310 0 +1311 0 +1312 0 +1313 0 +1314 0 +1315 0 +1316 0 +1317 0 +1318 0 +1319 0 +1320 0 +1321 0 +1322 0 +1323 0 +1324 0 +1325 0 +1326 0 +1327 0 +1328 0 +1329 0 +1330 0 +1331 0 +1332 0 +1333 0 +1334 0 +1335 0 +1336 0 +1337 0 +1338 0 +1339 0 +1340 0 +1341 0 +1342 0 +1343 0 +1344 0 +1345 0 +1346 0 +1347 0 +1348 0 +1349 0 +1350 0 +1351 0 +1352 0 +1353 0 +1354 0 +1355 0 +1356 0 +1357 0 +1358 0 +1359 0 +1360 0 +1361 0 +1362 0 +1363 0 +1364 0 +1365 0 +1366 0 +1367 0 +1368 0 +1369 0 +1370 0 +1371 0 +1372 0 +1373 0 +1374 0 +1375 0 +1376 0 +1377 0 +1378 0 +1379 0 +1380 0 +1381 0 +1382 0 +1383 0 +1384 0 +1385 0 +1386 0 +1387 0 +1388 0 +1389 0 +1390 0 +1391 0 +1392 0 +1393 0 +1394 0 +1395 0 +1396 0 +1397 0 +1398 0 +1399 0 +1400 0 +1401 0 +1402 0 +1403 0 +1404 0 +1405 0 +1406 0 +1407 0 +1408 0 +1409 0 +1410 0 +1411 0 +1412 0 +1413 0 +1414 0 +1415 0 +1416 0 +1417 0 +1418 0 +1419 0 +1420 0 +1421 0 +1422 0 +1423 0 +1424 0 +1425 0 +1426 0 +1427 0 +1428 0 +1429 0 +1430 0 +1431 0 +1432 0 +1433 0 +1434 0 +1435 0 +1436 0 +1437 0 +1438 0 +1439 0 +1440 0 +1441 0 +1442 0 +1443 0 +1444 0 +1445 0 +1446 0 +1447 0 +1448 0 +1449 0 +1450 0 +1451 0 +1452 0 +1453 0 +1454 0 +1455 0 +1456 0 +1457 0 +1458 0 +1459 0 +1460 0 +1461 0 +1462 0 +1463 0 +1464 0 +1465 0 +1466 0 +1467 0 +1468 0 +1469 0 +1470 0 +1471 0 +1472 0 +1473 0 +1474 0 +1475 0 +1476 0 +1477 0 +1478 0 +1479 0 +1480 0 +1481 0 +1482 0 +1483 0 +1484 0 +1485 0 +1486 0 +1487 0 +1488 0 +1489 0 +1490 0 +1491 0 +1492 0 +1493 0 +1494 0 +1495 0 +1496 0 +1497 0 +1498 0 +1499 0 +1500 0 +1501 0 +1502 0 +1503 0 +1504 0 +1505 0 +1506 0 +1507 0 +1508 0 +1509 0 +1510 0 +1511 0 +1512 0 +1513 0 +1514 0 +1515 0 +1516 0 +1517 0 +1518 0 +1519 0 +1520 0 +1521 0 +1522 0 +1523 0 +1524 0 +1525 0 +1526 0 +1527 0 +1528 0 +1529 0 +1530 0 +1531 0 +1532 0 +1533 0 +1534 0 +1535 0 +1536 0 +1537 0 +1538 0 +1539 0 +1540 0 +1541 0 +1542 0 +1543 0 +1544 0 +1545 0 +1546 0 +1547 0 +1548 0 +1549 0 +1550 0 +1551 0 +1552 0 +1553 0 +1554 0 +1555 0 +1556 0 +1557 0 +1558 0 +1559 0 +1560 0 +1561 0 +1562 0 +1563 0 +1564 0 +1565 0 +1570 0 +1571 0 +1572 0 +1575 0 +1573 0 +1574 0 +1600 0 +1601 0 +1602 0 +1603 0 +1604 0 +1605 0 +1606 0 +1607 0 +1610 0 +1611 0 +1612 0 +1613 0 +1614 0 +1615 0 +1616 0 +1617 0 +1701 0 +1702 0 +1703 0 +1704 0 +1705 0 +1706 0 +1707 0 +1708 0 +1709 0 +1710 0 +1711 0 diff --git a/evidence/allen-omega-L694/final/hash-mutant.log b/evidence/allen-omega-L694/final/hash-mutant.log new file mode 100644 index 00000000..c75cfefb --- /dev/null +++ b/evidence/allen-omega-L694/final/hash-mutant.log @@ -0,0 +1,79 @@ +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 1 +310 1 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +362 0 +363 0 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 0 +361 0 diff --git a/evidence/allen-omega-L694/final/intent.log b/evidence/allen-omega-L694/final/intent.log new file mode 100644 index 00000000..5371bd36 --- /dev/null +++ b/evidence/allen-omega-L694/final/intent.log @@ -0,0 +1,8 @@ +501 0 +502 0 +503 0 +504 0 +505 0 +506 0 +507 0 +508 0 diff --git a/evidence/allen-omega-L694/final/long.log b/evidence/allen-omega-L694/final/long.log new file mode 100644 index 00000000..0a060bc8 --- /dev/null +++ b/evidence/allen-omega-L694/final/long.log @@ -0,0 +1,292 @@ +401 0 +410 0 +411 0 +412 0 +413 0 +414 0 +415 0 +416 0 +417 0 +418 0 +419 0 +420 0 +421 0 +422 0 +423 0 +424 0 +425 0 +426 0 +427 0 +428 0 +429 0 +430 0 +431 0 +432 0 +433 0 +434 0 +435 0 +436 0 +437 0 +438 0 +439 0 +440 0 +441 0 +442 0 +443 0 +444 0 +445 0 +446 0 +447 0 +448 0 +449 0 +450 0 +451 0 +452 0 +453 0 +454 0 +455 0 +456 0 +457 0 +458 0 +459 0 +460 0 +461 0 +462 0 +463 0 +464 0 +465 0 +466 0 +467 0 +468 0 +469 0 +470 0 +471 0 +472 0 +473 0 +474 0 +475 0 +476 0 +477 0 +478 0 +479 0 +480 0 +481 0 +482 0 +483 0 +484 0 +485 0 +486 0 +487 0 +488 0 +489 0 +490 0 +491 0 +492 0 +493 0 +494 0 +495 0 +496 0 +497 0 +498 0 +499 0 +500 0 +501 0 +502 0 +503 0 +504 0 +505 0 +506 0 +507 0 +508 0 +509 0 +510 0 +511 0 +512 0 +513 0 +514 0 +515 0 +516 0 +517 0 +518 0 +519 0 +520 0 +521 0 +522 0 +523 0 +524 0 +525 0 +526 0 +527 0 +528 0 +529 0 +530 0 +531 0 +532 0 +533 0 +534 0 +535 0 +536 0 +537 0 +538 0 +539 0 +540 0 +541 0 +542 0 +543 0 +544 0 +545 0 +546 0 +547 0 +548 0 +549 0 +550 0 +402 0 +403 0 +404 0 +405 0 +406 0 +700 0 +701 0 +702 0 +703 0 +704 0 +705 0 +706 0 +707 0 +708 0 +709 0 +710 0 +711 0 +712 0 +713 0 +714 0 +715 0 +716 0 +717 0 +718 0 +719 0 +720 0 +721 0 +722 0 +723 0 +724 0 +725 0 +726 0 +727 0 +728 0 +729 0 +730 0 +731 0 +732 0 +733 0 +734 0 +735 0 +736 0 +737 0 +738 0 +739 0 +740 0 +741 0 +742 0 +743 0 +744 0 +745 0 +746 0 +747 0 +748 0 +749 0 +750 0 +751 0 +752 0 +753 0 +754 0 +755 0 +756 0 +757 0 +758 0 +759 0 +760 0 +761 0 +762 0 +763 0 +764 0 +765 0 +766 0 +767 0 +768 0 +769 0 +770 0 +771 0 +772 0 +773 0 +774 0 +775 0 +776 0 +777 0 +778 0 +779 0 +780 0 +781 0 +782 0 +783 0 +784 0 +785 0 +786 0 +787 0 +788 0 +789 0 +790 0 +791 0 +792 0 +793 0 +794 0 +795 0 +796 0 +797 0 +798 0 +799 0 +800 0 +801 0 +802 0 +803 0 +804 0 +805 0 +806 0 +807 0 +808 0 +809 0 +810 0 +811 0 +812 0 +813 0 +814 0 +815 0 +816 0 +817 0 +818 0 +819 0 +820 0 +821 0 +822 0 +823 0 +824 0 +825 0 +826 0 +827 0 +828 0 +829 0 +830 0 +831 0 +832 0 +833 0 +834 0 +835 0 +836 0 +837 0 +838 0 +839 0 +840 0 +841 0 +407 0 +408 0 +409 0 diff --git a/evidence/allen-omega-L694/final/memory.log b/evidence/allen-omega-L694/final/memory.log new file mode 100644 index 00000000..5928102e --- /dev/null +++ b/evidence/allen-omega-L694/final/memory.log @@ -0,0 +1,79 @@ +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 0 +310 0 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +362 0 +363 0 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 0 +361 0 diff --git a/evidence/allen-omega-L694/final/paint.log b/evidence/allen-omega-L694/final/paint.log new file mode 100644 index 00000000..281a5bd2 --- /dev/null +++ b/evidence/allen-omega-L694/final/paint.log @@ -0,0 +1,11 @@ +1101 0 +1102 0 +1103 0 +1104 0 +1105 0 +1106 0 +1107 0 +1108 0 +1109 0 +1110 0 +1111 0 diff --git a/evidence/allen-omega-L694/final/readback-mutant.log b/evidence/allen-omega-L694/final/readback-mutant.log new file mode 100644 index 00000000..268002ad --- /dev/null +++ b/evidence/allen-omega-L694/final/readback-mutant.log @@ -0,0 +1,79 @@ +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 0 +310 0 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 1 +339 1 +340 0 +341 0 +342 0 +343 0 +344 1 +345 0 +346 0 +347 0 +348 0 +349 1 +350 1 +351 0 +352 0 +362 0 +363 0 +353 1 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 1 +361 0 diff --git a/evidence/allen-omega-L694/final/reply.log b/evidence/allen-omega-L694/final/reply.log new file mode 100644 index 00000000..d11a72ad --- /dev/null +++ b/evidence/allen-omega-L694/final/reply.log @@ -0,0 +1,15 @@ +801 0 +802 0 +803 0 +804 0 +805 0 +806 0 +807 0 +808 0 +809 0 +810 0 +811 0 +812 0 +813 0 +814 0 +815 0 diff --git a/evidence/allen-omega-L694/final/runtime.log b/evidence/allen-omega-L694/final/runtime.log new file mode 100644 index 00000000..5168e6f3 --- /dev/null +++ b/evidence/allen-omega-L694/final/runtime.log @@ -0,0 +1,28 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 diff --git a/evidence/allen-omega-L694/final/scene.log b/evidence/allen-omega-L694/final/scene.log new file mode 100644 index 00000000..44a4b2b1 --- /dev/null +++ b/evidence/allen-omega-L694/final/scene.log @@ -0,0 +1,14 @@ +1001 0 +1002 0 +1003 0 +1004 0 +1005 0 +1006 0 +1007 0 +1008 0 +1009 0 +1010 0 +1011 0 +1012 0 +1013 0 +1014 0 diff --git a/evidence/allen-omega-L694/final/session-mutant.log b/evidence/allen-omega-L694/final/session-mutant.log new file mode 100644 index 00000000..9ce7ef78 --- /dev/null +++ b/evidence/allen-omega-L694/final/session-mutant.log @@ -0,0 +1,24 @@ +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 1 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 diff --git a/evidence/allen-omega-L694/final/short.log b/evidence/allen-omega-L694/final/short.log new file mode 100644 index 00000000..a9da2dc8 --- /dev/null +++ b/evidence/allen-omega-L694/final/short.log @@ -0,0 +1,20 @@ +401 0 +410 0 +411 0 +412 0 +413 0 +414 0 +402 0 +403 0 +404 0 +405 0 +406 0 +700 0 +701 0 +702 0 +703 0 +704 0 +705 0 +407 0 +408 0 +409 0 diff --git a/evidence/allen-omega-L694/final/source.sha256 b/evidence/allen-omega-L694/final/source.sha256 new file mode 100644 index 00000000..ddeceb60 --- /dev/null +++ b/evidence/allen-omega-L694/final/source.sha256 @@ -0,0 +1,34 @@ +46ba5562bcbbd808e6557f1f49e296e022c292ea0b718b1516312f10a9828cca native/omega/allen/README.md +184f4270c72c4eca6a7afdd28b70a608f2e237980b12c8a7bfc2c7d2c3e625b9 native/omega/allen/base.om +795ca28627a19f1088de0f23277e79cdac921ff88451c606c7b655ce0f2e8a5b native/omega/allen/build-one.sh +4d2235ac5d6b237695b1c3112f70ebdfa0cebafa2ec8e691e4be4de37a62199b native/omega/allen/code.om +76ee9cdeaac036905c76dfa29f42bf5a78d1259ad1656adfaa24916c3b93550d native/omega/allen/courier.om +357481ea27a68a4d452c97017dad70fe11566612951d71e947549c1de8441846 native/omega/allen/gate.sh +9d71a653870eeef678f95df04db9c38aedaadd06e7c74bf3e5d9fde6e28f82f8 native/omega/allen/golden.sh +06087bc573ebb876a0ed80f6025c592fb4b1d23335169c3da402824fd1482c35 native/omega/allen/intent.om +2346077ef78cf54124f777016cf44e1034546f400bb6642e73713c8987875f0f native/omega/allen/main.om +068292abd04d3a61b063fc5380b22a56c4235a87915c219ebf3b37d16d7bc9c7 native/omega/allen/memory.om +b4d7b6e6cd680d2ba1eec2978b0cbb81ffc63035b73f5c3726bdad97a7b6aa04 native/omega/allen/paint.om +e50a7f673aaee92aba4a3aec303aa93b071121c09ad05d4ad1dcc2deb9706dcc native/omega/allen/reply.om +5b01eae03204d08f6d207ef29f2ba09a1d9f249f1738f68f151214675a4ff2ed native/omega/allen/runtime.om +c8d4a437b41538cc1eeb62a2029c6993d41e5ef90cc7b26c8e1c92bc98ec57d3 native/omega/allen/scene.om +f085198549d1c235a97574ff6f6560ce82217611f4051fc3dbbc8286aab6d536 native/omega/allen/tests/check.om +b76438a85257bd95768115047be286c107e3723628a16a0541870732d0849a42 native/omega/allen/tests/code.om +98105e1c30626f54da07940fe0415637730b7e112ea39ba2aae1f2d648993373 native/omega/allen/tests/courier.om +f524aab74657dc2e9e4330bf42bc05ef01ce3e8f08a05c80371be0c0a33764d3 native/omega/allen/tests/edges.om +a2e8bcde92d522216a4fa99559dd3bcba096aea86127364587dadcc2bfb585af native/omega/allen/tests/fixture.om +c9ef2bee7cbd1c072c6045d62c55f3bdd938901e91792cee72ea57fb8f25a198 native/omega/allen/tests/golden.om +8ba742d85ea510586f3cf86661bc0f28c5d99b59981c2d3fb220705efad24564 native/omega/allen/tests/intent.om +861d9af698b021056cceb6c00ae3458558db415963fe832d3fca7da55731cf7b native/omega/allen/tests/memory.om +13e4db7436165783c6aad48497ffe89fa6e5ba3de928e66a766c29e1e817fcf5 native/omega/allen/tests/paint.om +e6d232d92d74d88423cebbbbfc6e403ea9b865b80c909e1d23087001d905035a native/omega/allen/tests/probe.om +8fbc8a0517900efd771a994686356416a0fea5e20cfd9bc26c787850398113df native/omega/allen/tests/render.om +094a5e833bae7dfd3b013e3f015f143e9d7bd3efe9b9c896a7f58b09e1ec14b8 native/omega/allen/tests/reply.om +bab9b0e853aa4b62918353a5d1625a3171deebfb639e599fe9751b5a61a3df62 native/omega/allen/tests/runtime.om +b9c84d9a58658589137764fe60209d8320550dd8ed99fa6026df65ba48737e4f native/omega/allen/tests/scene.om +89aee5326b428147ea6da9aa739b6679e214ed114ae5f41d3b70299cf864092c native/omega/allen/tests/view.om +0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0 native/omega/allen/vendor/OMEGA-LICENSE +b234738e8ce81b3d67586deb41fdaab4543169d4b69e86fd3dc28a08432ab5fc native/omega/allen/vendor/PROVENANCE.md +992ec4a4957271b442740598136887a5c610effcd8ae9fb9480a006a4f181097 native/omega/allen/vendor/sha256-core.om +0781cdcec18570a57afbe3be4a6717dd2d1fa4c887b49a3e4cb542b594f8a041 native/omega/allen/vendor/sha256.om +abbefd2f7dc48f2ac28b9526f5c2e5b369da4b7c5e84dde6e6a3cd20bd5687ac native/omega/allen/view.om diff --git a/evidence/allen-omega-L694/final/stale-mutant.log b/evidence/allen-omega-L694/final/stale-mutant.log new file mode 100644 index 00000000..ac2e3d09 --- /dev/null +++ b/evidence/allen-omega-L694/final/stale-mutant.log @@ -0,0 +1,28 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 1 +7 1 +8 1 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 diff --git a/evidence/allen-omega-L694/final/view.log b/evidence/allen-omega-L694/final/view.log new file mode 100644 index 00000000..8b194f11 --- /dev/null +++ b/evidence/allen-omega-L694/final/view.log @@ -0,0 +1,13 @@ +901 0 +902 0 +903 0 +904 0 +905 0 +906 0 +907 0 +908 0 +909 0 +910 0 +911 0 +912 0 +913 0 diff --git a/evidence/allen-omega-L694/intent-edge-red.log b/evidence/allen-omega-L694/intent-edge-red.log new file mode 100644 index 00000000..3f449307 --- /dev/null +++ b/evidence/allen-omega-L694/intent-edge-red.log @@ -0,0 +1,8 @@ +501 0 +502 0 +503 0 +504 0 +505 0 +506 0 +507 0 +508 1 diff --git a/evidence/allen-omega-L694/intent-edge-red.om b/evidence/allen-omega-L694/intent-edge-red.om new file mode 100644 index 00000000..648a62ec --- /dev/null +++ b/evidence/allen-omega-L694/intent-edge-red.om @@ -0,0 +1,2395 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Tx ulong 3 +fn txbegin to bool +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if not memvalid +ret false +end +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +if gt listed 4 false 0 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +text Askcode "Please make me a calculator" +text Askpoem "Write a poem about python" +text Askmore "Now add a square root key" +text Expected "JOB 9 code the person asked Allen for code.\tPlease make me a calculator" +text Nscript "script a poem" +fn main to int +put Inlen 0 len Askcode +for i ulong len Askcode +put In i get Askcode i +end +check eq classify 2 501 +b = jobbuild 2 9 +same = eq get Outlen 0 len Expected +for i ulong len Expected +if ne get Outb i get Expected i +same = false +end +end +check b 502 +check same 503 +put Inlen 0 len Askpoem +for i ulong len Askpoem +put In i get Askpoem i +end +check eq classify 1 504 +check eq jobwant 1 505 +put Inlen 0 len Askmore +for i ulong len Askmore +put In i get Askmore i +end +check eq classify 1 506 +put R 6 1 +check eq classify 3 507 +put R 6 0 +put Inlen 0 len Nscript +for i ulong len Nscript +put In i get Nscript i +end +check eq classify 1 508 +ret int get Fails 0 +end diff --git a/evidence/allen-omega-L694/intent3.txt b/evidence/allen-omega-L694/intent3.txt new file mode 100644 index 00000000..5a0fec5d --- /dev/null +++ b/evidence/allen-omega-L694/intent3.txt @@ -0,0 +1,7 @@ +501 0 +502 0 +503 0 +504 0 +505 0 +506 0 +507 0 diff --git a/evidence/allen-omega-L694/load-edge-red.log b/evidence/allen-omega-L694/load-edge-red.log new file mode 100644 index 00000000..a05eed4e --- /dev/null +++ b/evidence/allen-omega-L694/load-edge-red.log @@ -0,0 +1,63 @@ +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 0 +310 0 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +362 1 +363 1 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +361 0 diff --git a/evidence/allen-omega-L694/load-edge-red.om b/evidence/allen-omega-L694/load-edge-red.om new file mode 100644 index 00000000..30ef7ddc --- /dev/null +++ b/evidence/allen-omega-L694/load-edge-red.om @@ -0,0 +1,2481 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Tx ulong 3 +fn txbegin to bool +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if not memvalid +ret false +end +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +if gt listed 4 false 0 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +global Disk uchar 8192 +text Name "Allen" +text Ntext "Meet at noon." +fn enctounit to void +for i ulong 4096 +put Unit i get Enc i +end +end +fn diskput slot ulong count ulong to void +for i ulong count +put Disk add mul slot 4096 i get Enc i +end +end +fn diskget slot ulong to void +for i ulong 4096 +put Unit i get Disk add mul slot 4096 i +end +end +fn main to int +constants +mset32 0 3 +for i ulong len Name +put Mem add i 40 get Name i +end +check memenc 1 301 +check eq get32 12 76 302 +check memdec 303 +check eq get Md 0 1 304 +check eq get Mem 40 65 305 +put Unit 24 uchar 1 +check not memdec 306 +check eq get Md 0 1 307 +check eq get Mem 40 65 308 +enctounit +put Unit 64 uchar 4 +check not memdec 309 +check eq get Mem 0 3 310 +enctounit +put32 8 3 +put32 12 64 +seal 64 +check memdec 311 +check eq get Md 1 3 312 +check eq get Mem 40 65 313 +put32 8 2 +put32 12 40 +for i ulong 24 +put Unit add i 104 0 +end +seal 40 +check memdec 314 +check eq get Md 1 2 315 +check eq get Mem 40 0 316 +put Mem 40 uchar 65 +check memenc 1 317 +check txbegin 318 +check eq get Tx 1 0 319 +diskput 0 4096 +check txwrite true 320 +check txflush true 321 +diskget 0 +check txread true 322 +check eq get St 0 1 323 +check eq get St 1 0 324 +mset32 0 4 +check txbegin 325 +check eq get Tx 1 1 326 +diskput 1 512 +check not txwrite false 327 +check eq get St 0 1 328 +diskget 0 +check memdec 329 +check eq get Mem 0 3 330 +mset32 0 4 +check txbegin 331 +diskput 1 4096 +check txwrite true 332 +check not txflush false 333 +check eq get St 0 1 334 +check txbegin 335 +check txwrite true 336 +check txflush true 337 +diskget 1 +put Unit 200 uchar 1 +check not txread true 338 +check eq get St 0 1 339 +check txbegin 340 +check txwrite true 341 +check txflush true 342 +check not txread false 343 +check eq get St 0 1 344 +check txbegin 345 +diskput 1 4096 +check txwrite true 346 +check txflush true 347 +diskget 1 +check txread true 348 +check eq get St 0 2 349 +check eq get St 1 1 350 +for i ulong 3 +put St i 0 +end +diskget 1 +check loadcopy 1 351 +diskget 0 +check loadcopy 0 352 +check not loadcopy 0 362 +check eq get St 2 2 363 +check eq get St 0 2 353 +check eq get Mem 0 4 354 +put Ns 0 len Ntext +put Ns 1 2 +put Ns 2 3 +for i ulong len Ntext +put Note i get Ntext i +end +check noteenc 355 +check notedec 2 356 +check eq get Ns 0 len Ntext 357 +check not notedec 3 358 +put Unit 28 uchar 1 +check not notedec 2 359 +check eq get Ns 1 2 360 +put St 0 18446744073709551615 +check not txbegin 361 +ret int get Fails 0 +end diff --git a/evidence/allen-omega-L694/long-native.txt b/evidence/allen-omega-L694/long-native.txt new file mode 100644 index 00000000..0a060bc8 --- /dev/null +++ b/evidence/allen-omega-L694/long-native.txt @@ -0,0 +1,292 @@ +401 0 +410 0 +411 0 +412 0 +413 0 +414 0 +415 0 +416 0 +417 0 +418 0 +419 0 +420 0 +421 0 +422 0 +423 0 +424 0 +425 0 +426 0 +427 0 +428 0 +429 0 +430 0 +431 0 +432 0 +433 0 +434 0 +435 0 +436 0 +437 0 +438 0 +439 0 +440 0 +441 0 +442 0 +443 0 +444 0 +445 0 +446 0 +447 0 +448 0 +449 0 +450 0 +451 0 +452 0 +453 0 +454 0 +455 0 +456 0 +457 0 +458 0 +459 0 +460 0 +461 0 +462 0 +463 0 +464 0 +465 0 +466 0 +467 0 +468 0 +469 0 +470 0 +471 0 +472 0 +473 0 +474 0 +475 0 +476 0 +477 0 +478 0 +479 0 +480 0 +481 0 +482 0 +483 0 +484 0 +485 0 +486 0 +487 0 +488 0 +489 0 +490 0 +491 0 +492 0 +493 0 +494 0 +495 0 +496 0 +497 0 +498 0 +499 0 +500 0 +501 0 +502 0 +503 0 +504 0 +505 0 +506 0 +507 0 +508 0 +509 0 +510 0 +511 0 +512 0 +513 0 +514 0 +515 0 +516 0 +517 0 +518 0 +519 0 +520 0 +521 0 +522 0 +523 0 +524 0 +525 0 +526 0 +527 0 +528 0 +529 0 +530 0 +531 0 +532 0 +533 0 +534 0 +535 0 +536 0 +537 0 +538 0 +539 0 +540 0 +541 0 +542 0 +543 0 +544 0 +545 0 +546 0 +547 0 +548 0 +549 0 +550 0 +402 0 +403 0 +404 0 +405 0 +406 0 +700 0 +701 0 +702 0 +703 0 +704 0 +705 0 +706 0 +707 0 +708 0 +709 0 +710 0 +711 0 +712 0 +713 0 +714 0 +715 0 +716 0 +717 0 +718 0 +719 0 +720 0 +721 0 +722 0 +723 0 +724 0 +725 0 +726 0 +727 0 +728 0 +729 0 +730 0 +731 0 +732 0 +733 0 +734 0 +735 0 +736 0 +737 0 +738 0 +739 0 +740 0 +741 0 +742 0 +743 0 +744 0 +745 0 +746 0 +747 0 +748 0 +749 0 +750 0 +751 0 +752 0 +753 0 +754 0 +755 0 +756 0 +757 0 +758 0 +759 0 +760 0 +761 0 +762 0 +763 0 +764 0 +765 0 +766 0 +767 0 +768 0 +769 0 +770 0 +771 0 +772 0 +773 0 +774 0 +775 0 +776 0 +777 0 +778 0 +779 0 +780 0 +781 0 +782 0 +783 0 +784 0 +785 0 +786 0 +787 0 +788 0 +789 0 +790 0 +791 0 +792 0 +793 0 +794 0 +795 0 +796 0 +797 0 +798 0 +799 0 +800 0 +801 0 +802 0 +803 0 +804 0 +805 0 +806 0 +807 0 +808 0 +809 0 +810 0 +811 0 +812 0 +813 0 +814 0 +815 0 +816 0 +817 0 +818 0 +819 0 +820 0 +821 0 +822 0 +823 0 +824 0 +825 0 +826 0 +827 0 +828 0 +829 0 +830 0 +831 0 +832 0 +833 0 +834 0 +835 0 +836 0 +837 0 +838 0 +839 0 +840 0 +841 0 +407 0 +408 0 +409 0 diff --git a/evidence/allen-omega-L694/long.wire b/evidence/allen-omega-L694/long.wire new file mode 100644 index 00000000..40d38468 --- /dev/null +++ b/evidence/allen-omega-L694/long.wire @@ -0,0 +1,143 @@ +CODE 1 1/142 18056 17ab737c c /* steps.c: many small steps, each one printed. */\n#include \n\nstatic int step_1(int x)\n{\n /* step 1: multiply, add, +CODE 1 2/142 18056 17ab737c c and keep it small \\ no tabs */\n return (x * 1 + 7) % 1000003;\n}\nstatic int step_2(int x)\n{\n /* step 2: multiply, add, and +CODE 1 3/142 18056 17ab737c c keep it small \\ no tabs */\n return (x * 2 + 14) % 1000003;\n}\nstatic int step_3(int x)\n{\n /* step 3: multiply, add, and kee +CODE 1 4/142 18056 17ab737c c p it small \\ no tabs */\n return (x * 3 + 21) % 1000003;\n}\nstatic int step_4(int x)\n{\n /* step 4: multiply, add, and keep i +CODE 1 5/142 18056 17ab737c c t small \\ no tabs */\n return (x * 4 + 28) % 1000003;\n}\nstatic int step_5(int x)\n{\n /* step 5: multiply, add, and keep it s +CODE 1 6/142 18056 17ab737c c mall \\ no tabs */\n return (x * 5 + 35) % 1000003;\n}\nstatic int step_6(int x)\n{\n /* step 6: multiply, add, and keep it smal +CODE 1 7/142 18056 17ab737c c l \\ no tabs */\n return (x * 6 + 42) % 1000003;\n}\nstatic int step_7(int x)\n{\n /* step 7: multiply, add, and keep it small \\ +CODE 1 8/142 18056 17ab737c c no tabs */\n return (x * 7 + 49) % 1000003;\n}\nstatic int step_8(int x)\n{\n /* step 8: multiply, add, and keep it small \\ no +CODE 1 9/142 18056 17ab737c c tabs */\n return (x * 8 + 56) % 1000003;\n}\nstatic int step_9(int x)\n{\n /* step 9: multiply, add, and keep it small \\ no ta +CODE 1 10/142 18056 17ab737c c bs */\n return (x * 9 + 63) % 1000003;\n}\nstatic int step_10(int x)\n{\n /* step 10: multiply, add, and keep it small \\ no tab +CODE 1 11/142 18056 17ab737c c s */\n return (x * 10 + 70) % 1000003;\n}\nstatic int step_11(int x)\n{\n /* step 11: multiply, add, and keep it small \\ no tab +CODE 1 12/142 18056 17ab737c c s */\n return (x * 11 + 77) % 1000003;\n}\nstatic int step_12(int x)\n{\n /* step 12: multiply, add, and keep it small \\ no tab +CODE 1 13/142 18056 17ab737c c s */\n return (x * 12 + 84) % 1000003;\n}\nstatic int step_13(int x)\n{\n /* step 13: multiply, add, and keep it small \\ no tab +CODE 1 14/142 18056 17ab737c c s */\n return (x * 13 + 91) % 1000003;\n}\nstatic int step_14(int x)\n{\n /* step 14: multiply, add, and keep it small \\ no tab +CODE 1 15/142 18056 17ab737c c s */\n return (x * 14 + 98) % 1000003;\n}\nstatic int step_15(int x)\n{\n /* step 15: multiply, add, and keep it small \\ no tab +CODE 1 16/142 18056 17ab737c c s */\n return (x * 15 + 105) % 1000003;\n}\nstatic int step_16(int x)\n{\n /* step 16: multiply, add, and keep it small \\ no ta +CODE 1 17/142 18056 17ab737c c bs */\n return (x * 16 + 112) % 1000003;\n}\nstatic int step_17(int x)\n{\n /* step 17: multiply, add, and keep it small \\ no t +CODE 1 18/142 18056 17ab737c c abs */\n return (x * 17 + 119) % 1000003;\n}\nstatic int step_18(int x)\n{\n /* step 18: multiply, add, and keep it small \\ no +CODE 1 19/142 18056 17ab737c c tabs */\n return (x * 18 + 126) % 1000003;\n}\nstatic int step_19(int x)\n{\n /* step 19: multiply, add, and keep it small \\ no +CODE 1 20/142 18056 17ab737c c tabs */\n return (x * 19 + 133) % 1000003;\n}\nstatic int step_20(int x)\n{\n /* step 20: multiply, add, and keep it small \\ n +CODE 1 21/142 18056 17ab737c c o tabs */\n return (x * 20 + 140) % 1000003;\n}\nstatic int step_21(int x)\n{\n /* step 21: multiply, add, and keep it small \\ +CODE 1 22/142 18056 17ab737c c no tabs */\n return (x * 21 + 147) % 1000003;\n}\nstatic int step_22(int x)\n{\n /* step 22: multiply, add, and keep it small \\ +CODE 1 23/142 18056 17ab737c c no tabs */\n return (x * 22 + 154) % 1000003;\n}\nstatic int step_23(int x)\n{\n /* step 23: multiply, add, and keep it small +CODE 1 24/142 18056 17ab737c c \\ no tabs */\n return (x * 23 + 161) % 1000003;\n}\nstatic int step_24(int x)\n{\n /* step 24: multiply, add, and keep it small +CODE 1 25/142 18056 17ab737c c \\ no tabs */\n return (x * 24 + 168) % 1000003;\n}\nstatic int step_25(int x)\n{\n /* step 25: multiply, add, and keep it smal +CODE 1 26/142 18056 17ab737c c l \\ no tabs */\n return (x * 25 + 175) % 1000003;\n}\nstatic int step_26(int x)\n{\n /* step 26: multiply, add, and keep it sma +CODE 1 27/142 18056 17ab737c c ll \\ no tabs */\n return (x * 26 + 182) % 1000003;\n}\nstatic int step_27(int x)\n{\n /* step 27: multiply, add, and keep it sm +CODE 1 28/142 18056 17ab737c c all \\ no tabs */\n return (x * 27 + 189) % 1000003;\n}\nstatic int step_28(int x)\n{\n /* step 28: multiply, add, and keep it s +CODE 1 29/142 18056 17ab737c c mall \\ no tabs */\n return (x * 28 + 196) % 1000003;\n}\nstatic int step_29(int x)\n{\n /* step 29: multiply, add, and keep it +CODE 1 30/142 18056 17ab737c c small \\ no tabs */\n return (x * 29 + 203) % 1000003;\n}\nstatic int step_30(int x)\n{\n /* step 30: multiply, add, and keep it +CODE 1 31/142 18056 17ab737c c small \\ no tabs */\n return (x * 30 + 210) % 1000003;\n}\nstatic int step_31(int x)\n{\n /* step 31: multiply, add, and keep i +CODE 1 32/142 18056 17ab737c c t small \\ no tabs */\n return (x * 31 + 217) % 1000003;\n}\nstatic int step_32(int x)\n{\n /* step 32: multiply, add, and keep +CODE 1 33/142 18056 17ab737c c it small \\ no tabs */\n return (x * 32 + 224) % 1000003;\n}\nstatic int step_33(int x)\n{\n /* step 33: multiply, add, and keep +CODE 1 34/142 18056 17ab737c c it small \\ no tabs */\n return (x * 33 + 231) % 1000003;\n}\nstatic int step_34(int x)\n{\n /* step 34: multiply, add, and kee +CODE 1 35/142 18056 17ab737c c p it small \\ no tabs */\n return (x * 34 + 238) % 1000003;\n}\nstatic int step_35(int x)\n{\n /* step 35: multiply, add, and ke +CODE 1 36/142 18056 17ab737c c ep it small \\ no tabs */\n return (x * 35 + 245) % 1000003;\n}\nstatic int step_36(int x)\n{\n /* step 36: multiply, add, and k +CODE 1 37/142 18056 17ab737c c eep it small \\ no tabs */\n return (x * 36 + 252) % 1000003;\n}\nstatic int step_37(int x)\n{\n /* step 37: multiply, add, and +CODE 1 38/142 18056 17ab737c c keep it small \\ no tabs */\n return (x * 37 + 259) % 1000003;\n}\nstatic int step_38(int x)\n{\n /* step 38: multiply, add, and +CODE 1 39/142 18056 17ab737c c keep it small \\ no tabs */\n return (x * 38 + 266) % 1000003;\n}\nstatic int step_39(int x)\n{\n /* step 39: multiply, add, an +CODE 1 40/142 18056 17ab737c c d keep it small \\ no tabs */\n return (x * 39 + 273) % 1000003;\n}\nstatic int step_40(int x)\n{\n /* step 40: multiply, add, a +CODE 1 41/142 18056 17ab737c c nd keep it small \\ no tabs */\n return (x * 40 + 280) % 1000003;\n}\nstatic int step_41(int x)\n{\n /* step 41: multiply, add, +CODE 1 42/142 18056 17ab737c c and keep it small \\ no tabs */\n return (x * 41 + 287) % 1000003;\n}\nstatic int step_42(int x)\n{\n /* step 42: multiply, add, +CODE 1 43/142 18056 17ab737c c and keep it small \\ no tabs */\n return (x * 42 + 294) % 1000003;\n}\nstatic int step_43(int x)\n{\n /* step 43: multiply, add +CODE 1 44/142 18056 17ab737c c , and keep it small \\ no tabs */\n return (x * 43 + 301) % 1000003;\n}\nstatic int step_44(int x)\n{\n /* step 44: multiply, ad +CODE 1 45/142 18056 17ab737c c d, and keep it small \\ no tabs */\n return (x * 44 + 308) % 1000003;\n}\nstatic int step_45(int x)\n{\n /* step 45: multiply, a +CODE 1 46/142 18056 17ab737c c dd, and keep it small \\ no tabs */\n return (x * 45 + 315) % 1000003;\n}\nstatic int step_46(int x)\n{\n /* step 46: multiply, +CODE 1 47/142 18056 17ab737c c add, and keep it small \\ no tabs */\n return (x * 46 + 322) % 1000003;\n}\nstatic int step_47(int x)\n{\n /* step 47: multiply, +CODE 1 48/142 18056 17ab737c c add, and keep it small \\ no tabs */\n return (x * 47 + 329) % 1000003;\n}\nstatic int step_48(int x)\n{\n /* step 48: multiply +CODE 1 49/142 18056 17ab737c c , add, and keep it small \\ no tabs */\n return (x * 48 + 336) % 1000003;\n}\nstatic int step_49(int x)\n{\n /* step 49: multipl +CODE 1 50/142 18056 17ab737c c y, add, and keep it small \\ no tabs */\n return (x * 49 + 343) % 1000003;\n}\nstatic int step_50(int x)\n{\n /* step 50: multip +CODE 1 51/142 18056 17ab737c c ly, add, and keep it small \\ no tabs */\n return (x * 50 + 350) % 1000003;\n}\nstatic int step_51(int x)\n{\n /* step 51: multi +CODE 1 52/142 18056 17ab737c c ply, add, and keep it small \\ no tabs */\n return (x * 51 + 357) % 1000003;\n}\nstatic int step_52(int x)\n{\n /* step 52: mult +CODE 1 53/142 18056 17ab737c c iply, add, and keep it small \\ no tabs */\n return (x * 52 + 364) % 1000003;\n}\nstatic int step_53(int x)\n{\n /* step 53: mul +CODE 1 54/142 18056 17ab737c c tiply, add, and keep it small \\ no tabs */\n return (x * 53 + 371) % 1000003;\n}\nstatic int step_54(int x)\n{\n /* step 54: mu +CODE 1 55/142 18056 17ab737c c ltiply, add, and keep it small \\ no tabs */\n return (x * 54 + 378) % 1000003;\n}\nstatic int step_55(int x)\n{\n /* step 55: m +CODE 1 56/142 18056 17ab737c c ultiply, add, and keep it small \\ no tabs */\n return (x * 55 + 385) % 1000003;\n}\nstatic int step_56(int x)\n{\n /* step 56: +CODE 1 57/142 18056 17ab737c c multiply, add, and keep it small \\ no tabs */\n return (x * 56 + 392) % 1000003;\n}\nstatic int step_57(int x)\n{\n /* step 57: +CODE 1 58/142 18056 17ab737c c multiply, add, and keep it small \\ no tabs */\n return (x * 57 + 399) % 1000003;\n}\nstatic int step_58(int x)\n{\n /* step 58 +CODE 1 59/142 18056 17ab737c c : multiply, add, and keep it small \\ no tabs */\n return (x * 58 + 406) % 1000003;\n}\nstatic int step_59(int x)\n{\n /* step 5 +CODE 1 60/142 18056 17ab737c c 9: multiply, add, and keep it small \\ no tabs */\n return (x * 59 + 413) % 1000003;\n}\nstatic int step_60(int x)\n{\n /* step +CODE 1 61/142 18056 17ab737c c 60: multiply, add, and keep it small \\ no tabs */\n return (x * 60 + 420) % 1000003;\n}\nstatic int step_61(int x)\n{\n /* step +CODE 1 62/142 18056 17ab737c c 61: multiply, add, and keep it small \\ no tabs */\n return (x * 61 + 427) % 1000003;\n}\nstatic int step_62(int x)\n{\n /* ste +CODE 1 63/142 18056 17ab737c c p 62: multiply, add, and keep it small \\ no tabs */\n return (x * 62 + 434) % 1000003;\n}\nstatic int step_63(int x)\n{\n /* st +CODE 1 64/142 18056 17ab737c c ep 63: multiply, add, and keep it small \\ no tabs */\n return (x * 63 + 441) % 1000003;\n}\nstatic int step_64(int x)\n{\n /* s +CODE 1 65/142 18056 17ab737c c tep 64: multiply, add, and keep it small \\ no tabs */\n return (x * 64 + 448) % 1000003;\n}\nstatic int step_65(int x)\n{\n /* +CODE 1 66/142 18056 17ab737c c step 65: multiply, add, and keep it small \\ no tabs */\n return (x * 65 + 455) % 1000003;\n}\nstatic int step_66(int x)\n{\n /* +CODE 1 67/142 18056 17ab737c c step 66: multiply, add, and keep it small \\ no tabs */\n return (x * 66 + 462) % 1000003;\n}\nstatic int step_67(int x)\n{\n / +CODE 1 68/142 18056 17ab737c c * step 67: multiply, add, and keep it small \\ no tabs */\n return (x * 67 + 469) % 1000003;\n}\nstatic int step_68(int x)\n{\n +CODE 1 69/142 18056 17ab737c c /* step 68: multiply, add, and keep it small \\ no tabs */\n return (x * 68 + 476) % 1000003;\n}\nstatic int step_69(int x)\n{\n +CODE 1 70/142 18056 17ab737c c /* step 69: multiply, add, and keep it small \\ no tabs */\n return (x * 69 + 483) % 1000003;\n}\nstatic int step_70(int x)\n{\n +CODE 1 71/142 18056 17ab737c c /* step 70: multiply, add, and keep it small \\ no tabs */\n return (x * 70 + 490) % 1000003;\n}\nstatic int step_71(int x)\n{\n +CODE 1 72/142 18056 17ab737c c /* step 71: multiply, add, and keep it small \\ no tabs */\n return (x * 71 + 497) % 1000003;\n}\nstatic int step_72(int x)\n{\n +CODE 1 73/142 18056 17ab737c c /* step 72: multiply, add, and keep it small \\ no tabs */\n return (x * 72 + 504) % 1000003;\n}\nstatic int step_73(int x)\n{ +CODE 1 74/142 18056 17ab737c c \n /* step 73: multiply, add, and keep it small \\ no tabs */\n return (x * 73 + 511) % 1000003;\n}\nstatic int step_74(int x)\n +CODE 1 75/142 18056 17ab737c c {\n /* step 74: multiply, add, and keep it small \\ no tabs */\n return (x * 74 + 518) % 1000003;\n}\nstatic int step_75(int x) +CODE 1 76/142 18056 17ab737c c \n{\n /* step 75: multiply, add, and keep it small \\ no tabs */\n return (x * 75 + 525) % 1000003;\n}\nstatic int step_76(int x +CODE 1 77/142 18056 17ab737c c )\n{\n /* step 76: multiply, add, and keep it small \\ no tabs */\n return (x * 76 + 532) % 1000003;\n}\nstatic int step_77(int +CODE 1 78/142 18056 17ab737c c x)\n{\n /* step 77: multiply, add, and keep it small \\ no tabs */\n return (x * 77 + 539) % 1000003;\n}\nstatic int step_78(int +CODE 1 79/142 18056 17ab737c c x)\n{\n /* step 78: multiply, add, and keep it small \\ no tabs */\n return (x * 78 + 546) % 1000003;\n}\nstatic int step_79(in +CODE 1 80/142 18056 17ab737c c t x)\n{\n /* step 79: multiply, add, and keep it small \\ no tabs */\n return (x * 79 + 553) % 1000003;\n}\nstatic int step_80(i +CODE 1 81/142 18056 17ab737c c nt x)\n{\n /* step 80: multiply, add, and keep it small \\ no tabs */\n return (x * 80 + 560) % 1000003;\n}\nstatic int step_81( +CODE 1 82/142 18056 17ab737c c int x)\n{\n /* step 81: multiply, add, and keep it small \\ no tabs */\n return (x * 81 + 567) % 1000003;\n}\nstatic int step_82 +CODE 1 83/142 18056 17ab737c c (int x)\n{\n /* step 82: multiply, add, and keep it small \\ no tabs */\n return (x * 82 + 574) % 1000003;\n}\nstatic int step_8 +CODE 1 84/142 18056 17ab737c c 3(int x)\n{\n /* step 83: multiply, add, and keep it small \\ no tabs */\n return (x * 83 + 581) % 1000003;\n}\nstatic int step_ +CODE 1 85/142 18056 17ab737c c 84(int x)\n{\n /* step 84: multiply, add, and keep it small \\ no tabs */\n return (x * 84 + 588) % 1000003;\n}\nstatic int step +CODE 1 86/142 18056 17ab737c c _85(int x)\n{\n /* step 85: multiply, add, and keep it small \\ no tabs */\n return (x * 85 + 595) % 1000003;\n}\nstatic int ste +CODE 1 87/142 18056 17ab737c c p_86(int x)\n{\n /* step 86: multiply, add, and keep it small \\ no tabs */\n return (x * 86 + 602) % 1000003;\n}\nstatic int st +CODE 1 88/142 18056 17ab737c c ep_87(int x)\n{\n /* step 87: multiply, add, and keep it small \\ no tabs */\n return (x * 87 + 609) % 1000003;\n}\nstatic int s +CODE 1 89/142 18056 17ab737c c tep_88(int x)\n{\n /* step 88: multiply, add, and keep it small \\ no tabs */\n return (x * 88 + 616) % 1000003;\n}\nstatic int +CODE 1 90/142 18056 17ab737c c step_89(int x)\n{\n /* step 89: multiply, add, and keep it small \\ no tabs */\n return (x * 89 + 623) % 1000003;\n}\nstatic int +CODE 1 91/142 18056 17ab737c c step_90(int x)\n{\n /* step 90: multiply, add, and keep it small \\ no tabs */\n return (x * 90 + 630) % 1000003;\n}\nstatic in +CODE 1 92/142 18056 17ab737c c t step_91(int x)\n{\n /* step 91: multiply, add, and keep it small \\ no tabs */\n return (x * 91 + 637) % 1000003;\n}\nstatic i +CODE 1 93/142 18056 17ab737c c nt step_92(int x)\n{\n /* step 92: multiply, add, and keep it small \\ no tabs */\n return (x * 92 + 644) % 1000003;\n}\nstatic +CODE 1 94/142 18056 17ab737c c int step_93(int x)\n{\n /* step 93: multiply, add, and keep it small \\ no tabs */\n return (x * 93 + 651) % 1000003;\n}\nstatic +CODE 1 95/142 18056 17ab737c c int step_94(int x)\n{\n /* step 94: multiply, add, and keep it small \\ no tabs */\n return (x * 94 + 658) % 1000003;\n}\nstati +CODE 1 96/142 18056 17ab737c c c int step_95(int x)\n{\n /* step 95: multiply, add, and keep it small \\ no tabs */\n return (x * 95 + 665) % 1000003;\n}\nstat +CODE 1 97/142 18056 17ab737c c ic int step_96(int x)\n{\n /* step 96: multiply, add, and keep it small \\ no tabs */\n return (x * 96 + 672) % 1000003;\n}\nsta +CODE 1 98/142 18056 17ab737c c tic int step_97(int x)\n{\n /* step 97: multiply, add, and keep it small \\ no tabs */\n return (x * 97 + 679) % 1000003;\n}\nst +CODE 1 99/142 18056 17ab737c c atic int step_98(int x)\n{\n /* step 98: multiply, add, and keep it small \\ no tabs */\n return (x * 98 + 686) % 1000003;\n}\ns +CODE 1 100/142 18056 17ab737c c tatic int step_99(int x)\n{\n /* step 99: multiply, add, and keep it small \\ no tabs */\n return (x * 99 + 693) % 1000003;\n}\n +CODE 1 101/142 18056 17ab737c c static int step_100(int x)\n{\n /* step 100: multiply, add, and keep it small \\ no tabs */\n return (x * 100 + 700) % 1000003 +CODE 1 102/142 18056 17ab737c c ;\n}\nstatic int step_101(int x)\n{\n /* step 101: multiply, add, and keep it small \\ no tabs */\n return (x * 101 + 707) % 100 +CODE 1 103/142 18056 17ab737c c 0003;\n}\nstatic int step_102(int x)\n{\n /* step 102: multiply, add, and keep it small \\ no tabs */\n return (x * 102 + 714) % +CODE 1 104/142 18056 17ab737c c 1000003;\n}\nstatic int step_103(int x)\n{\n /* step 103: multiply, add, and keep it small \\ no tabs */\n return (x * 103 + 72 +CODE 1 105/142 18056 17ab737c c 1) % 1000003;\n}\nstatic int step_104(int x)\n{\n /* step 104: multiply, add, and keep it small \\ no tabs */\n return (x * 104 +CODE 1 106/142 18056 17ab737c c + 728) % 1000003;\n}\nstatic int step_105(int x)\n{\n /* step 105: multiply, add, and keep it small \\ no tabs */\n return (x * +CODE 1 107/142 18056 17ab737c c 105 + 735) % 1000003;\n}\nstatic int step_106(int x)\n{\n /* step 106: multiply, add, and keep it small \\ no tabs */\n return ( +CODE 1 108/142 18056 17ab737c c x * 106 + 742) % 1000003;\n}\nstatic int step_107(int x)\n{\n /* step 107: multiply, add, and keep it small \\ no tabs */\n retu +CODE 1 109/142 18056 17ab737c c rn (x * 107 + 749) % 1000003;\n}\nstatic int step_108(int x)\n{\n /* step 108: multiply, add, and keep it small \\ no tabs */\n +CODE 1 110/142 18056 17ab737c c return (x * 108 + 756) % 1000003;\n}\nstatic int step_109(int x)\n{\n /* step 109: multiply, add, and keep it small \\ no tabs */\n +CODE 1 111/142 18056 17ab737c c return (x * 109 + 763) % 1000003;\n}\nstatic int step_110(int x)\n{\n /* step 110: multiply, add, and keep it small \\ no tabs +CODE 1 112/142 18056 17ab737c c */\n return (x * 110 + 770) % 1000003;\n}\nstatic int step_111(int x)\n{\n /* step 111: multiply, add, and keep it small \\ no +CODE 1 113/142 18056 17ab737c c tabs */\n return (x * 111 + 777) % 1000003;\n}\nstatic int step_112(int x)\n{\n /* step 112: multiply, add, and keep it small \\ +CODE 1 114/142 18056 17ab737c c no tabs */\n return (x * 112 + 784) % 1000003;\n}\nstatic int step_113(int x)\n{\n /* step 113: multiply, add, and keep it sma +CODE 1 115/142 18056 17ab737c c ll \\ no tabs */\n return (x * 113 + 791) % 1000003;\n}\nstatic int step_114(int x)\n{\n /* step 114: multiply, add, and keep it +CODE 1 116/142 18056 17ab737c c small \\ no tabs */\n return (x * 114 + 798) % 1000003;\n}\nstatic int step_115(int x)\n{\n /* step 115: multiply, add, and kee +CODE 1 117/142 18056 17ab737c c p it small \\ no tabs */\n return (x * 115 + 805) % 1000003;\n}\nstatic int step_116(int x)\n{\n /* step 116: multiply, add, and +CODE 1 118/142 18056 17ab737c c keep it small \\ no tabs */\n return (x * 116 + 812) % 1000003;\n}\nstatic int step_117(int x)\n{\n /* step 117: multiply, add, +CODE 1 119/142 18056 17ab737c c and keep it small \\ no tabs */\n return (x * 117 + 819) % 1000003;\n}\nstatic int step_118(int x)\n{\n /* step 118: multiply, +CODE 1 120/142 18056 17ab737c c add, and keep it small \\ no tabs */\n return (x * 118 + 826) % 1000003;\n}\nstatic int step_119(int x)\n{\n /* step 119: multip +CODE 1 121/142 18056 17ab737c c ly, add, and keep it small \\ no tabs */\n return (x * 119 + 833) % 1000003;\n}\nstatic int step_120(int x)\n{\n /* step 120: mu +CODE 1 122/142 18056 17ab737c c ltiply, add, and keep it small \\ no tabs */\n return (x * 120 + 840) % 1000003;\n}\n\nint main(void)\n{\n int x = 1;\n x = ste +CODE 1 123/142 18056 17ab737c c p_1(x);\n x = step_2(x);\n x = step_3(x);\n x = step_4(x);\n x = step_5(x);\n x = step_6(x);\n x = step_7(x);\n x +CODE 1 124/142 18056 17ab737c c = step_8(x);\n x = step_9(x);\n x = step_10(x);\n x = step_11(x);\n x = step_12(x);\n x = step_13(x);\n x = step_14( +CODE 1 125/142 18056 17ab737c c x);\n x = step_15(x);\n x = step_16(x);\n x = step_17(x);\n x = step_18(x);\n x = step_19(x);\n x = step_20(x);\n +CODE 1 126/142 18056 17ab737c c x = step_21(x);\n x = step_22(x);\n x = step_23(x);\n x = step_24(x);\n x = step_25(x);\n x = step_26(x);\n x = step +CODE 1 127/142 18056 17ab737c c _27(x);\n x = step_28(x);\n x = step_29(x);\n x = step_30(x);\n x = step_31(x);\n x = step_32(x);\n x = step_33(x);\n +CODE 1 128/142 18056 17ab737c c x = step_34(x);\n x = step_35(x);\n x = step_36(x);\n x = step_37(x);\n x = step_38(x);\n x = step_39(x);\n x = +CODE 1 129/142 18056 17ab737c c step_40(x);\n x = step_41(x);\n x = step_42(x);\n x = step_43(x);\n x = step_44(x);\n x = step_45(x);\n x = step_46( +CODE 1 130/142 18056 17ab737c c x);\n x = step_47(x);\n x = step_48(x);\n x = step_49(x);\n x = step_50(x);\n x = step_51(x);\n x = step_52(x);\n +CODE 1 131/142 18056 17ab737c c x = step_53(x);\n x = step_54(x);\n x = step_55(x);\n x = step_56(x);\n x = step_57(x);\n x = step_58(x);\n x = step +CODE 1 132/142 18056 17ab737c c _59(x);\n x = step_60(x);\n x = step_61(x);\n x = step_62(x);\n x = step_63(x);\n x = step_64(x);\n x = step_65(x);\n +CODE 1 133/142 18056 17ab737c c x = step_66(x);\n x = step_67(x);\n x = step_68(x);\n x = step_69(x);\n x = step_70(x);\n x = step_71(x);\n x = +CODE 1 134/142 18056 17ab737c c step_72(x);\n x = step_73(x);\n x = step_74(x);\n x = step_75(x);\n x = step_76(x);\n x = step_77(x);\n x = step_78( +CODE 1 135/142 18056 17ab737c c x);\n x = step_79(x);\n x = step_80(x);\n x = step_81(x);\n x = step_82(x);\n x = step_83(x);\n x = step_84(x);\n +CODE 1 136/142 18056 17ab737c c x = step_85(x);\n x = step_86(x);\n x = step_87(x);\n x = step_88(x);\n x = step_89(x);\n x = step_90(x);\n x = step +CODE 1 137/142 18056 17ab737c c _91(x);\n x = step_92(x);\n x = step_93(x);\n x = step_94(x);\n x = step_95(x);\n x = step_96(x);\n x = step_97(x);\n +CODE 1 138/142 18056 17ab737c c x = step_98(x);\n x = step_99(x);\n x = step_100(x);\n x = step_101(x);\n x = step_102(x);\n x = step_103(x);\n +CODE 1 139/142 18056 17ab737c c x = step_104(x);\n x = step_105(x);\n x = step_106(x);\n x = step_107(x);\n x = step_108(x);\n x = step_109(x);\n x +CODE 1 140/142 18056 17ab737c c = step_110(x);\n x = step_111(x);\n x = step_112(x);\n x = step_113(x);\n x = step_114(x);\n x = step_115(x);\n x = +CODE 1 141/142 18056 17ab737c c step_116(x);\n x = step_117(x);\n x = step_118(x);\n x = step_119(x);\n x = step_120(x);\n printf("%d\\n", x);\n retu +CODE 1 142/142 18056 17ab737c c rn 0;\n}\n +SAY 1 1/1 Here is a long C program with many small steps, built with cc steps.c. diff --git a/evidence/allen-omega-L694/memory-native.bin b/evidence/allen-omega-L694/memory-native.bin new file mode 100644 index 00000000..f7d9769d Binary files /dev/null and b/evidence/allen-omega-L694/memory-native.bin differ diff --git a/evidence/allen-omega-L694/memory1.txt b/evidence/allen-omega-L694/memory1.txt new file mode 100644 index 00000000..fc84db4b --- /dev/null +++ b/evidence/allen-omega-L694/memory1.txt @@ -0,0 +1,61 @@ +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 0 +310 0 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +361 0 diff --git a/evidence/allen-omega-L694/mind-component.ppm b/evidence/allen-omega-L694/mind-component.ppm new file mode 100644 index 00000000..079e3eb1 Binary files /dev/null and b/evidence/allen-omega-L694/mind-component.ppm differ diff --git a/evidence/allen-omega-L694/native-counts.txt b/evidence/allen-omega-L694/native-counts.txt new file mode 100644 index 00000000..27785b93 --- /dev/null +++ b/evidence/allen-omega-L694/native-counts.txt @@ -0,0 +1,13 @@ + 28 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/runtime.log + 23 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/code.log + 24 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/courier.log + 79 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/memory.log + 8 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/intent.log + 15 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/reply.log + 13 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/view.log + 14 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/scene.log + 11 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/paint.log + 352 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/edges.log + 20 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/short.log + 292 /home/drakestapleton/handoffs/allen-omega-L694/build/final-native1/long.log + 879 total diff --git a/evidence/allen-omega-L694/paint2.txt b/evidence/allen-omega-L694/paint2.txt new file mode 100644 index 00000000..281a5bd2 --- /dev/null +++ b/evidence/allen-omega-L694/paint2.txt @@ -0,0 +1,11 @@ +1101 0 +1102 0 +1103 0 +1104 0 +1105 0 +1106 0 +1107 0 +1108 0 +1109 0 +1110 0 +1111 0 diff --git a/evidence/allen-omega-L694/parent-replay/README.md b/evidence/allen-omega-L694/parent-replay/README.md new file mode 100644 index 00000000..4ca3feee --- /dev/null +++ b/evidence/allen-omega-L694/parent-replay/README.md @@ -0,0 +1,5 @@ +# Independent parent replay of 8049f5d + +Fresh Git archive, pinned seed compiler, full native gate exit0. Programmatically recounted879 successful checks; five compiled mutants fail3/2/2/7/1; exact memory and stdio goldens match. Standalone allen SHA256 c22923a20f4bd9f30a3bc8e51544b10533a7c0a20bc65856a107a163362312e8. Rendering was inspected: one soft white point and blue-violet halo on black, no visible corruption; it is a primitive, not full UI parity. + +Original sandbox failure preserved. Full allen-courier legacy package replay outside that worker sandbox passes26 main+3 scene tests, including all four EPERM failures. This does NOT replace the full strict repository gate: its parent replay is separately running. Independent review L719 pending. Portable compatibility, native x86/providers, iMac QEMU and hardware remain incomplete. No READY or deployment. diff --git a/evidence/allen-omega-L694/parent-replay/binaries.sha256 b/evidence/allen-omega-L694/parent-replay/binaries.sha256 new file mode 100644 index 00000000..17e3b41f --- /dev/null +++ b/evidence/allen-omega-L694/parent-replay/binaries.sha256 @@ -0,0 +1,19 @@ +da36a1ca8ceb536ad5e831560c10ef2f4e995e256f9525fb256470109d840810 /home/drakestapleton/handoffs/allen-omega-L694/parent-full-replay/native-output/readback-mutant +798543784942f29bc405e5a560a73ec50025553d5190f0d00fc59aa8e5376c69 /home/drakestapleton/handoffs/allen-omega-L694/parent-full-replay/native-output/view +c22923a20f4bd9f30a3bc8e51544b10533a7c0a20bc65856a107a163362312e8 /home/drakestapleton/handoffs/allen-omega-L694/parent-full-replay/native-output/allen +ac0bc89319605462156184f3f39e62e7cc12e2748d8feb3d39c80e91d383dbef /home/drakestapleton/handoffs/allen-omega-L694/parent-full-replay/native-output/reply +f75db42bc8ee80899ccfda45022a6be3d80c439922edd6c36eee2c36de30ffec /home/drakestapleton/handoffs/allen-omega-L694/parent-full-replay/native-output/hash-mutant +0039a6d288e11ec70b12b1af15909bb308c6b72f08cb39c51fe06aad245e2690 /home/drakestapleton/handoffs/allen-omega-L694/parent-full-replay/native-output/golden +d3ed86f446ac73fc813f8cb905e0fa30e8fc26d9984c3e47ced86424690fc3d9 /home/drakestapleton/handoffs/allen-omega-L694/parent-full-replay/native-output/session-mutant +bb17eefbb058191b0669ab15529051c5de99e0f25448e05501d8fc7f9532b3af /home/drakestapleton/handoffs/allen-omega-L694/parent-full-replay/native-output/intent +9bbf95a44321be8d57043d5daa68f4945d2eac63be7e5befa260db79a6defea8 /home/drakestapleton/handoffs/allen-omega-L694/parent-full-replay/native-output/fixture +52f05863a960da4e021bae3eecb161792663ce3dfcc701a685a9f93b65570ff7 /home/drakestapleton/handoffs/allen-omega-L694/parent-full-replay/native-output/runtime +b6d231c1a1b1cb2fcdea6fcbbc3419aa5aec92ff9fc9984d261dcbc26943b737 /home/drakestapleton/handoffs/allen-omega-L694/parent-full-replay/native-output/code +d30797bb341012516081fb6620ec21c6e3f428194ab9968b2181f8074786eba6 /home/drakestapleton/handoffs/allen-omega-L694/parent-full-replay/native-output/edges +87676023c7d49e5ea9346f84c71aed4511046bd29f76ed91eea3fd727660ad8d /home/drakestapleton/handoffs/allen-omega-L694/parent-full-replay/native-output/render +7391168db6c88324a04881498ad7b671fd306226921e050d9777e090d0e6cc6e /home/drakestapleton/handoffs/allen-omega-L694/parent-full-replay/native-output/stale-mutant +3031d8376ce13d13b8ff55005600e36caf14ac4a59362611f2f5aefd639fe238 /home/drakestapleton/handoffs/allen-omega-L694/parent-full-replay/native-output/courier +44601a3b526c1e799b908342454f1fd3992ac70b83a396a04f2daef8e06ef21c /home/drakestapleton/handoffs/allen-omega-L694/parent-full-replay/native-output/scene +fd080b24d5b5833f70237e966c4bc8688dc4aadba8486b739dc7694fcaf99f6d /home/drakestapleton/handoffs/allen-omega-L694/parent-full-replay/native-output/paint +0e1de4f532b286d8a0fe320bb9b9d61a0724b545e65d27e1fc43e497fac2ec7f /home/drakestapleton/handoffs/allen-omega-L694/parent-full-replay/native-output/crc-mutant +1a210071b068ef5e527dc66651ab635c53971add8b9cfab09c2fdff2290ff6dd /home/drakestapleton/handoffs/allen-omega-L694/parent-full-replay/native-output/memory diff --git a/evidence/allen-omega-L694/parent-replay/code.log b/evidence/allen-omega-L694/parent-replay/code.log new file mode 100644 index 00000000..e7e197b7 --- /dev/null +++ b/evidence/allen-omega-L694/parent-replay/code.log @@ -0,0 +1,23 @@ +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 diff --git a/evidence/allen-omega-L694/parent-replay/courier.log b/evidence/allen-omega-L694/parent-replay/courier.log new file mode 100644 index 00000000..8402df49 --- /dev/null +++ b/evidence/allen-omega-L694/parent-replay/courier.log @@ -0,0 +1,24 @@ +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 0 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 diff --git a/evidence/allen-omega-L694/parent-replay/crc-mutant.log b/evidence/allen-omega-L694/parent-replay/crc-mutant.log new file mode 100644 index 00000000..a0d90bd4 --- /dev/null +++ b/evidence/allen-omega-L694/parent-replay/crc-mutant.log @@ -0,0 +1,23 @@ +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 1 +117 1 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 diff --git a/evidence/allen-omega-L694/parent-replay/edges.log b/evidence/allen-omega-L694/parent-replay/edges.log new file mode 100644 index 00000000..e8d0deea --- /dev/null +++ b/evidence/allen-omega-L694/parent-replay/edges.log @@ -0,0 +1,352 @@ +1201 0 +1202 0 +1203 0 +1204 0 +1205 0 +1206 0 +1207 0 +1208 0 +1209 0 +1210 0 +1211 0 +1212 0 +1213 0 +1214 0 +1220 0 +1221 0 +1222 0 +1223 0 +1224 0 +1225 0 +1226 0 +1227 0 +1228 0 +1229 0 +1230 0 +1231 0 +1232 0 +1233 0 +1234 0 +1235 0 +1236 0 +1237 0 +1238 0 +1239 0 +1240 0 +1241 0 +1242 0 +1243 0 +1244 0 +1245 0 +1246 0 +1247 0 +1248 0 +1249 0 +1250 0 +1251 0 +1252 0 +1253 0 +1254 0 +1255 0 +1256 0 +1257 0 +1258 0 +1259 0 +1260 0 +1261 0 +1262 0 +1301 0 +1302 0 +1303 0 +1304 0 +1305 0 +1306 0 +1310 0 +1311 0 +1312 0 +1313 0 +1314 0 +1315 0 +1316 0 +1317 0 +1318 0 +1319 0 +1320 0 +1321 0 +1322 0 +1323 0 +1324 0 +1325 0 +1326 0 +1327 0 +1328 0 +1329 0 +1330 0 +1331 0 +1332 0 +1333 0 +1334 0 +1335 0 +1336 0 +1337 0 +1338 0 +1339 0 +1340 0 +1341 0 +1342 0 +1343 0 +1344 0 +1345 0 +1346 0 +1347 0 +1348 0 +1349 0 +1350 0 +1351 0 +1352 0 +1353 0 +1354 0 +1355 0 +1356 0 +1357 0 +1358 0 +1359 0 +1360 0 +1361 0 +1362 0 +1363 0 +1364 0 +1365 0 +1366 0 +1367 0 +1368 0 +1369 0 +1370 0 +1371 0 +1372 0 +1373 0 +1374 0 +1375 0 +1376 0 +1377 0 +1378 0 +1379 0 +1380 0 +1381 0 +1382 0 +1383 0 +1384 0 +1385 0 +1386 0 +1387 0 +1388 0 +1389 0 +1390 0 +1391 0 +1392 0 +1393 0 +1394 0 +1395 0 +1396 0 +1397 0 +1398 0 +1399 0 +1400 0 +1401 0 +1402 0 +1403 0 +1404 0 +1405 0 +1406 0 +1407 0 +1408 0 +1409 0 +1410 0 +1411 0 +1412 0 +1413 0 +1414 0 +1415 0 +1416 0 +1417 0 +1418 0 +1419 0 +1420 0 +1421 0 +1422 0 +1423 0 +1424 0 +1425 0 +1426 0 +1427 0 +1428 0 +1429 0 +1430 0 +1431 0 +1432 0 +1433 0 +1434 0 +1435 0 +1436 0 +1437 0 +1438 0 +1439 0 +1440 0 +1441 0 +1442 0 +1443 0 +1444 0 +1445 0 +1446 0 +1447 0 +1448 0 +1449 0 +1450 0 +1451 0 +1452 0 +1453 0 +1454 0 +1455 0 +1456 0 +1457 0 +1458 0 +1459 0 +1460 0 +1461 0 +1462 0 +1463 0 +1464 0 +1465 0 +1466 0 +1467 0 +1468 0 +1469 0 +1470 0 +1471 0 +1472 0 +1473 0 +1474 0 +1475 0 +1476 0 +1477 0 +1478 0 +1479 0 +1480 0 +1481 0 +1482 0 +1483 0 +1484 0 +1485 0 +1486 0 +1487 0 +1488 0 +1489 0 +1490 0 +1491 0 +1492 0 +1493 0 +1494 0 +1495 0 +1496 0 +1497 0 +1498 0 +1499 0 +1500 0 +1501 0 +1502 0 +1503 0 +1504 0 +1505 0 +1506 0 +1507 0 +1508 0 +1509 0 +1510 0 +1511 0 +1512 0 +1513 0 +1514 0 +1515 0 +1516 0 +1517 0 +1518 0 +1519 0 +1520 0 +1521 0 +1522 0 +1523 0 +1524 0 +1525 0 +1526 0 +1527 0 +1528 0 +1529 0 +1530 0 +1531 0 +1532 0 +1533 0 +1534 0 +1535 0 +1536 0 +1537 0 +1538 0 +1539 0 +1540 0 +1541 0 +1542 0 +1543 0 +1544 0 +1545 0 +1546 0 +1547 0 +1548 0 +1549 0 +1550 0 +1551 0 +1552 0 +1553 0 +1554 0 +1555 0 +1556 0 +1557 0 +1558 0 +1559 0 +1560 0 +1561 0 +1562 0 +1563 0 +1564 0 +1565 0 +1570 0 +1571 0 +1572 0 +1575 0 +1573 0 +1574 0 +1600 0 +1601 0 +1602 0 +1603 0 +1604 0 +1605 0 +1606 0 +1607 0 +1610 0 +1611 0 +1612 0 +1613 0 +1614 0 +1615 0 +1616 0 +1617 0 +1701 0 +1702 0 +1703 0 +1704 0 +1705 0 +1706 0 +1707 0 +1708 0 +1709 0 +1710 0 +1711 0 diff --git a/evidence/allen-omega-L694/parent-replay/exit-code b/evidence/allen-omega-L694/parent-replay/exit-code new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/parent-replay/exit-code @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/parent-replay/gate.log b/evidence/allen-omega-L694/parent-replay/gate.log new file mode 100644 index 00000000..aebe5e83 --- /dev/null +++ b/evidence/allen-omega-L694/parent-replay/gate.log @@ -0,0 +1,20 @@ +runtime compile=0 native-exit=0 +code compile=0 native-exit=0 +courier compile=0 native-exit=0 +memory compile=0 native-exit=0 +intent compile=0 native-exit=0 +reply compile=0 native-exit=0 +view compile=0 native-exit=0 +scene compile=0 native-exit=0 +paint compile=0 native-exit=0 +edges compile=0 native-exit=0 +fixture compile=0 native-exit=0 +golden compile=0 native-exit=0 +render compile=0 native-exit=0 +stdio native-exit=0 golden-cmp=0 +stale mutant compile=0 rejected-exit=3 +crc mutant compile=0 rejected-exit=2 +hash mutant compile=0 rejected-exit=2 +readback mutant compile=0 rejected-exit=7 +session mutant compile=0 rejected-exit=1 +ALLEN_OMEGA_HOST: PASS; target=NOT_RUN; live=NOT_RUN diff --git a/evidence/allen-omega-L694/parent-replay/hash-mutant.log b/evidence/allen-omega-L694/parent-replay/hash-mutant.log new file mode 100644 index 00000000..c75cfefb --- /dev/null +++ b/evidence/allen-omega-L694/parent-replay/hash-mutant.log @@ -0,0 +1,79 @@ +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 1 +310 1 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +362 0 +363 0 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 0 +361 0 diff --git a/evidence/allen-omega-L694/parent-replay/intent.log b/evidence/allen-omega-L694/parent-replay/intent.log new file mode 100644 index 00000000..5371bd36 --- /dev/null +++ b/evidence/allen-omega-L694/parent-replay/intent.log @@ -0,0 +1,8 @@ +501 0 +502 0 +503 0 +504 0 +505 0 +506 0 +507 0 +508 0 diff --git a/evidence/allen-omega-L694/parent-replay/legacy-courier-tests.log b/evidence/allen-omega-L694/parent-replay/legacy-courier-tests.log new file mode 100644 index 00000000..73b6f3a9 --- /dev/null +++ b/evidence/allen-omega-L694/parent-replay/legacy-courier-tests.log @@ -0,0 +1,42 @@ + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.06s + Running unittests src/main.rs (target/debug/deps/allen_courier-e491f6ef3b9d347e) + +running 26 tests +test code::tests::an_unclosed_block_runs_to_the_end_and_no_block_is_none ... ok +test code::tests::a_sentence_and_a_fenced_block_are_read ... ok +test code::tests::crc_is_zlibs ... ok +test code::tests::short_names_and_odd_bytes_are_made_plain ... ok +test plain_tests::a_cut_answer_stays_within_the_room_with_its_mark ... ok +test tests::a_busy_server_is_asked_again_with_growing_waits ... ok +test plain_tests::typographic_marks_become_plain_ones ... ok +test tests::a_busy_server_names_its_wait_exactly ... ok +test tests::a_job_line_carries_the_memory_fields ... ok +test tests::a_sentence_end_too_early_is_not_used ... ok +test tests::datagram_heads_round_trip ... ok +test tests::a_code_reply_becomes_pieces_and_a_closing_sentence ... ok +test key_tests::a_good_key_is_sent_once_as_a_bearer_and_the_first_model_comes_back ... ok +test tests::dates_are_civil ... ok +test tests::chunked_bodies_are_joined ... ok +test key_tests::claude_gets_its_own_headers_and_a_refused_key_says_so ... ok +test key_tests::no_key_sends_no_header_and_https_is_refused_out_loud ... ok +test tests::json_strings_round_trip ... ok +test tests::long_answers_are_cut_at_a_sentence_end ... ok +test tests::short_answers_pass_whole_with_whitespace_folded ... ok +test tests::words_on_the_wire ... ok +test tests::the_assistant_text_is_found_in_a_chat_completion ... ok +test tests::what_was_already_said_in_parts_is_kept ... ok +test code::tests::long_code_is_cut_at_a_line_within_the_limits ... ok +test tests::saved_exchanges_reach_the_model_as_ordered_conversation_turns ... ok +test code::tests::pieces_carry_length_checksum_and_escapes ... ok + +test result: ok. 26 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running unittests src/bin/allen-scene.rs (target/debug/deps/allen_scene-8a13abc9d8fd96a0) + +running 3 tests +test tests::replies_and_numbers_are_read_from_a_completion ... ok +test tests::the_prompt_is_plain_and_names_every_kind ... ok +test tests::slugs_and_waits ... ok + +test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + diff --git a/evidence/allen-omega-L694/parent-replay/long.log b/evidence/allen-omega-L694/parent-replay/long.log new file mode 100644 index 00000000..0a060bc8 --- /dev/null +++ b/evidence/allen-omega-L694/parent-replay/long.log @@ -0,0 +1,292 @@ +401 0 +410 0 +411 0 +412 0 +413 0 +414 0 +415 0 +416 0 +417 0 +418 0 +419 0 +420 0 +421 0 +422 0 +423 0 +424 0 +425 0 +426 0 +427 0 +428 0 +429 0 +430 0 +431 0 +432 0 +433 0 +434 0 +435 0 +436 0 +437 0 +438 0 +439 0 +440 0 +441 0 +442 0 +443 0 +444 0 +445 0 +446 0 +447 0 +448 0 +449 0 +450 0 +451 0 +452 0 +453 0 +454 0 +455 0 +456 0 +457 0 +458 0 +459 0 +460 0 +461 0 +462 0 +463 0 +464 0 +465 0 +466 0 +467 0 +468 0 +469 0 +470 0 +471 0 +472 0 +473 0 +474 0 +475 0 +476 0 +477 0 +478 0 +479 0 +480 0 +481 0 +482 0 +483 0 +484 0 +485 0 +486 0 +487 0 +488 0 +489 0 +490 0 +491 0 +492 0 +493 0 +494 0 +495 0 +496 0 +497 0 +498 0 +499 0 +500 0 +501 0 +502 0 +503 0 +504 0 +505 0 +506 0 +507 0 +508 0 +509 0 +510 0 +511 0 +512 0 +513 0 +514 0 +515 0 +516 0 +517 0 +518 0 +519 0 +520 0 +521 0 +522 0 +523 0 +524 0 +525 0 +526 0 +527 0 +528 0 +529 0 +530 0 +531 0 +532 0 +533 0 +534 0 +535 0 +536 0 +537 0 +538 0 +539 0 +540 0 +541 0 +542 0 +543 0 +544 0 +545 0 +546 0 +547 0 +548 0 +549 0 +550 0 +402 0 +403 0 +404 0 +405 0 +406 0 +700 0 +701 0 +702 0 +703 0 +704 0 +705 0 +706 0 +707 0 +708 0 +709 0 +710 0 +711 0 +712 0 +713 0 +714 0 +715 0 +716 0 +717 0 +718 0 +719 0 +720 0 +721 0 +722 0 +723 0 +724 0 +725 0 +726 0 +727 0 +728 0 +729 0 +730 0 +731 0 +732 0 +733 0 +734 0 +735 0 +736 0 +737 0 +738 0 +739 0 +740 0 +741 0 +742 0 +743 0 +744 0 +745 0 +746 0 +747 0 +748 0 +749 0 +750 0 +751 0 +752 0 +753 0 +754 0 +755 0 +756 0 +757 0 +758 0 +759 0 +760 0 +761 0 +762 0 +763 0 +764 0 +765 0 +766 0 +767 0 +768 0 +769 0 +770 0 +771 0 +772 0 +773 0 +774 0 +775 0 +776 0 +777 0 +778 0 +779 0 +780 0 +781 0 +782 0 +783 0 +784 0 +785 0 +786 0 +787 0 +788 0 +789 0 +790 0 +791 0 +792 0 +793 0 +794 0 +795 0 +796 0 +797 0 +798 0 +799 0 +800 0 +801 0 +802 0 +803 0 +804 0 +805 0 +806 0 +807 0 +808 0 +809 0 +810 0 +811 0 +812 0 +813 0 +814 0 +815 0 +816 0 +817 0 +818 0 +819 0 +820 0 +821 0 +822 0 +823 0 +824 0 +825 0 +826 0 +827 0 +828 0 +829 0 +830 0 +831 0 +832 0 +833 0 +834 0 +835 0 +836 0 +837 0 +838 0 +839 0 +840 0 +841 0 +407 0 +408 0 +409 0 diff --git a/evidence/allen-omega-L694/parent-replay/memory.log b/evidence/allen-omega-L694/parent-replay/memory.log new file mode 100644 index 00000000..5928102e --- /dev/null +++ b/evidence/allen-omega-L694/parent-replay/memory.log @@ -0,0 +1,79 @@ +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 0 +310 0 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 0 +339 0 +340 0 +341 0 +342 0 +343 0 +344 0 +345 0 +346 0 +347 0 +348 0 +349 0 +350 0 +351 0 +352 0 +362 0 +363 0 +353 0 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 0 +361 0 diff --git a/evidence/allen-omega-L694/parent-replay/paint.log b/evidence/allen-omega-L694/parent-replay/paint.log new file mode 100644 index 00000000..281a5bd2 --- /dev/null +++ b/evidence/allen-omega-L694/parent-replay/paint.log @@ -0,0 +1,11 @@ +1101 0 +1102 0 +1103 0 +1104 0 +1105 0 +1106 0 +1107 0 +1108 0 +1109 0 +1110 0 +1111 0 diff --git a/evidence/allen-omega-L694/parent-replay/readback-mutant.log b/evidence/allen-omega-L694/parent-replay/readback-mutant.log new file mode 100644 index 00000000..268002ad --- /dev/null +++ b/evidence/allen-omega-L694/parent-replay/readback-mutant.log @@ -0,0 +1,79 @@ +301 0 +302 0 +303 0 +304 0 +305 0 +306 0 +307 0 +308 0 +309 0 +310 0 +311 0 +312 0 +313 0 +314 0 +315 0 +316 0 +317 0 +318 0 +319 0 +320 0 +321 0 +322 0 +323 0 +324 0 +325 0 +326 0 +327 0 +328 0 +329 0 +330 0 +331 0 +332 0 +333 0 +334 0 +335 0 +336 0 +337 0 +338 1 +339 1 +340 0 +341 0 +342 0 +343 0 +344 1 +345 0 +346 0 +347 0 +348 0 +349 1 +350 1 +351 0 +352 0 +362 0 +363 0 +353 1 +354 0 +355 0 +356 0 +357 0 +358 0 +359 0 +360 0 +364 0 +365 0 +366 0 +367 0 +368 0 +369 0 +370 0 +371 0 +372 0 +373 0 +374 0 +375 0 +376 0 +377 0 +378 0 +379 1 +361 0 diff --git a/evidence/allen-omega-L694/parent-replay/reply.log b/evidence/allen-omega-L694/parent-replay/reply.log new file mode 100644 index 00000000..d11a72ad --- /dev/null +++ b/evidence/allen-omega-L694/parent-replay/reply.log @@ -0,0 +1,15 @@ +801 0 +802 0 +803 0 +804 0 +805 0 +806 0 +807 0 +808 0 +809 0 +810 0 +811 0 +812 0 +813 0 +814 0 +815 0 diff --git a/evidence/allen-omega-L694/parent-replay/runtime.log b/evidence/allen-omega-L694/parent-replay/runtime.log new file mode 100644 index 00000000..5168e6f3 --- /dev/null +++ b/evidence/allen-omega-L694/parent-replay/runtime.log @@ -0,0 +1,28 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 diff --git a/evidence/allen-omega-L694/parent-replay/scene.log b/evidence/allen-omega-L694/parent-replay/scene.log new file mode 100644 index 00000000..44a4b2b1 --- /dev/null +++ b/evidence/allen-omega-L694/parent-replay/scene.log @@ -0,0 +1,14 @@ +1001 0 +1002 0 +1003 0 +1004 0 +1005 0 +1006 0 +1007 0 +1008 0 +1009 0 +1010 0 +1011 0 +1012 0 +1013 0 +1014 0 diff --git a/evidence/allen-omega-L694/parent-replay/session-mutant.log b/evidence/allen-omega-L694/parent-replay/session-mutant.log new file mode 100644 index 00000000..9ce7ef78 --- /dev/null +++ b/evidence/allen-omega-L694/parent-replay/session-mutant.log @@ -0,0 +1,24 @@ +201 0 +202 0 +203 0 +204 0 +205 0 +206 0 +207 0 +208 1 +209 0 +210 0 +211 0 +212 0 +213 0 +214 0 +215 0 +216 0 +217 0 +218 0 +219 0 +220 0 +221 0 +222 0 +223 0 +224 0 diff --git a/evidence/allen-omega-L694/parent-replay/short.log b/evidence/allen-omega-L694/parent-replay/short.log new file mode 100644 index 00000000..a9da2dc8 --- /dev/null +++ b/evidence/allen-omega-L694/parent-replay/short.log @@ -0,0 +1,20 @@ +401 0 +410 0 +411 0 +412 0 +413 0 +414 0 +402 0 +403 0 +404 0 +405 0 +406 0 +700 0 +701 0 +702 0 +703 0 +704 0 +705 0 +407 0 +408 0 +409 0 diff --git a/evidence/allen-omega-L694/parent-replay/source.sha256 b/evidence/allen-omega-L694/parent-replay/source.sha256 new file mode 100644 index 00000000..1ed3c753 --- /dev/null +++ b/evidence/allen-omega-L694/parent-replay/source.sha256 @@ -0,0 +1,34 @@ +184f4270c72c4eca6a7afdd28b70a608f2e237980b12c8a7bfc2c7d2c3e625b9 native/omega/allen/base.om +795ca28627a19f1088de0f23277e79cdac921ff88451c606c7b655ce0f2e8a5b native/omega/allen/build-one.sh +4d2235ac5d6b237695b1c3112f70ebdfa0cebafa2ec8e691e4be4de37a62199b native/omega/allen/code.om +76ee9cdeaac036905c76dfa29f42bf5a78d1259ad1656adfaa24916c3b93550d native/omega/allen/courier.om +357481ea27a68a4d452c97017dad70fe11566612951d71e947549c1de8441846 native/omega/allen/gate.sh +9d71a653870eeef678f95df04db9c38aedaadd06e7c74bf3e5d9fde6e28f82f8 native/omega/allen/golden.sh +06087bc573ebb876a0ed80f6025c592fb4b1d23335169c3da402824fd1482c35 native/omega/allen/intent.om +2346077ef78cf54124f777016cf44e1034546f400bb6642e73713c8987875f0f native/omega/allen/main.om +068292abd04d3a61b063fc5380b22a56c4235a87915c219ebf3b37d16d7bc9c7 native/omega/allen/memory.om +b4d7b6e6cd680d2ba1eec2978b0cbb81ffc63035b73f5c3726bdad97a7b6aa04 native/omega/allen/paint.om +46ba5562bcbbd808e6557f1f49e296e022c292ea0b718b1516312f10a9828cca native/omega/allen/README.md +e50a7f673aaee92aba4a3aec303aa93b071121c09ad05d4ad1dcc2deb9706dcc native/omega/allen/reply.om +5b01eae03204d08f6d207ef29f2ba09a1d9f249f1738f68f151214675a4ff2ed native/omega/allen/runtime.om +c8d4a437b41538cc1eeb62a2029c6993d41e5ef90cc7b26c8e1c92bc98ec57d3 native/omega/allen/scene.om +f085198549d1c235a97574ff6f6560ce82217611f4051fc3dbbc8286aab6d536 native/omega/allen/tests/check.om +b76438a85257bd95768115047be286c107e3723628a16a0541870732d0849a42 native/omega/allen/tests/code.om +98105e1c30626f54da07940fe0415637730b7e112ea39ba2aae1f2d648993373 native/omega/allen/tests/courier.om +f524aab74657dc2e9e4330bf42bc05ef01ce3e8f08a05c80371be0c0a33764d3 native/omega/allen/tests/edges.om +a2e8bcde92d522216a4fa99559dd3bcba096aea86127364587dadcc2bfb585af native/omega/allen/tests/fixture.om +c9ef2bee7cbd1c072c6045d62c55f3bdd938901e91792cee72ea57fb8f25a198 native/omega/allen/tests/golden.om +8ba742d85ea510586f3cf86661bc0f28c5d99b59981c2d3fb220705efad24564 native/omega/allen/tests/intent.om +861d9af698b021056cceb6c00ae3458558db415963fe832d3fca7da55731cf7b native/omega/allen/tests/memory.om +13e4db7436165783c6aad48497ffe89fa6e5ba3de928e66a766c29e1e817fcf5 native/omega/allen/tests/paint.om +e6d232d92d74d88423cebbbbfc6e403ea9b865b80c909e1d23087001d905035a native/omega/allen/tests/probe.om +8fbc8a0517900efd771a994686356416a0fea5e20cfd9bc26c787850398113df native/omega/allen/tests/render.om +094a5e833bae7dfd3b013e3f015f143e9d7bd3efe9b9c896a7f58b09e1ec14b8 native/omega/allen/tests/reply.om +bab9b0e853aa4b62918353a5d1625a3171deebfb639e599fe9751b5a61a3df62 native/omega/allen/tests/runtime.om +b9c84d9a58658589137764fe60209d8320550dd8ed99fa6026df65ba48737e4f native/omega/allen/tests/scene.om +89aee5326b428147ea6da9aa739b6679e214ed114ae5f41d3b70299cf864092c native/omega/allen/tests/view.om +0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0 native/omega/allen/vendor/OMEGA-LICENSE +b234738e8ce81b3d67586deb41fdaab4543169d4b69e86fd3dc28a08432ab5fc native/omega/allen/vendor/PROVENANCE.md +992ec4a4957271b442740598136887a5c610effcd8ae9fb9480a006a4f181097 native/omega/allen/vendor/sha256-core.om +0781cdcec18570a57afbe3be4a6717dd2d1fa4c887b49a3e4cb542b594f8a041 native/omega/allen/vendor/sha256.om +abbefd2f7dc48f2ac28b9526f5c2e5b369da4b7c5e84dde6e6a3cd20bd5687ac native/omega/allen/view.om diff --git a/evidence/allen-omega-L694/parent-replay/stale-mutant.log b/evidence/allen-omega-L694/parent-replay/stale-mutant.log new file mode 100644 index 00000000..ac2e3d09 --- /dev/null +++ b/evidence/allen-omega-L694/parent-replay/stale-mutant.log @@ -0,0 +1,28 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 1 +7 1 +8 1 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 diff --git a/evidence/allen-omega-L694/parent-replay/view.log b/evidence/allen-omega-L694/parent-replay/view.log new file mode 100644 index 00000000..8b194f11 --- /dev/null +++ b/evidence/allen-omega-L694/parent-replay/view.log @@ -0,0 +1,13 @@ +901 0 +902 0 +903 0 +904 0 +905 0 +906 0 +907 0 +908 0 +909 0 +910 0 +911 0 +912 0 +913 0 diff --git a/evidence/allen-omega-L694/parent-strict/README.md b/evidence/allen-omega-L694/parent-strict/README.md new file mode 100644 index 00000000..f6109bef --- /dev/null +++ b/evidence/allen-omega-L694/parent-strict/README.md @@ -0,0 +1,20 @@ +# Parent strict repository replay + +Command: `AIENOS_STRICT=1 quiet-build bash scripts/verify_all.sh` + +Actual subprocess exit: **0**. Final result: **VERIFY_ALL: PASS**, every step ran. +QEMU results are emulator evidence only; physical hardware remains NOT_RUN. +This resolves the earlier sandbox-limited broad verification attempt by running +outside that sandbox, without skipping checks or weakening assertions. + +The command ran while the branch advanced through native Omega-only changes and +published receipts. It is not an immutable whole-head qualification. Parent +verified that no tracked source outside `native/omega/allen` and this lane's +evidence changed since8049f5d. The native Omega implementation is qualified by its +separate frozen-source1092-check/seven-mutant receipt and independent review. +This broad legacy suite does not prove Omega socket/device integration or an +Omega iMac boot. L694 remains open. + +Raw log SHA-256: `ad344f3a507cdaa79edc24b0cc4b4cbd31de800a73533a59b8f156ddddf2abf9`. +Completion notification: `proc_4916b116cca8`, consumed and verified from the +remote exit sentinel and raw final verdict. No duplicate run was launched. diff --git a/evidence/allen-omega-L694/parent-strict/exit-code b/evidence/allen-omega-L694/parent-strict/exit-code new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/evidence/allen-omega-L694/parent-strict/exit-code @@ -0,0 +1 @@ +0 diff --git a/evidence/allen-omega-L694/parent-strict/verify-all.log b/evidence/allen-omega-L694/parent-strict/verify-all.log new file mode 100644 index 00000000..248426f2 --- /dev/null +++ b/evidence/allen-omega-L694/parent-strict/verify-all.log @@ -0,0 +1,1998 @@ +============================================================ +AIENOS Integration Verification Harness +Host: spark-b87b | Arch: aarch64 | Kernel: 7.0.0-1019-nvidia +Date: 2026-10-23T11:47:09Z +Strict: 1 | Serial log dir: none +============================================================ + +--- [Gate 1 Verification: Config A Freeze] --- +Config A capture verified for spark-b87b: 5 samples, mean decode 54.2 tokens/s +M0 closable: no (recovery procedure is documented_only; native boot rollback has not been tested on Machine 1) +PASS Gate 1 Config A reference bundle verified + +--- [Formatting: cargo fmt --check] --- +PASS formatting: cargo fmt --all --check + +--- [Host Component Testing: Workspace Crates] --- + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.02s + Running unittests src/lib.rs (target/debug/deps/aienos_accel-d25eb76ec36d0a33) + +running 16 tests +test pci::tests::capability_list_absence_is_empty_not_error ... ok +test pci::tests::decodes_bridge_header_and_window ... ok +test pci::tests::decodes_msi_msix_and_pcie ... ok +test pci::tests::decodes_bar_sizes_with_bounds ... ok +test pci::tests::decodes_standard_header_and_64_bit_bar ... ok +test pci::tests::rejects_capability_loop_and_out_of_bounds ... ok +test pci::tests::rejects_reserved_bar_encodings ... ok +test pci::tests::rejects_truncated_header_and_bridge_type ... ok +test pci::tests::walks_extended_capabilities_with_loop_and_bounds_checks ... ok +test profile::tests::match_gb10_is_property_based_not_bdf_based ... ok +test profile::tests::profile_classifies_source_and_native_verification ... ok +test registers::tests::ledger_is_exactly_the_two_established_offsets ... ok +test registers::tests::ledger_renders_without_claiming_semantics ... ok +test profile::tests::profile_renders_deterministically ... ok +test tests::diagnostics_report_refused_opens_segments_and_bar_state ... ok +test tests::validates_gb10_memory_bar ... ok + +test result: ok. 16 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running tests/gb10_fixtures.rs (target/debug/deps/gb10_fixtures-a1e328f7018003cd) + +running 10 tests +test follows_a_secondary_bus_window_to_a_downstream_gb10 ... ok +test decodes_capabilities_from_full_config_space ... ok +test identifies_gb10_from_properties_under_bdf_relocation ... ok +test handles_large_bar_and_extended_space_bounds ... ok +test profile_decodes_bar_kinds_and_keeps_sizes_unknown ... ok +test rejects_disabled_memory_decoding_unprogrammed_and_32_bit_bar ... ok +test rejects_malformed_capability_loops ... ok +test rejects_wrong_vendor_and_wrong_device ... ok +test reports_missing_msi_and_msix_as_absent_not_zero ... ok +test selects_the_gb10_among_multiple_nvidia_devices ... ok + +test result: ok. 10 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running unittests src/lib.rs (target/debug/deps/aienos_aegis-8549be8b0aa8de31) + +running 6 tests +test capability::tests::filesystem_scope_rejects_sibling_and_traversal_paths ... ok +test broker::tests::claimed_world_cannot_authorize_network_or_escaped_filesystem_effects ... ok +test effect::tests::intent_id_distinguishes_parameter_boundaries ... ok +test broker::tests::world_bound_write_uses_delta_and_rollback_discards_it ... ok +test capability::tests::test_capability_attenuation_and_cascading_revocation ... ok +test broker::tests::test_aegis_reversible_vs_irreversible_enforcement ... ok + +test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running tests/phase_3_to_5_integration.rs (target/debug/deps/phase_3_to_5_integration-b5f8a680ff6a79fb) + +running 1 test +test test_full_agent_epistemic_capability_and_c1_lifecycle ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.18s + + Running unittests src/lib.rs (target/debug/deps/aienos_agent_state-158f10fde7b3594d) + +running 22 tests +test history::tests::test_token_history_rolling_hash ... ok +test id::tests::test_agent_id_determinism ... ok +test id::tests::test_branch_id_derivation ... ok +test lineage::tests::test_lineage_extension ... ok +test manager::tests::re_registering_an_existing_identity_does_not_reset_its_root_branch ... ok +test manager::tests::restore_refuses_checkpoint_without_durable_identity ... ok +test manager::tests::test_suspend_resume_lifecycle_and_tamper_rejection ... ok +test manager::tests::restore_rebuilds_fork_counters_without_reusing_branch_ids ... ok +test manager::tests::restore_rejects_noncontiguous_persisted_fork_indexes ... ok +test manager::tests::restore_rejects_duplicate_agent_identity ... ok +test manager::tests::restore_rejects_child_id_not_derived_from_fork_index ... ok +test manager::tests::restore_rejects_duplicate_branch_identity ... ok +test manager::tests::restore_rejects_branch_with_missing_parent ... ok +test manager::tests::restore_rejects_missing_root_branch ... ok +test manager::tests::restore_rejects_branch_of_absent_agent ... ok +test manager::tests::restore_rejects_parentless_non_root_branch ... ok +test manager::tests::restore_round_trips_branches_and_next_fork_indexes_exactly ... ok +test manager::tests::test_checkpoint_reboot_and_reconstruction ... ok +test manager::tests::re_registering_keeps_forked_branches_and_fork_indexes ... ok +test manager::tests::checkpoint_bytes_are_stable_across_restore ... ok +test manager::tests::restore_rejects_inconsistent_lineage ... ok +test manager::tests::restore_rejects_inconsistent_root_branch ... ok + +test result: ok. 22 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.03s + + Running unittests src/lib.rs (target/debug/deps/aienos_artifact-cdcd8a005937d2db) + +running 24 tests +test receipt_tests::decision_consistency_rules_are_enforced ... ok +test receipt_tests::canary_failed_decision_and_status_must_agree ... ok +test receipt_tests::layout_matches_adr_table_offsets ... ok +test receipt_tests::arbitrary_records_never_panic_the_decoder ... ok +test receipt_tests::golden_bytes_are_stable ... ok +test receipt_tests::optional_fields_require_their_presence_flags ... ok +test receipt_tests::nonce_and_verifier_identity_vectors ... ok +test receipt_tests::pi5_tier_round_trips_with_its_label ... ok +test receipt_tests::rejects_length_magic_version_and_sizes ... ok +test receipt_tests::encoding_is_deterministic_and_round_trips ... ok +test receipt_tests::rejects_unknown_enum_and_code_values ... ok +test tests::accepts_canonical_artifact_and_exposes_exact_slices ... ok +test tests::authority_attenuation_is_directly_checkable ... ok +test tests::every_truncation_of_a_valid_artifact_is_rejected ... ok +test tests::rejects_header_and_length_mutations ... ok +test tests::rejects_section_entry_capability_resource_and_reserved_mutations ... ok +test tests::signature_bytes_are_not_recursively_included_in_artifact_id ... ok +test tests::payload_manifest_and_resource_changes_change_artifact_identity ... ok +test receipt_tests::rejects_unknown_flags_and_nonzero_reserved_bytes ... ok +test tests::ed25519_verifier_accepts_rfc8032_pure_signature_vector ... ok +test receipt_tests::unsigned_untrusted_and_production_verification_fail_closed ... ok +test receipt_tests::every_single_bit_change_in_the_signed_range_changes_meaning_or_is_rejected ... ok +test tests::arbitrary_bounded_bytes_never_panic_the_parser ... ok +test receipt_tests::signature_block_is_outside_the_digest_and_fully_authenticated ... ok + +test result: ok. 24 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.12s + + Running unittests src/main.rs (target/debug/deps/aienos_artifact_tool-9e56459db5557344) + +running 2 tests +test tests::deterministic_pack_uses_the_shared_parser_and_id ... ok +test receipt_cmd::tests::check_accepts_only_receipts_that_bind_the_supplied_artifact ... ok + +test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running unittests src/lib.rs (target/debug/deps/aienos_boot-03c1d141b379e741) + +running 4 tests +test wcslen::tests::counts_units_before_first_zero ... ok +test wcslen::tests::empty_string_is_zero ... ok +test wcslen::tests::stops_at_first_zero_not_slice_end ... ok +test wcslen::tests::high_unit_values_are_not_terminators ... ok + +test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running unittests src/lib.rs (target/debug/deps/aienos_c1_tree-1784af35e1503d05) + +running 4 tests +test tree::tests::test_transactional_kv_reservation ... ok +test tree::tests::test_reconstruct_branch_no_page_leak ... ok +test tree::tests::test_concurrent_multithreaded_branching_and_reservations ... ok +test tree::tests::test_zero_memory_increase_on_10k_tokens_fork ... ok + +test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.24s + + Running unittests src/lib.rs (target/debug/deps/aienos_capability-7cada4be6dbd4ee3) + +running 13 tests +test tests::generation_exhaustion_fails_closed ... ok +test tests::forged_stale_subject_resource_and_rights_fail_closed ... ok +test tests::amplification_lease_epoch_and_revoked_ancestor_fail ... ok +test tests::ordinary_capability_cannot_administer_and_depth_stops ... ok +test tests::generation_wrap_restarts_and_cognition_cannot_mint ... ok +test tests::high_half_resource_is_kept ... ok +test tests::privileged_rights_cannot_be_delegated_and_office_stays ... ok +test tests::promote_right_cannot_be_delegated ... ok +test tests::reclaimed_reference_stays_dead_after_restart ... ok +test tests::recycled_slot_does_not_honour_old_reference ... ok +test tests::unauthorized_capability_use_is_refused ... ok +test tests::stale_reference_after_revoke_is_refused ... ok +test tests::restart_refuses_above_an_exhausted_generation ... ok + +test result: ok. 13 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running unittests src/lib.rs (target/debug/deps/aienos_capability_ffi-0df678df0840af8b) + +running 4 tests +test tests::layout_matches_the_cap32_contract ... ok +test tests::stale_and_unauthorized_use_is_refused ... ok +test tests::generation_exhaustion_fails_closed ... ok +test tests::reclaimed_reference_stays_dead_after_restart ... ok + +test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running unittests src/lib.rs (target/debug/deps/aienos_cortex-7c4af692b3926248) + +running 2 tests +test store::tests::test_epistemic_grounding_and_hallucination_rejection ... ok +test store::tests::test_cortex_persistence_and_status_queries ... ok + +test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running unittests src/lib.rs (target/debug/deps/aienos_crypto-5af790ab185ac4fb) + +running 10 tests +test aes::tests::test_aes_256_fips_197_c2 ... ok +test aes_gcm_siv::tests::public_derived_keys_are_guarded_and_redacted ... ok +test sha256::tests::test_sha256_abc ... ok +test aes::tests::test_constant_time_sbox_matches_fips197_table ... ok +test sha256::tests::test_hmac_sha256_rfc4231_case_1 ... ok +test polyval::tests::test_polyval_rfc8452_appendix_a_worked_example ... ok +test polyval::tests::test_polyval_rfc8452_section_7_dot ... ok +test sha256::tests::test_sha256_empty ... ok +test aes_gcm_siv::tests::test_rfc8452_appendix_c_aes256_16byte_pt_0byte_aad ... ok +test aes_gcm_siv::tests::test_rfc8452_appendix_c_aes256_8byte_pt_1byte_aad ... ok + +test result: ok. 10 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running unittests src/lib.rs (target/debug/deps/aienos_evidence-d8215aee6143f1b4) + +running 30 tests +test canon::tests::sealed_bundle_verifies_and_any_edit_breaks_it ... ok +test canon::tests::key_order_and_whitespace_do_not_change_the_checksum ... ok +test capture::tests::counts_heterogeneous_cpu_parts ... ok +test capture::tests::reads_os_release_and_meminfo ... ok +test http::tests::dechunks_bodies_with_extensions ... ok +test http::tests::empty_stream_is_an_error ... ok +test http::tests::parses_endpoints ... ok +test http::tests::stream_timing_uses_first_content_and_usage ... ok +test pe::tests::accepts_arm64_efi_application ... ok +test pe::tests::rejects_wrong_machine_subsystem_and_garbage ... ok +test rollback::tests::added_candidate_entry_outside_order_is_allowed ... ok +test rollback::tests::duplicated_entry_changes_sequence ... ok +test rollback::tests::empty_boot_orders_fail ... ok +test rollback::tests::empty_pre_uuid_is_not_compared ... ok +test rollback::tests::identical_return_passes ... ok +test rollback::tests::python_list_repr ... ok +test rollback::tests::missing_values_render_as_none ... ok +test rollback::tests::read_only_root_or_changed_esp_fails ... ok +test rollback::tests::reordered_or_changed_default_fails ... ok +test rollback::tests::report_lines_match_former_python_rendering ... ok +test rollback::tests::secure_boot_is_case_insensitive ... ok +test rollback::tests::secure_boot_off_is_observed_not_blocking ... ok +test rollback::tests::shape_rejects_values_the_verifier_cannot_use ... ok +test rollback::tests::secure_boot_change_is_still_a_violation ... ok +test time::tests::known_instants ... ok +test rollback::tests::unconsumed_boot_next_fails ... ok +test verify::tests::verified_recovery_closes_m0 ... ok +test verify::tests::sound_capture_passes_but_m0_stays_open_until_rollback_is_tested ... ok +test verify::tests::tampering_dirty_repos_and_toy_workloads_are_rejected ... ok +test capture::tests::streams_file_hash_matches_one_shot_hash ... ok + +test result: ok. 30 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.77s + + Running unittests src/main.rs (target/debug/deps/aienos_evidence-f8f5ed62ab570014) + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running unittests src/lib.rs (target/debug/deps/aienos_explain-79b00631214213e1) + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running unittests src/main.rs (target/debug/deps/aienos_explain-ee23a1331acf4114) + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running tests/explain.rs (target/debug/deps/explain-5a1c8cb3ca31dd39) + +running 16 tests +test cycle_terminates_and_is_reported ... ok +test clarification_reads_the_same_bundle ... ok +test contradiction_remains_visible ... ok +test malformed_input_fails_safely ... ok +test linear_chain_is_ordered_parents_first ... ok +test analogy_is_isolated_from_evidence ... ok +test branch_explanation_uses_only_what_the_branch_depended_on ... ok +test cycle_through_imported_cortex_journal_terminates ... ok +test branching_support_is_deterministic_regardless_of_input_order ... ok +test missing_parent_stays_missing ... ok +test hypothesis_is_never_rendered_as_fact ... ok +test identical_input_gives_identical_bundle_and_text ... ok +test token_history_never_enters_the_explanation ... ok +test unsupported_claim_is_flagged ... ok +test shared_parent_appears_once ... ok +test depth_and_node_limits_bound_the_walk ... ok + +test result: ok. 16 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.08s + + Running tests/rsi_and_cli.rs (target/debug/deps/rsi_and_cli-47e96ebade6cc0c5) + +running 4 tests +test contradiction_disclosed_in_both_directions ... ok +test rsi_fixture_is_pinned ... ok +test rsi_cycle_explains_in_causal_order ... ok +test cli_explains_fixture ... ok + +test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.02s + + Running unittests src/lib.rs (target/debug/deps/aienos_infer-f019ca6909bea73a) + +running 26 tests +test decode::rope_tests::every_head_is_rotated_independently_with_the_same_table ... ok +test decode::rope_tests::pair_zero_rotates_by_the_position_angle ... ok +test decode::rope_tests::score_depends_on_relative_position_only ... ok +test decode::rope_tests::softmax_weights_are_shift_invariant_and_position_sensitive ... ok +test dotprod::tests::q4k_hand_computed_scale_application ... ok +test dotprod::tests::quantize_matches_q8k_round_and_sums ... ok +test dotprod::tests::row_dot_matches_scalar_path_and_checks_lengths ... ok +test dotprod::tests::token_only_when_flag_set ... ok +test dotprod::tests::q4k_integer_dot_equals_f32_dot_of_rounded_activations ... ok +test half::tests::known_values ... ok +test math::tests::exp_matches_std ... ok +test math::tests::ln_matches_std ... ok +test math::tests::powf_rope_theta_scale ... ok +test math::tests::sin_cos_matches_std_and_unit_norm ... ok +test math::tests::sqrt_matches_std ... ok +test quant::tests::length_checks ... ok +test quant::tests::q4k_hand_block ... ok +test dotprod::tests::q6k_integer_dot_equals_f32_dot_of_rounded_activations ... ok +test quant::tests::q4k_scale_extension_bits ... ok +test quant::tests::q6k_hand_block ... ok +test quant::tests::q6k_scales_are_signed_and_per_16 ... ok +test tokenizer::tests::byte_map_is_gpt2 ... ok +test tokenizer::tests::pretokenize_cases ... ok +test tokenizer::tests::pretokenize_covers_input ... ok +test dotprod::tests::sdot_accumulations_are_bit_exact_vs_portable_q4k ... ok +test dotprod::tests::sdot_accumulations_are_bit_exact_vs_portable_q6k ... ok + +test result: ok. 26 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running tests/forward.rs (target/debug/deps/forward-ab44d1dd89820bae) + +running 5 tests +test forward_matches_llama_cpp_q8k_emulation ... ignored, slow; run with --ignored +test decode_round_trips_text ... ok +test tokenization_matches_llama_cpp ... ok +test forward_matches_llama_cpp_dotprod ... ok +test forward_matches_llama_cpp_f32_activations has been running for over 60 seconds +test forward_matches_llama_cpp_f32_activations ... ok + +test result: ok. 4 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 148.69s + + Running tests/golden.rs (target/debug/deps/golden-bd0a1a22ab6375dc) + +running 15 tests +test dequantize_rejects_bad_lengths_without_panic ... ok +test dot_helpers_match_dequant_then_dot ... ok +test absurd_counts_and_bad_fields ... ok +test q4k_matches_ggml_bit_for_bit ... ok +test q6k_matches_ggml_bit_for_bit ... ok +test q4k_round_trip_error_bound ... ok +test q6k_round_trip_error_bound ... ok +test round_trip_exact_when_grid_aligned ... ok +test small_good_file_parses ... ok +test byte_flip_fuzz_never_panics ... ok +test real_type_histogram_and_table_sanity ... ok +test real_header_matches_known_facts ... ok +test every_truncation_is_an_error_not_a_panic ... ok +test real_layer0_dequantizes_to_sane_values ... ok +test real_file_matches_hf_metadata_hash ... ok + +test result: ok. 15 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.24s + + Running unittests src/lib.rs (target/debug/deps/aienos_kernel-d868610635245090) + +running 413 tests +test abi::tests::capability_fails_closed ... ok +test abi::tests::capability_golden ... ok +test abi::tests::envelope_fails_closed ... ok +test abi::tests::handle_generation_zero_fails_closed ... ok +test abi::tests::handle_golden ... ok +test abi::tests::envelope_golden ... ok +test abi::tests::handle_raw_matches_syscall_packing ... ok +test abi::tests::handle_raw_register_encoding ... ok +test abi::tests::id_goldens ... ok +test abi::tests::memory_region_golden ... ok +test abi::tests::message_golden ... ok +test abi::tests::message_reserved_fields_fail_closed ... ok +test abi::tests::resource_id_golden ... ok +test abi::tests::resource_id_rejects_unknown_kind_and_reserved ... ok +test abi::tests::rights_convert_with_caps_rights ... ok +test abi::tests::rights_golden ... ok +test abi::tests::rights_reserved_bits_fail_closed ... ok +test abi::tests::tags_are_distinct_and_round_trip ... ok +test acpi::tests::extracts_gicd_and_gicr_bases ... ok +test acpi::tests::counts_gb10_style_heterogeneous_cores_by_efficiency_class ... ok +test acpi::tests::finds_the_boot_core_class_ignoring_mpidr_flag_bits ... ok +test acpi::tests::mcfg_finds_the_ecam_window_for_a_segment_and_bus ... ok +test acpi::tests::reads_xsdt_entry_addresses ... ok +test acpi::tests::parses_iort_smmuv3_base_and_pci_stream_mapping ... ok +test acpi::tests::spcr_selects_the_early_uart_driver ... ok +test acpi::tests::rejects_bad_checksum_signature_and_lengths ... ok +test acpi::tests::skips_disabled_cores_and_counts_old_entries_as_unknown ... ok +test admission::tests::insufficient_resource_snapshot_rejects_before_authorization ... ok +test admission::tests::policy_digest_is_canonical_and_binds_signer_allowlist ... ok +test admission::tests::verified_but_policy_untrusted_signer_is_rejected ... ok +test admission::tests::policy_reduces_object_range_and_operation_byte_budgets ... ok +test admission::tests::read_is_granted_and_uses_the_existing_m3_rights_type ... ok +test admission::tests::read_write_request_is_reduced_to_policy_read ... ok +test admission::tests::unapproved_write_receives_no_capability ... ok +test artifact_loader::tests::boot_policy_digest_is_the_policy_the_loader_uses ... ok +test arch::aarch64::tests::spark_uart_uses_32_bit_16550_register_stride ... ok +test artifact_loader::tests::candidate_lines_are_stable ... ok +test artifact_loader::tests::code_write_needs_a_permission_fault ... ok +test artifact_loader::tests::exec_nx_needs_a_permission_fault_inside_data_or_stack ... ok +test artifact_loader::tests::audit_rejects_writable_code_and_writable_alias ... ok +test artifact_loader::tests::stage_and_reason_codes_match_adr_0014_section_7_3 ... ok +test artifact_loader::tests::staging_reservation_failure ... ok +test artifact_loader::tests::full_scheduler_fails_closed_at_admission ... ok +test artifact_loader::tests::kernel_root_without_free_window_is_a_mapping_failure ... ok +test artifact_loader::tests::grant_lines_list_exactly_the_installed_grants ... ok +test artifact_loader::tests::code_modified_during_execution_breaks_the_byte_chain ... ok +test artifact_loader::tests::task_layout_rejects_every_bound_violation ... ok +test block::tests::ram_disk_rejects_block_size_that_would_truncate ... ok +test artifact_loader::tests::receipt_line_carries_digest_and_full_record ... ok +test artifact_loader::tests::tampered_payload_is_rejected_before_any_task_frame ... ok +test artifact_loader::tests::admitted_task_sees_exact_entry_state_and_is_fully_reclaimed ... ok +test artifact_loader::tests::ipc_request_exceeds_policy_and_is_rejected ... ok +test boot::tests::boot_counter_conversion_rejects_invalid_samples ... ok +test artifact_loader::tests::scheduler_refusal_at_reservation_rolls_back ... ok +test boot::tests::firmware_region_requires_aligned_nonoverflowing_pages ... ok +test artifact_loader::tests::admitted_receipt_binds_identity_and_observed_outcome ... ok +test boot::tests::early_allocator_retains_region_after_initialization ... ok +test artifact_loader::tests::receipt_flags_follow_observations_not_expectations ... ok +test artifact_loader::tests::empty_and_oversized_inputs_are_refused_before_staging ... ok +test budget::tests::arithmetic_is_overflow_safe_at_u64_limits ... ok +test artifact_loader::tests::unknown_signer_rejected_by_anchors_and_by_policy ... ok +test boot::tests::report_lists_gpu_allocator_timing_and_liveness ... ok +test budget::tests::each_resource_limit_is_enforced_independently ... ok +test budget::tests::releasing_frames_restores_headroom ... ok +test budget::tests::watchdog_pet_expiry_and_sticky_quarantine ... ok +test caps::tests::generation_exhaustion_retires_slot_without_reviving_old_handle ... ok +test caps::tests::removing_a_never_derived_capability_frees_its_slot ... ok +test budget::tests::watchdog_is_correct_across_counter_wrap ... ok +test caps::tests::derive_cannot_add_rights ... ok +test budget::tests::explicit_policy_switch_changes_forge_allowance ... ok +test caps::tests::revoke_with_single_slot_tables_removes_cross_table_child ... ok +test caps::tests::transfer_needs_grant_and_table_full_is_reported ... ok +test caps::tests::removing_a_derived_parent_keeps_the_subtree_revocable ... ok +test caps::tests::stale_handle_rejected_after_slot_reuse ... ok +test console::tests::unsupported_spcr_gives_no_console ... ok +test artifact_loader::tests::rejection_receipts_record_earliest_stage_and_only_computed_fields ... ok +test continuity::tests::encodings_round_trip_and_reject_tampering ... ok +test caps::tests::revoke_cascades_two_levels_across_tables ... ok +test continuity::continuity_vectors::emitted_vectors_are_canonical ... ok +test continuity::tests::branch_table_validation_rejects_broken_lineage ... ok +test artifact_loader::tests::grants_never_exceed_requests_or_policy ... ok +test artifact_loader::tests::main_and_shadow_batch_failures_roll_back ... ok +test artifact_loader::tests::sequential_candidates_reuse_resources_cleanly ... ok +test continuity::tests::wrapping_fork_sum_is_refused_like_the_c_codec ... ok +test continuity::tests::unprovisioned_store_never_mints_an_identity ... ok +test crypto::envelope::tests::test_envelope_cross_store_and_kind_binding ... ok +test crypto::envelope::tests::test_expected_envelope_len_overflow_is_error ... ok +test crypto::envelope::tests::test_envelope_roundtrip_small ... ok +test crypto::envelope::tests::test_hostile_header_at_bound_hits_length_check ... ok +test crypto::envelope::tests::test_hostile_header_huge_total_rejected_before_alloc ... ok +test crypto::hkdf::tests::rfc5869_cases_1_to_3 ... ok +test crypto::hmac::tests::compare_tags ... ok +test crypto::hmac::tests::rfc4231_cases_1_to_7 ... ok +test crypto::envelope::tests::test_envelope_roundtrip_empty ... ok +test continuity::tests::provisioning_twice_is_refused ... ok +test continuity::tests::huge_fork_count_with_underivable_child_is_refused_without_spinning ... ok +test continuity::tests::two_roots_stop_with_conflict ... ok +test device::tests::activate_installs_translation_before_bus_master ... ok +test device::tests::activate_with_revoked_handle_fails_without_effects ... ok +test crypto::envelope::tests::test_hostile_header_chunk_size_one_huge_count_rejected ... ok +test device::tests::attenuated_capability_without_map_cannot_activate ... ok +test device::tests::duplicate_or_missing_table_in_revoke_set_causes_no_effects ... ok +test device::tests::capability_for_other_resource_is_not_a_device ... ok +test device::tests::activation_refused_without_window_or_when_already_active ... ok +test console::tests::pl011_writes_when_ready_and_gives_up_when_always_full ... ok +test continuity::tests::forked_or_gapped_manifest_chains_are_corrupt ... ok +test crypto::hkdf::tests::length_limit_and_compare ... ok +test device::tests::activation_failure_at_each_step_leaves_bus_master_clear_and_stream_aborted ... ok +test device::tests::activation_records_its_authority ... ok +test continuity::tests::provision_then_cold_restart_returns_the_same_identity_and_memory ... ok +test device::tests::failed_teardown_blocks_activation_until_a_clean_retry ... ok +test device::tests::missing_capability_causes_no_effects ... ok +test device::tests::map_without_revoke_cannot_tear_down_an_active_device ... ok +test artifact_loader::tests::corrupted_mapped_bytes_fail_the_read_back_hash ... ok +test device::tests::window_validation ... ok +test display::font::tests::digits_and_letters_are_distinct ... ok +test display::font::tests::every_glyph_is_five_by_seven_hashes_and_spaces ... ok +test display::font::tests::lowercase_maps_to_uppercase_and_unknown_to_question_mark ... ok +test device::tests::sweep_leaves_devices_with_live_authority_alone ... ok +test device::tests::state_discriminants_are_stable ... ok +test device::tests::sweep_tears_down_after_holder_removes_or_table_is_gone ... ok +test device::tests::sweep_retries_a_failed_teardown ... ok +test device::tests::revoke_runs_exact_teardown_then_removes_capability_tree ... ok +test display::tests::rejects_geometry_larger_than_the_buffer ... ok +test continuity::tests::degraded_mount_resumes_read_only ... ok +test device::tests::read_only_capability_causes_no_effects ... ok +test device::tests::sweep_tears_down_when_ancestor_revoked_through_plain_cap_path ... ok +test device::tests::register_rejects_clashes_and_live_devices ... ok +test device::tests::revoke_failure_at_each_step_still_closes_gates_and_revokes ... ok +test display::tests::scales_up_on_wide_screens_and_drops_text_past_the_last_row ... ok +test device::tests::revoke_forgets_window_so_next_holder_cannot_reuse_it ... ok +test dma_gate::tests::failed_smmu_never_falls_back_to_bypass ... ok +test dma_gate::tests::sweep_clears_endpoints_and_leaves_bridges ... ok +test dma_gate::tests::sweep_walks_multifunction_devices_only_when_marked ... ok +test edu::tests::blocked_transfer_completes_but_leaves_ram_untouched ... ok +test dma_gate::tests::sweep_reports_a_bus_master_bit_that_will_not_clear ... ok +test edu::tests::full_buffer_transfer_is_allowed ... ok +test edu::tests::last_byte_below_the_mask_is_accepted ... ok +test edu::tests::probe_reads_version_and_checks_liveness ... ok +test dma_gate::tests::grant_requires_smmu_or_explicit_bypass_without_smmu ... ok +test dma_gate::tests::sweep_keeps_counting_past_the_recorded_findings ... ok +test display::tests::draws_glyph_pixels_and_respects_stride_padding ... ok +test edu::tests::rejects_bad_lengths_and_addresses_before_touching_the_device ... ok +test edu::tests::interrupt_status_and_acknowledge ... ok +test edu::tests::times_out_when_the_transfer_never_finishes ... ok +test edu::tests::spin_budget_covers_a_slow_transfer ... ok +test edu::tests::wider_dma_mask_accepts_higher_addresses ... ok +test gic::tests::distributor_spi_programming_order ... ok +test fatal::tests::access_syndrome_only_when_isv_set ... ok +test fatal::tests::decodes_abort_iss_fields_without_register_access ... ok +test fatal::tests::decodes_vector_slot_and_exception_class ... ok +test arch::aarch64::tests::a_uart_that_never_becomes_ready_is_abandoned_instead_of_hanging ... ok +test edu::tests::round_trips_bytes_through_the_device_buffer ... ok +test dma_gate::tests::command_bits ... ok +test gic::tests::redistributor_wakes_and_sets_ppi ... ok +test gic::tests::register_offsets_match_gicv3_spec ... ok +test infer::attention::tests::dense_output_projection_mixes_heads_and_catches_a_permutation ... ok +test infer::gemm::tests::benchmark_matvec_4096 ... ignored, benchmark +test infer::attention::tests::one_token_returns_value_exactly ... ok +test infer::rope::tests::position_zero_is_identity ... ok +test infer::gemm::tests::strided_vector_matches_reference ... ok +test infer::attention::tests::append_rejects_capacity_overflow ... ok +test infer::attention::tests::decode_refuses_wrong_shapes_and_head_counts ... ok +test infer::attention::tests::query_rows_kv_groups_and_head_major_output_decode_from_bands ... ok +test infer::attention::tests::random_inputs_match_scalar_reference ... ok +test infer::attention::tests::two_head_hand_computed_attention ... ok +test infer::gemm::tests::rms_norm_hand_value ... ok +test infer::rope::tests::sin_cos_matches_std_across_the_circle ... ok +test infer::gemm::tests::softmax_sums_to_one ... ok +test infer::tokenizer::tests::matches_special_tokens_before_bpe ... ok +test infer::attention::tests::gqa_maps_groups_of_query_heads_to_kv_heads ... ok +test infer::rope::tests::rotation_preserves_each_pair_norm ... ok +test ipc::tests::end_to_end_send_delegate_receive_read ... ok +test ipc::tests::channel_is_fifo_and_bounded ... ok +test infer::tokenizer::tests::applies_lowest_ranked_merge_first ... ok +test ipc::tests::message_abi_is_fixed_size_and_unaligned_free ... ok +test ipc::tests::receiver_table_full_rolls_back_cleanly ... ok +test ipc::tests::attenuated_child_cannot_write_or_escalate ... ok +test infer::tokenizer::tests::reports_missing_byte_and_bad_format ... ok +test mem::frame_allocator::tests::allocator_rejects_unaligned_deallocation ... ok +test mem::frame_allocator::tests::insufficient_batch_reservation_leaves_no_partial_allocations ... ok +test infer::tokenizer::tests::round_trips_ascii_utf8_empty_and_fallback ... ok +test ipc::tests::rights_escalation_is_rejected ... ok +test ipc::tests::send_requires_write_and_receive_requires_read ... ok +test ipc::tests::stale_and_forged_handles_are_invalid ... ok +test mem::frame_allocator::tests::batch_reservation_is_bounded_and_released_as_a_unit ... ok +test mem::frame_allocator::tests::allocator_rejects_capacity_overflow - should panic ... ok +test ipc::tests::ancestor_revocation_reaches_the_derived_child ... ok +test ipc::tests::delegation_without_derive_right_is_denied ... ok +test mem::frame_allocator::tests::test_alloc_contiguous ... ok +test mem::frame_allocator::tests::test_allocator_basic ... ok +test mem::map_plan::tests::section_permissions_are_wx_safe ... ok +test mem::pagetable::tests::fixed_pool_is_bounded_and_never_reuses_released_frames ... ok +test mem::pagetable::tests::descriptor_encodes_attributes_exactly ... ok +test mem::pagetable::tests::device_memory_is_never_executable ... ok +test mem::map_plan::tests::writable_executable_runtime_code_is_mapped_rx ... ok +test mem::map_plan::tests::missing_mat_maps_runtime_code_rx_without_wx ... ok +test mem::pagetable::tests::flags_round_trip_through_descriptors ... ok +test mem::map_plan::tests::mmio_is_device_nx_and_overlap_rejected ... ok +test mem::map_plan::tests::register_values_encode_required_fields ... ok +test mem::map_plan::tests::runtime_code_needs_ro_xp_split ... ok +test mem::pagetable::tests::access_permission_and_attribute_bits ... ok +test mem::pagetable::tests::execute_never_bits_follow_privilege ... ok +test mem::map_plan::tests::translation_register_values_match_the_architecture ... ok +test mem::pagetable::tests::chooses_block_and_page_leaves ... ok +test mem::pagetable::tests::maps_and_walks_page ... ok +test net::tests::rejects_short_bad_and_fragments ... ok +test net::tests::udp_known_checksum ... ok +test nvme::atomicity::tests::boundary_safe_write_accepts ... ok +test net::tests::ipv4_icmp_ping_vector ... ok +test net::tests::ethernet_and_arp_vector ... ok +test nvme::atomicity::tests::boundary_offset_is_respected ... ok +test net::tests::ipv4_reserved_flag_is_rejected ... ok +test net::tests::cache_requires_solicited_and_expires ... ok +test net::tests::checksum_vectors ... ok +test nvme::atomicity::tests::namespace_override_wins_over_controller ... ok +test nvme::atomicity::tests::controller_fallback_when_namespace_absent ... ok +test nvme::atomicity::tests::namespace_zero_falls_back_to_controller ... ok +test nvme::atomicity::tests::encoding_edge_zero_and_max ... ok +test nvme::atomicity::tests::read_u16_le_bounds ... ok +test artifact_loader::tests::sealed_address_space_is_wx_with_read_only_code_alias ... ok +test mem::pagetable::tests::rejects_overlap_wx_and_misalignment ... ok +test nvme::atomicity::tests::empty_write_rejects ... ok +test nvme::atomicity::tests::store_root_512_geometry ... ok +test mem::pagetable::tests::unmap_removes_leaf ... ok +test nvme::atomicity::tests::sufficient_unit_but_crosses_boundary_rejects ... ok +test nvme::atomicity::tests::store_root_4096_geometry ... ok +test nvme::atomicity::tests::insufficient_controller_awupf_rejects ... ok +test nvme::atomicity::tests::sufficient_decoded_awupf_accepts ... ok +test nvme::atomicity::tests::unknown_state_fails_closed ... ok +test nvme::atomicity::tests::unsupported_geometry_fails_closed ... ok +test nvme::driver::tests::controller_requiring_larger_pages_is_refused ... ok +test nvme::driver::tests::simulator_rejects_submission_queue_without_completion_queue ... ok +test nvme::driver::tests::io_queue_depth_above_mqes_is_rejected ... ok +test nvme::tests::command_layouts ... ok +test nvme::tests::completion_phase_wrap_and_empty ... ok +test nvme::driver::tests::readiness_wait_honours_cap_timeout ... ok +test nvme::driver::tests::readiness_and_completion_errors_are_bounded ... ok +test nvme::driver::tests::creates_polled_io_queues ... ok +test nvme::driver::tests::block_io_roundtrips_small_and_prp_list_transfers_with_mdts_chunks ... ok +test nvme::driver::tests::lbads_below_512_is_invalid_identify ... ok +test pci::tests::finds_device_by_vendor_and_device_id ... ok +test pci::tests::probes_bar_sizes_and_restores_state ... ok +test pci::tests::read_bar_respects_header_type_and_slots ... ok +test pci::tests::functions_in_uses_the_window_bus_range ... ok +test pci::tests::requester_id_packs_bus_device_function ... ok +test pci::tests::update_command_sets_and_clears_bits_without_touching_status ... ok +test pci::tests::walk_covers_last_bus_and_device_without_overflow ... ok +test pe::tests::rejects_truncation_and_invalid_headers ... ok +test pci::tests::walk_skips_functions_1_to_7_unless_multi_function ... ok +test pe::tests::rejects_wx_and_overlapping_ranges ... ok +test pe::tests::unaligned_sections_are_page_rounded_and_shared_pages_overlap ... ok +test nvme::driver::tests::explicit_namespace_write_surfaces_device_error ... ok +test pe::tests::valid_sections_use_base_and_page_rounded_max_size ... ok +test recovery::tests::hmac_primitive_rfc4231_case_2 ... ok +test recovery::tests::operator_auth_known_answer_accepted ... ok +test nvme::driver::tests::initializes_and_identifies_namespace ... ok +test nvme::tests::controller_ready_failure_and_timeout ... ok +test nvme::tests::prp_list_chains_across_list_pages ... ok +test recovery::tests::test_slot_rollback_on_failure ... ok +test nvme::tests::submission_full_and_wrap ... ok +test recovery::tests::operator_auth_rejects_undomained_hmac_and_zero_response ... ok +test pci::tests::decodes_32_and_64_bit_memory_bars_and_io_bars ... ok +test nvme::driver::tests::parses_power_fail_atomicity_fields ... ok +test recovery::tests::test_wal_zero_length_entry_and_overflow_protection ... ok +test nvme::tests::prp_spans ... ok +test nvme::driver::tests::invalid_range_has_no_io_command_and_write_completion_error_propagates ... ok +test nvme::tests::registers_and_doorbells ... ok +test nvme::driver::tests::shallow_io_queue_is_rejected_before_submission ... ok +test recovery::tests::operator_auth_rejects_legacy_bare_sha256_response ... ok +test continuity::tests::a_crash_at_every_write_of_a_commit_leaves_old_or_new_never_a_third_state ... ok +test recovery::tests::test_wal_truncation_on_corruption ... ok +test scheduler::tests::background_runs_within_configured_interval_under_latency_load ... ok +test scheduler::tests::idle_cpu_steals_and_runs_work ... ok +test scheduler::tests::latency_keeps_large_majority_of_ticks_with_background_budget ... ok +test scheduler::tests::placement_uses_fast_cores_for_latency_and_efficient_for_background ... ok +test scheduler::tests::removed_tasks_free_their_slot_and_leave_the_queue ... ok +test scheduler::tests::round_robin_placement_and_duplicate_rejection ... ok +test security::tests::test_anti_rollback_decision_matrix ... ok +test scheduler::tests::empty_queues_and_invalid_cpu_are_handled ... ok +test scheduler::tests::equal_priority_tasks_share_n_ticks_fairly ... ok +test report::tests::formats_and_truncates_on_character_boundaries ... ok +test scheduler::tests::priority_prevents_basic_inversion ... ok +test security::tests::test_security_manifest_roundtrip_and_mac ... ok +test recovery_core::tests::malformed_peer_without_a_resolvable_identity_is_not_repaired ... ok +test shell::tests::parses_commands_and_bounded_arguments ... ok +test security::tests::test_subkey_derivation_separation ... ok +test security::tests::test_keyslot_manifest_roundtrip_and_unwrap ... ok +test smmu::tests::bring_up_keeps_global_abort_through_smmuen ... ok +test shell::tests::dispatches_report_and_diagnostics ... ok +test smmu::tests::event_reader_acknowledges_overflow ... ok +test smmu::tests::bring_up_cleans_tables_after_writing_before_programming ... ok +test smmu::tests::command_queue_wraps_and_times_out ... ok +test smmu::tests::gbpa_that_will_not_abort_is_an_error ... ok +test smmu::tests::descriptor_layouts ... ok +test smmu::tests::command_timeout_and_error_fail_closed ... ok +test smmu::tests::gbpa_update_timeout_fails_closed ... ok +test smmu::tests::event_reader_decodes_and_consumes_records ... ok +test recovery_core::tests::orphaned_continuity_objects_are_corrupt_not_unprovisioned ... ok +test smmu::tests::smmuen_ack_failure_fails_closed ... ok +test smmu::tests::command_words_and_queue_wrap ... ok +test smmu::tests::tables_reject_misaligned_or_bad_geometry ... ok +test smmu::tests::install_and_abort_ste_invalidate_that_stream ... ok +test smmu::tests::unsupported_hardware_or_bad_sid_fails_closed ... ok +test smmu::tests::policy_maps_only_allowed_windows ... ok +test recovery_core::tests::identity_lost_in_the_newest_root_never_looks_unprovisioned ... ok +test recovery::tests::operator_auth_rejects_any_single_bit_flip ... ok +test smmu::tests::submit_refuses_to_overwrite_a_full_queue ... ok +test store::engine::tests::store_generation_overflow_zero_writes ... ok +test recovery_core::tests::challenges_bind_state_and_action ... ok +test store::engine::tests::store_checkpoint_order_does_not_change_persistent_bytes ... ok +test store::engine::tests::store_mount_classification_is_deterministic ... ok +test store::engine::tests::store_full_graph_validation_rejects_damaged_payload_and_keeps_io_distinct ... ok +test store::engine::tests::store_nospace_zero_writes ... ok +test store::engine::tests::store_open_side_effect_free ... ok +test store::engine::tests::store_history_rejects_deleting_an_old_catalog_entry ... ok +test store::engine::tests::store_io_fail_closed ... ok +test store::tests::block_store_rejects_corrupt_in_memory_length_without_panicking ... ok +test store::tests::block_store_persists_reopens_and_falls_back_from_bad_copy ... ok +test store::tests::test_slice_store_operations_and_boundaries ... ok +test store::tests::block_store_rejects_wrong_magic ... ok +test recovery_core::tests::provisioning_is_operator_only_and_only_on_an_unprovisioned_store ... ok +test store::tests::test_content_addressed_extent_storage ... ok +test store::v1::tests::malformed_object_catalog_and_extent_vectors_are_rejected ... ok +test store::engine::tests::store_peer_condition_reports_open_classification ... ok +test store::v1::tests::object_id_and_catalog_vectors_match_adr_0015 ... ok +test sync::spinlock::tests::test_spinlock_try_lock ... ok +test sync::spinlock::tests::test_spinlock_basic ... ok +test recovery_core::tests::inspection_never_writes_and_names_the_reason ... ok +test task_runtime::tests::granted_read_returns_object_word_and_charges_budget ... ok +test task_runtime::tests::non_object_or_other_object_grant_is_denied ... ok +test store::v1::tests::malformed_generation_high_water_and_superblock_bytes_are_rejected ... ok +test task_runtime::tests::denials_are_classified_from_observed_lookups ... ok +test task_runtime::tests::forged_stale_and_unbacked_handles_are_denied ... ok +test task_runtime::tests::read_outside_grant_range_or_object_or_unaligned_is_denied ... ok +test task_runtime::tests::read_past_byte_budget_is_denied ... ok +test task_runtime::tests::read_past_operation_budget_is_denied ... ok +test task_runtime::tests::syscall_after_deadline_times_out ... ok +test task_runtime::tests::syscall_budget_overrun_terminates ... ok +test task_runtime::tests::unknown_syscall_and_nonzero_immediate_terminate ... ok +test task_runtime::tests::write_with_write_right_updates_kernel_copy ... ok +test task_runtime::tests::write_without_write_right_is_denied_and_object_unchanged ... ok +test thread::tests::context_offsets_match_assembly_layout ... ok +test thread::tests::placement_fills_lowest_class_first_then_wraps ... ok +test thread::tests::placement_of_empty_topology_is_unplaced ... ok +test thread::tests::stack_setup_aligns_sp_and_records_trampoline_arguments ... ok +test thread::tests::trap_frame_layout_matches_800_bytes_and_16_byte_alignment ... ok +test thread::tests::trap_frame_setup_aligns_and_initializes_registers ... ok +test timer::tests::conversion_rounding_and_frequency_validation ... ok +test timer::tests::deadline_detects_overflow ... ok +test uefi::tests::honors_48_and_56_byte_descriptor_strides ... ok +test uefi::tests::rejects_truncated_and_short_descriptors ... ok +test usb::audio::tests::fractional_44100_packet_pattern_totals_one_second ... ok +test usb::audio::tests::isoch_schedule_stays_ahead_and_wraps_frame_id ... ok +test usb::audio::tests::oversized_packet_is_not_truncated_and_zero_stride_schedules_nothing ... ok +test usb::audio::tests::parses_uac1_and_uac2 ... ok +test task_runtime::tests::deadline_uses_tighter_budget_and_survives_counter_wrap ... ok +test usb::audio::tests::ring_wraps_and_tone_is_bounded ... ok +test usb::audio::tests::uac1_channels_come_from_format_type_not_as_general_delay ... ok +test usb::descriptor::tests::finds_the_keyboard_interrupt_in_endpoint ... ok +test usb::descriptor::tests::reads_the_control_packet_size_from_a_device_descriptor ... ok +test usb::descriptor::tests::skips_a_mouse_interface_and_out_endpoints_in_a_composite_device ... ok +test usb::descriptor::tests::stops_at_total_length_and_malformed_descriptors ... ok +test usb::hid::tests::control_keys_and_arrows ... ok +test usb::hid::tests::letter_make_and_release_produces_one_character ... ok +test usb::hid::tests::punctuation_and_space_decode ... ok +test usb::hid::tests::rollover_error_and_wrong_length_are_ignored ... ok +test usb::hid::tests::shift_and_digits_use_the_shifted_column ... ok +test usb::hid::tests::sink_truncates_instead_of_overflowing ... ok +test usb::hid::tests::unmapped_usages_are_dropped ... ok +test usb::xhci::context::tests::endpoint_addresses_map_to_device_context_indexes ... ok +test usb::xhci::context::tests::isoch_interval_and_high_bandwidth_burst ... ok +test store::engine::tests::store_transaction_commit_dedup_and_tail_reuse ... ok +test usb::xhci::context::tests::interval_converts_frames_and_exponents_to_125us_units ... ok +test store::engine::tests::store_malformed_peer_recovery_matrix ... ok +test usb::xhci::ring::tests::dequeue_pointer_carries_the_cycle_state_and_flips_after_the_link ... ok +test usb::xhci::context::tests::address_device_context_puts_port_and_endpoint_zero_in_place ... ok +test usb::xhci::tests::capabilities_decode_qemu_xhci_registers ... ok +test store::v1::tests::commit_superblock_genesis_and_adjacent_vectors_match_adr_0015 ... ok +test usb::xhci::context::tests::isochronous_out_endpoint_fields_encode_in_context ... ok +test usb::xhci::context::tests::large_contexts_double_the_stride_and_bad_sizes_are_refused ... ok +test usb::audio::tests::stereo_44100_scheduler_emits_one_second_of_pcm_bytes ... ok +test usb::xhci::ring::tests::controller_sees_every_push_in_order_across_many_wraps ... ok +test usb::audio::tests::short_uac1_format_descriptor_does_not_panic ... ok +test store::engine::tests::store_dedup_corruption_and_descriptor_conflict_fail_before_writes ... ok +test usb::xhci::tests::capabilities_decode_scratchpads_large_contexts_and_reject_absent_blocks ... ok +test usb::xhci::ring::tests::event_ring_consumes_matching_cycles_and_wraps_without_a_link ... ok +test usb::xhci::tests::portsc_neutral_never_disables_the_port_or_acks_changes ... ok +test usb::xhci::tests::recognizes_xhci_class_and_memory_bars ... ok +test usb::xhci::trb::tests::command_trbs_place_slot_and_input_context ... ok +test usb::xhci::tests::rejects_other_classes_io_and_unprogrammed_bars ... ok +test usb::xhci::trb::tests::control_stages_carry_idt_transfer_type_and_directions ... ok +test usb::xhci::trb::tests::event_fields_decode_from_their_bit_positions ... ok +test recovery_core::tests::identity_loss_through_corruption_offers_no_action_that_mints ... ok +test user::tests::trap_frame_layout_matches_assembly ... ok +test virtio_net::tests::parses_modern_virtio_net_capabilities ... ok +test usb::xhci::trb::tests::normal_trb_asks_for_an_event_on_short_reports ... ok +test virtio_net::tests::rejects_loops_and_short_vendor_capabilities ... ok +test usb::xhci::trb::tests::setup_packet_bytes_match_the_usb_wire_order ... ok +test usb::xhci::trb::tests::isoch_trb_encodes_frame_id_and_batch_flags ... ok +test user::tests::capability_handle_round_trips ... ok +test user::tests::el0_mapping_attributes_are_wx_and_non_global ... ok +test usb::xhci::trb::tests::trb_is_sixteen_bytes_and_sixteen_aligned ... ok +test store::engine::tests::store_history_matrix_equivalent_and_adjacent_roots ... ok +test infer::gemm::tests::products_match_reference_odd_and_even ... ok +test recovery_core::tests::degraded_repair_needs_the_operator_and_restores_a_writable_store ... ok +test store::tests::block_store_crash_boundaries_keep_old_or_new_commit ... ok +test store::engine::tests::store_catalogfull_zero_writes ... ok +test artifact_loader::tests::largest_envelope_loads_in_one_l3_table ... ok +test crypto::envelope::tests::tampered_late_chunk_rejects_the_entire_plaintext ... ok +test crypto::envelope::tests::test_envelope_roundtrip_multi_chunk ... ok +test continuity::continuity_vectors::committed_fixtures_match_the_oracle ... ok +test continuity::tests::branch_table_at_the_maximum_legal_fork_sum_is_accepted ... ok + +test result: ok. 412 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.95s + + Running tests/nvme_completion.rs (target/debug/deps/nvme_completion-dafc6afe36974715) + +running 14 tests +test admin_command_id_mismatch_reports_invalid_identify ... ok +test admin_cq_phase_flips_when_head_wraps_at_depth_eight ... ok +test admin_status_word_decodes_exact_sc_and_sct ... ok +test completion_queue_phase_flips_at_depth_eight ... ok +test admin_timeout_is_bounded_no_infinite_loop ... ok +test completion_accessors_decode_little_endian_fields ... ok +test controller_never_ready_maps_to_controller_timeout ... ok +test controller_fatal_status_maps_to_controller_failed ... ok +test io_command_id_mismatch_reports_device_error ... ok +test io_nonzero_status_maps_to_device_error ... ok +test io_timeout_is_bounded_no_infinite_loop ... ok +test io_cq_wraparound_consumes_completions_in_order ... ok +test stale_phase_completion_is_skipped_and_matching_one_consumed ... ok +test malformed_completions_do_not_panic ... ok + +test result: ok. 14 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running tests/nvme_flush.rs (target/debug/deps/nvme_flush-592b420dc2ed9f8b) + +running 6 tests +test flush_after_write_in_same_session_uses_fresh_cid ... ok +test flush_is_not_a_silent_no_op_doorbell_and_command_reach_device ... ok +test flush_submits_opcode_zero_nsid_one_without_data_pointer ... ok +test nonzero_flush_completion_status_returns_device_error ... ok +test successful_flush_completion_returns_ok ... ok +test flush_timeout_returns_timeout_and_is_bounded ... ok + +test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running tests/nvme_identify.rs (target/debug/deps/nvme_identify-a2be85435664a0af) + +running 9 tests +test init_identifies_namespace_and_capacity_round_trips ... ok +test lbads_at_or_above_32_is_invalid_identify ... ok +test maximum_flbas_descriptor_offset_stays_in_bounds ... ok +test lbads_9_and_12_map_to_block_sizes ... ok +test mdts_255_shift_does_not_panic ... ok +test nonzero_flbas_selects_its_own_descriptor ... ok +test nsid_zero_identify_does_not_panic ... ok +test zero_block_count_is_invalid_identify ... ok +test mdts_byte_77_controls_transfer_chunking ... ok + +test result: ok. 9 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running tests/nvme_prp.rs (target/debug/deps/nvme_prp-dd973e4fd7815701) + +running 14 tests +test invalid_non_power_of_two_page_size ... ok +test invalid_zero_length_and_page_size ... ok +test list_buffer_too_small_is_bounded ... ok +test list_page_chaining_4k_exact_used ... ok +test max_address_short_length_is_invalid_without_panic ... ok +test multi_page_requires_aligned_nonzero_list ... ok +test offset_plus_length_overflow_is_invalid ... ok +test one_page_boundary_crossing ... ok +test page_boundaries_64k ... ok +test prp_values_are_full_physical_addresses ... ok +test single_page_aligned_and_unaligned ... ok +test transfer_limit_arithmetic_is_bounded ... ok +test list_page_chaining_64k_exact_used ... ok +test two_pages_use_prp2_with_zero_used ... ok + +test result: ok. 14 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running tests/nvme_write.rs (target/debug/deps/nvme_write-244f9e3fbc2a458c) + +running 9 tests +test empty_and_non_block_multiple_buffers_are_invalid_input ... ok +test nonzero_write_completion_maps_to_device_error ... ok +test each_io_command_gets_a_new_cid_and_completion_is_consumed ... ok +test offset_write_splits_lba_across_cdw10_and_cdw11 ... ok +test write_one_block_encodes_opcode_nsid_lba_nlb_and_prp1 ... ok +test write_past_block_count_is_out_of_range_without_io_submission ... ok +test write_eight_blocks_is_one_command_with_nlb_seven ... ok +test written_bytes_read_back_exactly ... ok +test mdts_chunking_submits_per_chunk_commands_with_correct_lba_and_nlb ... ok + +test result: ok. 9 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running tests/nvme_write_completion.rs (target/debug/deps/nvme_write_completion-05ceb97712eccfdb) + +running 8 tests +test failed_flush_completion_maps_to_device_error ... ok +test failed_write_completion_maps_to_device_error ... ok +test invalid_namespace_identify_surfaces_completion_status ... ok +test write_batch_cq_wraparound_flips_phase_and_consumes_in_order ... ok +test flush_timeout_is_bounded_no_infinite_loop ... ok +test write_command_id_mismatch_maps_to_device_error ... ok +test wrong_phase_zero_completion_is_ignored_not_consumed ... ok +test write_timeout_is_bounded_no_infinite_loop ... ok + +test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running tests/nvme_write_prp.rs (target/debug/deps/nvme_write_prp-49d57198a86480f2) + +running 14 tests +test address_near_u64_max_is_invalid_without_panic_or_wrap ... ok +test list_address_zero_or_unaligned_is_invalid_for_list_cases ... ok +test flush_submits_opcode_zero_command ... ok +test multi_block_write_crossing_page_emits_prp2 ... ok +test one_block_aligned_write_is_single_prp1_page ... ok +test offset_plus_length_overflow_is_invalid ... ok +test unaligned_prp1_spans_pages_correctly ... ok +test write_crossing_page_boundary_uses_prp1_and_prp2 ... ok +test write_larger_than_mdts_is_split_into_commands ... ok +test write_one_aligned_block_carries_single_prp1 ... ok +test write_page_list_chains_at_4k_exact_entries ... ok +test write_past_namespace_end_is_rejected_before_any_command ... ok +test write_spanning_three_pages_uses_prp_list ... ok +test write_page_list_chains_at_64k_exact_entries ... ok + +test result: ok. 14 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running tests/store_v1_golden_vectors.rs (target/debug/deps/store_v1_golden_vectors-f6fdbcdb080f13e9) + +running 8 tests +test crc32c_check_value ... ok +test top_level_is_the_frozen_schema ... ok +test object_id ... ok +test empty_catalog ... ok +test one_entry_catalog ... ok +test equivalent_roots ... ok +test adjacent_generations ... ok +test genesis ... ok + +test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s + + Running tests/store_v1_negative.rs (target/debug/deps/store_v1_negative-7a130c126f2edc56) + +running 10 tests +test catalog_rejects_unsorted_and_duplicate_object_ids ... ok +test catalog_rejects_bad_header_counts_and_exact_lengths ... ok +test catalog_extents_reject_overlap_and_metadata_overlap ... ok +test generation_link_requires_adjacent_generation_and_exact_predecessor_ids ... ok +test catalog_rejects_entry_reserved_flags_and_invalid_lengths ... ok +test catalog_entry_bounds_reject_metadata_overflow_and_high_water_violations ... ok +test commit_record_rejects_lengths_features_generation_and_high_water ... ok +test superblock_commit_validation_binds_commit_unit_catalog_and_high_water ... ok +test object_id_rejects_semantic_mutation_wrong_identity_and_nonzero_padding ... ok +test crc32c_known_answer_and_superblock_rejects_corruption_reserved_and_slot ... ok + +test result: ok. 10 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 2.44s + + Running unittests src/main.rs (target/debug/deps/aienos_store_tool-03e09a0e1ba60bc3) + +running 2 tests +test tests::garbage_is_stable_and_not_a_superblock ... ok +test tests::tear_outcomes_detects_a_third_state ... ok + +test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running unittests src/main.rs (target/debug/deps/allen_courier-e491f6ef3b9d347e) + +running 26 tests +test code::tests::a_sentence_and_a_fenced_block_are_read ... ok +test code::tests::an_unclosed_block_runs_to_the_end_and_no_block_is_none ... ok +test code::tests::crc_is_zlibs ... ok +test code::tests::short_names_and_odd_bytes_are_made_plain ... ok +test tests::a_code_reply_becomes_pieces_and_a_closing_sentence ... ok +test tests::datagram_heads_round_trip ... ok +test plain_tests::a_cut_answer_stays_within_the_room_with_its_mark ... ok +test code::tests::long_code_is_cut_at_a_line_within_the_limits ... ok +test plain_tests::typographic_marks_become_plain_ones ... ok +test tests::a_busy_server_names_its_wait_exactly ... ok +test tests::json_strings_round_trip ... ok +test tests::the_assistant_text_is_found_in_a_chat_completion ... ok +test tests::long_answers_are_cut_at_a_sentence_end ... ok +test tests::a_sentence_end_too_early_is_not_used ... ok +test key_tests::no_key_sends_no_header_and_https_is_refused_out_loud ... ok +test tests::chunked_bodies_are_joined ... ok +test tests::a_busy_server_is_asked_again_with_growing_waits ... ok +test tests::short_answers_pass_whole_with_whitespace_folded ... ok +test tests::words_on_the_wire ... ok +test tests::what_was_already_said_in_parts_is_kept ... ok +test tests::dates_are_civil ... ok +test key_tests::claude_gets_its_own_headers_and_a_refused_key_says_so ... ok +test key_tests::a_good_key_is_sent_once_as_a_bearer_and_the_first_model_comes_back ... ok +test tests::saved_exchanges_reach_the_model_as_ordered_conversation_turns ... ok +test tests::a_job_line_carries_the_memory_fields ... ok +test code::tests::pieces_carry_length_checksum_and_escapes ... ok + +test result: ok. 26 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s + + Running unittests src/bin/allen-scene.rs (target/debug/deps/allen_scene-8a13abc9d8fd96a0) + +running 3 tests +test tests::replies_and_numbers_are_read_from_a_completion ... ok +test tests::slugs_and_waits ... ok +test tests::the_prompt_is_plain_and_names_every_kind ... ok + +test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running unittests src/lib.rs (target/debug/deps/allen_design_tokens-7ae70df9a5d45747) + +running 6 tests +test tests::broken_reference_is_an_error ... ok +test tests::c_export_is_integer_only ... ok +test tests::duplicate_token_is_an_error ... ok +test tests::reads_front_matter_and_blocks ... ok +test tests::smoothstep_bezier_is_exact ... ok +test tests::wcag_reference_values ... ok + +test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running unittests src/main.rs (target/debug/deps/allen_design_tokens-5293da3bbdc3e60d) + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running tests/exports.rs (target/debug/deps/exports-d40597b8c156ffba) + +running 3 tests +test gated_contrast_passes ... ok +test kernel_values_are_kept ... ok +test exports_are_current ... ok + +test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running unittests src/lib.rs (target/debug/deps/allen_reflex-242becdb94bf6a13) + +running 7 tests +test tower::tests::full_slot_table_dispatches_every_request_and_pass_frees_the_slot ... ok +test tower::tests::cache_key_is_sha256_of_the_domain_separated_encoding ... ok +test tower::tests::join_slot_stays_stable_after_an_earlier_run_completes ... ok +test tower::tests::decision_json_escapes_the_gate_name ... ok +test tower::tests::receipt_from_one_tier_is_not_reused_for_another_tier ... ok +test tower::tests::tower_reuses_receipt_and_deduplicates_inflight_and_routes_tiers ... ok +test tower::tests::uncacheable_gate_is_never_joined_to_another_run ... ok + +test result: ok. 7 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running tests/core.rs (target/debug/deps/core-5f698ba9fe3b9619) + +running 9 tests +test dialog_roles_and_pending_state ... ok +test memory_is_bounded ... ok +test span_rules ... ok +test one_shot_correction_flips_and_learning_can_be_off ... ok +test multistep_takes_first_request_only ... ok +test refuse_only_on_intent ... ok +test sleep_reports_planted_conflict ... ok +test always_schema_valid ... ok +test deterministic_across_builds_and_calls ... ok + +test result: ok. 9 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 5.87s + + Doc-tests aienos_accel + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests aienos_aegis + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests aienos_agent_state + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests aienos_artifact + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests aienos_boot + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests aienos_c1_tree + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests aienos_capability + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests aienos_capability_ffi + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests aienos_cortex + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests aienos_crypto + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests aienos_evidence + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests aienos_explain + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests aienos_infer + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests aienos_kernel + +running 2 tests +test crates/aienos-kernel/src/arch/aarch64.rs - arch::aarch64::MmioReg::new (line 33) - compile fail ... ok +test crates/aienos-kernel/src/arch/aarch64.rs - arch::aarch64::MmioReg::new (line 22) ... ok + +test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.28s + + Doc-tests allen_design_tokens + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests allen_reflex + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + +PASS host tests: cargo test --workspace -- --format=pretty +PASS ABI conformance: frozen wire format golden bytes and roundtrips verified + +--- [Clippy Verification: -D warnings] --- + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.09s +PASS clippy: zero warnings with -D warnings + +--- [Clippy Verification: AArch64 targets, -D warnings] --- + Compiling version_check v0.9.5 + Checking typenum v1.20.1 + Compiling semver v1.0.28 + Checking cfg-if v1.0.5 + Checking subtle v2.6.1 + Checking signature v2.2.0 + Checking cpufeatures v0.2.17 + Checking aienos-crypto v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-crypto) + Checking aienos-capability v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-capability) + Checking aienos-accel v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-accel) + Checking ed25519 v2.2.3 + Compiling rustc_version v0.4.1 + Compiling generic-array v0.14.7 + Compiling curve25519-dalek v4.1.3 + Checking block-buffer v0.10.4 + Checking crypto-common v0.1.7 + Checking digest v0.10.7 + Checking sha2 v0.10.9 + Checking ed25519-dalek v2.2.0 + Checking aienos-artifact v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-artifact) + Checking aienos-kernel v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-kernel) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 2.76s + Checking aienos-artifact v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-artifact) + Checking aienos-kernel v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-kernel) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.36s + Compiling proc-macro2 v1.0.107 + Compiling unicode-ident v1.0.26 + Compiling quote v1.0.47 + Checking bit_field v0.10.3 + Checking bitflags v2.13.2 + Checking uguid v2.2.1 + Checking log v0.4.34 + Checking cfg-if v1.0.5 + Checking ucs2 v0.3.3 + Checking uefi-raw v0.17.0 + Compiling syn v3.0.6 + Compiling ptr_meta_derive v0.3.2 + Compiling uefi-macros v0.20.0 + Checking ptr_meta v0.3.2 + Checking uefi v0.41.0 + Checking aienos-boot v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-boot) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 4.34s + Compiling generic-array v0.14.7 + Checking typenum v1.20.1 + Checking signature v2.2.0 + Checking subtle v2.6.1 + Checking cpufeatures v0.2.17 + Checking aienos-crypto v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-crypto) + Checking aienos-accel v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-accel) + Checking aienos-capability v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-capability) + Compiling curve25519-dalek v4.1.3 + Checking uefi v0.41.0 + Checking ed25519 v2.2.3 + Checking crypto-common v0.1.7 + Checking block-buffer v0.10.4 + Checking digest v0.10.7 + Checking sha2 v0.10.9 + Checking ed25519-dalek v2.2.0 + Checking aienos-artifact v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-artifact) + Checking aienos-kernel v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-kernel) + Checking aienos-boot v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-boot) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 3.40s + Checking aienos-artifact v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-artifact) + Checking aienos-kernel v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-kernel) + Checking aienos-boot v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-boot) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 2.02s + Checking aienos-boot v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-boot) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.32s + Checking aienos-boot v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-boot) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.32s + Checking aienos-boot v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-boot) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.39s + Checking aienos-boot v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-boot) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.43s + Checking aienos-boot v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-boot) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.36s + Checking aienos-boot v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-boot) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.46s +PASS clippy: aarch64-unknown-none kernel and aarch64-unknown-uefi images, zero warnings + +--- [SEED-0B qualification features: tests and clippy] --- + Compiling signature v2.2.0 + Compiling crypto-common v0.1.7 + Compiling curve25519-dalek v4.1.3 + Compiling ed25519 v2.2.3 + Compiling digest v0.10.7 + Compiling sha2 v0.10.9 + Compiling ed25519-dalek v2.2.0 + Compiling aienos-artifact v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-artifact) + Finished `test` profile [unoptimized + debuginfo] target(s) in 1.71s + Running unittests src/lib.rs (target/debug/deps/aienos_artifact-053ac0e23f858a90) + +running 26 tests +test receipt_tests::canary_failed_decision_and_status_must_agree ... ok +test receipt_tests::decision_consistency_rules_are_enforced ... ok +test receipt_tests::nonce_and_verifier_identity_vectors ... ok +test receipt_tests::golden_bytes_are_stable ... ok +test receipt_tests::arbitrary_records_never_panic_the_decoder ... ok +test receipt_tests::rejects_unknown_enum_and_code_values ... ok +test tests::payload_manifest_and_resource_changes_change_artifact_identity ... ok +test receipt_tests::optional_fields_require_their_presence_flags ... ok +test tests::every_truncation_of_a_valid_artifact_is_rejected ... ok +test receipt_tests::pi5_tier_round_trips_with_its_label ... ok +test tests::ed25519_verifier_accepts_rfc8032_pure_signature_vector ... ok +test receipt_tests::encoding_is_deterministic_and_round_trips ... ok +test receipt_tests::rejects_length_magic_version_and_sizes ... ok +test receipt_tests::layout_matches_adr_table_offsets ... ok +test receipt_tests::unsigned_untrusted_and_production_verification_fail_closed ... ok +test receipt_tests::test_receipt_anchor_is_rfc8032_test2_and_distinct_from_artifact_key ... ok +test tests::accepts_canonical_artifact_and_exposes_exact_slices ... ok +test tests::rejects_header_and_length_mutations ... ok +test tests::rejects_section_entry_capability_resource_and_reserved_mutations ... ok +test tests::qualification_anchor_authenticates_exact_artifact_identity ... ok +test tests::authority_attenuation_is_directly_checkable ... ok +test tests::signature_bytes_are_not_recursively_included_in_artifact_id ... ok +test receipt_tests::rejects_unknown_flags_and_nonzero_reserved_bytes ... ok +test receipt_tests::every_single_bit_change_in_the_signed_range_changes_meaning_or_is_rejected ... ok +test tests::arbitrary_bounded_bytes_never_panic_the_parser ... ok +test receipt_tests::signature_block_is_outside_the_digest_and_fully_authenticated ... ok + +test result: ok. 26 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.19s + + Doc-tests aienos_artifact + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Compiling serde_core v1.0.229 + Compiling serde v1.0.229 + Compiling serde_json v1.0.151 + Compiling aienos-artifact v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-artifact) + Compiling aienos-artifact-tool v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-artifact-tool) + Finished `test` profile [unoptimized + debuginfo] target(s) in 2.98s + Running unittests src/main.rs (target/debug/deps/aienos_artifact_tool-4058f819b9d7ed05) + +running 6 tests +test tests::deterministic_pack_uses_the_shared_parser_and_id ... ok +test tests::test_signer_roundtrips_through_shared_verifier ... ok +test receipt_cmd::tests::check_accepts_only_receipts_that_bind_the_supplied_artifact ... ok +test corpus::tests::baseline_is_valid_and_each_case_differs_from_it ... ok +test corpus::tests::corpus_is_deterministic_and_names_are_unique_and_sorted ... ok +test corpus::tests::verifier_stage_expectations_match_the_shared_verifier ... ok + +test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s + + Checking serde_core v1.0.229 + Checking aienos-artifact v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-artifact) + Checking serde_json v1.0.151 + Checking serde v1.0.229 + Checking aienos-artifact-tool v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-artifact-tool) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.77s +PASS SEED-0B qualification features tested and linted; release build refuses the test signing identity + +--- [Bare-Metal Target Compilation Check] --- + Checking aienos-crypto v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-crypto) + Checking aienos-capability v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-capability) + Checking aienos-accel v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-accel) + Checking aienos-artifact v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-artifact) + Checking aienos-kernel v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-kernel) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 2.09s + Compiling typenum v1.20.1 + Compiling cfg-if v1.0.5 + Compiling cpufeatures v0.2.17 + Compiling signature v2.2.0 + Compiling subtle v2.6.1 + Compiling aienos-crypto v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-crypto) + Compiling aienos-capability v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-capability) + Compiling aienos-accel v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-accel) + Compiling ed25519 v2.2.3 + Compiling generic-array v0.14.7 + Compiling crypto-common v0.1.7 + Compiling block-buffer v0.10.4 + Compiling digest v0.10.7 + Compiling sha2 v0.10.9 + Compiling curve25519-dalek v4.1.3 + Compiling ed25519-dalek v2.2.0 + Compiling aienos-artifact v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-artifact) + Compiling aienos-kernel v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-kernel) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 3.55s +PASS AArch64 build: aienos-kernel for aarch64-unknown-none + +--- [AArch64 UEFI Image Builds] --- + Compiling proc-macro2 v1.0.107 + Compiling quote v1.0.47 + Compiling uguid v2.2.1 + Compiling bitflags v2.13.2 + Compiling bit_field v0.10.3 + Compiling cfg-if v1.0.5 + Compiling log v0.4.34 + Compiling ucs2 v0.3.3 + Compiling uefi-raw v0.17.0 + Compiling syn v3.0.6 + Compiling ptr_meta_derive v0.3.2 + Compiling uefi-macros v0.20.0 + Compiling ptr_meta v0.3.2 + Compiling uefi v0.41.0 + Compiling aienos-boot v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-boot) + Finished `release` profile [optimized] target(s) in 3.80s +AArch64 PE32+ EFI application verified: target/aarch64-unknown-uefi/release/aienos-boot.efi + Compiling generic-array v0.14.7 + Compiling typenum v1.20.1 + Compiling subtle v2.6.1 + Compiling signature v2.2.0 + Compiling cpufeatures v0.2.17 + Compiling aienos-crypto v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-crypto) + Compiling aienos-capability v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-capability) + Compiling aienos-accel v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-accel) + Compiling curve25519-dalek v4.1.3 + Compiling uefi v0.41.0 + Compiling ed25519 v2.2.3 + Compiling crypto-common v0.1.7 + Compiling block-buffer v0.10.4 + Compiling digest v0.10.7 + Compiling sha2 v0.10.9 + Compiling ed25519-dalek v2.2.0 + Compiling aienos-artifact v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-artifact) + Compiling aienos-kernel v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-kernel) + Compiling aienos-boot v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-boot) + Finished `release` profile [optimized] target(s) in 4.25s +AArch64 PE32+ EFI application verified: target/aarch64-unknown-uefi/release/aienos-handoff.efi +PASS AArch64 build: aienos-boot.efi and aienos-handoff.efi PE headers verified + +--- [QEMU AArch64 UEFI Boot Verification] --- +qemu exit 0 after 8 s (commit 13d02ab4b714) +PASS pre-exit report printed +PASS image is this commit +PASS left firmware and entered the kernel +PASS kernel entered EL1h +PASS cooperative threads interleaved +PASS EL0 capability and fault isolation +PASS timer-driven preemption across runnable tasks +PASS deterministic MADT placement of preempt workers +PASS typed IPC with attenuated revocable delegation +PASS EL1 page tables and caches enabled +PASS GICv3 enabled +PASS timer IRQ delivered at least five ticks +PASS MMU switched from firmware tables (0x47fff000) to AIENOS tables (0xbc317000) +PASS GIC bases from the ACPI MADT, GICv3 architecture and ICC system registers +PASS tick statistics consistent (period 10000 us, min 10021 avg 10091 max 10337) +PASS final report on the SPCR console +PASS no panic or fault +QEMU_BOOT: PASS + +--- [P2-5 Binary Artifact Loader in QEMU] --- +PASS p25exec code.bin is exactly what probe.S assembles to +PASS p25wx code.bin is exactly what probe.S assembles to +PASS p25spin code.bin is exactly what probe.S assembles to +PASS p26seed code.bin is exactly what probe.S assembles to +qemu exit 0 after 7 s (commit 13d02ab4b714) +PASS left firmware and entered the kernel +PASS M3 cooperative threads unchanged +PASS M3 EL0 isolation proof unchanged +PASS M3 typed IPC proof unchanged +PASS firmware read all 34 artifact candidates +PASS no kernel report line was truncated +PASS final report reached the console +PASS every frame returned after all candidates (4095 free before and after) +PASS qualification build is labelled TEST ONLY +PASS receipts carry the SEED-0B-QEMU tier +PASS P26SEED (first SEED-0B capability artifact) read through its grant, WRITE and forged authority denied, exit 0, reclaimed +PASS P26SEED granted exactly its READ request (granted ⊆ requested) +PASS P26SEED holds exactly one capability +PASS P26SEED.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS P25EXEC admitted and executed its exact authenticated bytes, exit 0, caps revoked, reclaimed +PASS P25WX admitted then killed by W^X fault on its code page, reclaimed +PASS P25SPIN admitted then killed at its time budget, reclaimed +PASS P25TAMP (payload byte flipped after signing) rejected BadSignature, reclaimed +PASS P25EXEC.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS P25WX.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS P25SPIN.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS P25TAMP.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS H01-BAD-MAGIC.AIEN refused at verified (BadMagic), never ran, reclaimed +PASS H01-BAD-MAGIC.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS H02-VERSION.AIEN refused at verified (UnsupportedVersion), never ran, reclaimed +PASS H02-VERSION.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS H03-TARGET.AIEN refused at verified (WrongTarget), never ran, reclaimed +PASS H03-TARGET.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS H04-ABI.AIEN refused at verified (WrongAbi), never ran, reclaimed +PASS H04-ABI.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS H05-TRUNCATED.AIEN refused at verified (WrongLength), never ran, reclaimed +PASS H05-TRUNCATED.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS H06-TRAILING.AIEN refused at verified (WrongLength), never ran, reclaimed +PASS H06-TRAILING.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS H07-TOTAL-LENGTH.AIEN refused at verified (WrongLength), never ran, reclaimed +PASS H07-TOTAL-LENGTH.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS H08-OFFSET-OVERFLOW.AIEN refused at verified (ResourceLimit), never ran, reclaimed +PASS H08-OFFSET-OVERFLOW.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS H09-SECTION-OVERLAP.AIEN refused at verified (BadSection), never ran, reclaimed +PASS H09-SECTION-OVERLAP.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS H10-ENTRY-OUTSIDE.AIEN refused at verified (BadEntryPoint), never ran, reclaimed +PASS H10-ENTRY-OUTSIDE.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS H11-PAYLOAD-MUTATED.AIEN refused at verified (BadSignature), never ran, reclaimed +PASS H11-PAYLOAD-MUTATED.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS H12-CAPS-MUTATED.AIEN refused at verified (BadSignature), never ran, reclaimed +PASS H12-CAPS-MUTATED.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS H13-ENVELOPE-MUTATED.AIEN refused at verified (BadSignature), never ran, reclaimed +PASS H13-ENVELOPE-MUTATED.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS H14-SIGNATURE-MUTATED.AIEN refused at verified (BadSignature), never ran, reclaimed +PASS H14-SIGNATURE-MUTATED.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS H15-UNKNOWN-SIGNER.AIEN refused at verified (UntrustedSigner), never ran, reclaimed +PASS H15-UNKNOWN-SIGNER.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS H16-SIG-FORMAT.AIEN refused at verified (BadSignatureFormat), never ran, reclaimed +PASS H16-SIG-FORMAT.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS H17-RESERVED-HEADER.AIEN refused at verified (ReservedNonZero), never ran, reclaimed +PASS H17-RESERVED-HEADER.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS H18-RIGHTS-UNKNOWN.AIEN refused at verified (MalformedCapability), never ran, reclaimed +PASS H18-RIGHTS-UNKNOWN.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS H19-CAP-COUNT.AIEN refused at verified (ResourceLimit), never ran, reclaimed +PASS H19-CAP-COUNT.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS H20-ENVELOPE-LIMIT.AIEN refused at verified (ResourceLimit), never ran, reclaimed +PASS H20-ENVELOPE-LIMIT.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS H21-LARGEST-ENVELOPE.AIEN admitted and contained (exited:0x0), reclaimed +PASS H21-LARGEST-ENVELOPE.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS H22-WX-SECTION.AIEN refused at verified (BadSection), never ran, reclaimed +PASS H22-WX-SECTION.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS H23-EXEC-DATA.AIEN admitted and contained (fault:exec-nx), reclaimed +PASS H23-EXEC-DATA.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS H24-EXEC-STACK.AIEN admitted and contained (fault:exec-nx), reclaimed +PASS H24-EXEC-STACK.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS H25-BAD-SYSCALL.AIEN admitted and contained (bad-syscall:99), reclaimed +PASS H25-BAD-SYSCALL.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS H26-SYSCALL-BUDGET.AIEN admitted and contained (resource-overrun), reclaimed +PASS H26-SYSCALL-BUDGET.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS H27-POLICY-IPC.AIEN refused at authorized (ResourceLimit), never ran, reclaimed +PASS H27-POLICY-IPC.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS H28-WRITE-ONLY-REQUEST.AIEN admitted and contained (exited:0x0), reclaimed +PASS H28-WRITE-ONLY-REQUEST.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS H29-READ-WRITE-REQUEST.AIEN admitted and contained (exited:0x0), reclaimed +PASS H29-READ-WRITE-REQUEST.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS H29 requested READ|WRITE and was granted READ only +PASS H28 requested only WRITE and received no capability +PASS final report summarises every admission decision +qemu exit 0 after 7 s (commit 13d02ab4b714) +PASS left firmware and entered the kernel +PASS M3 cooperative threads unchanged +PASS M3 EL0 isolation proof unchanged +PASS M3 typed IPC proof unchanged +PASS firmware read all 34 artifact candidates +PASS no kernel report line was truncated +PASS final report reached the console +PASS every frame returned after all candidates (4095 free before and after) +PASS ordinary build admitted nothing +PASS ordinary build refuses H01-BAD-MAGIC.AIEN (BadMagic), reclaimed +PASS H01-BAD-MAGIC.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS ordinary build refuses H02-VERSION.AIEN (UnsupportedVersion), reclaimed +PASS H02-VERSION.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS ordinary build refuses H03-TARGET.AIEN (WrongTarget), reclaimed +PASS H03-TARGET.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS ordinary build refuses H04-ABI.AIEN (WrongAbi), reclaimed +PASS H04-ABI.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS ordinary build refuses H05-TRUNCATED.AIEN (WrongLength), reclaimed +PASS H05-TRUNCATED.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS ordinary build refuses H06-TRAILING.AIEN (WrongLength), reclaimed +PASS H06-TRAILING.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS ordinary build refuses H07-TOTAL-LENGTH.AIEN (WrongLength), reclaimed +PASS H07-TOTAL-LENGTH.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS ordinary build refuses H08-OFFSET-OVERFLOW.AIEN (ResourceLimit), reclaimed +PASS H08-OFFSET-OVERFLOW.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS ordinary build refuses H09-SECTION-OVERLAP.AIEN (BadSection), reclaimed +PASS H09-SECTION-OVERLAP.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS ordinary build refuses H10-ENTRY-OUTSIDE.AIEN (BadEntryPoint), reclaimed +PASS H10-ENTRY-OUTSIDE.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS ordinary build refuses H11-PAYLOAD-MUTATED.AIEN (UntrustedSigner), reclaimed +PASS H11-PAYLOAD-MUTATED.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS ordinary build refuses H12-CAPS-MUTATED.AIEN (UntrustedSigner), reclaimed +PASS H12-CAPS-MUTATED.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS ordinary build refuses H13-ENVELOPE-MUTATED.AIEN (UntrustedSigner), reclaimed +PASS H13-ENVELOPE-MUTATED.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS ordinary build refuses H14-SIGNATURE-MUTATED.AIEN (UntrustedSigner), reclaimed +PASS H14-SIGNATURE-MUTATED.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS ordinary build refuses H15-UNKNOWN-SIGNER.AIEN (UntrustedSigner), reclaimed +PASS H15-UNKNOWN-SIGNER.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS ordinary build refuses H16-SIG-FORMAT.AIEN (BadSignatureFormat), reclaimed +PASS H16-SIG-FORMAT.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS ordinary build refuses H17-RESERVED-HEADER.AIEN (ReservedNonZero), reclaimed +PASS H17-RESERVED-HEADER.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS ordinary build refuses H18-RIGHTS-UNKNOWN.AIEN (MalformedCapability), reclaimed +PASS H18-RIGHTS-UNKNOWN.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS ordinary build refuses H19-CAP-COUNT.AIEN (ResourceLimit), reclaimed +PASS H19-CAP-COUNT.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS ordinary build refuses H20-ENVELOPE-LIMIT.AIEN (ResourceLimit), reclaimed +PASS H20-ENVELOPE-LIMIT.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS ordinary build refuses H21-LARGEST-ENVELOPE.AIEN (UntrustedSigner), reclaimed +PASS H21-LARGEST-ENVELOPE.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS ordinary build refuses H22-WX-SECTION.AIEN (BadSection), reclaimed +PASS H22-WX-SECTION.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS ordinary build refuses H23-EXEC-DATA.AIEN (UntrustedSigner), reclaimed +PASS H23-EXEC-DATA.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS ordinary build refuses H24-EXEC-STACK.AIEN (UntrustedSigner), reclaimed +PASS H24-EXEC-STACK.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS ordinary build refuses H25-BAD-SYSCALL.AIEN (UntrustedSigner), reclaimed +PASS H25-BAD-SYSCALL.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS ordinary build refuses H26-SYSCALL-BUDGET.AIEN (UntrustedSigner), reclaimed +PASS H26-SYSCALL-BUDGET.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS ordinary build refuses H27-POLICY-IPC.AIEN (UntrustedSigner), reclaimed +PASS H27-POLICY-IPC.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS ordinary build refuses H28-WRITE-ONLY-REQUEST.AIEN (UntrustedSigner), reclaimed +PASS H28-WRITE-ONLY-REQUEST.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS ordinary build refuses H29-READ-WRITE-REQUEST.AIEN (UntrustedSigner), reclaimed +PASS H29-READ-WRITE-REQUEST.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS ordinary build refuses P25EXEC.AIEN (UntrustedSigner), reclaimed +PASS P25EXEC.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS ordinary build refuses P25SPIN.AIEN (UntrustedSigner), reclaimed +PASS P25SPIN.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS ordinary build refuses P25TAMP.AIEN (UntrustedSigner), reclaimed +PASS P25TAMP.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS ordinary build refuses P25WX.AIEN (UntrustedSigner), reclaimed +PASS P25WX.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS ordinary build refuses P26SEED.AIEN (UntrustedSigner), reclaimed +PASS P26SEED.AIEN receipt: bound, host digest match, observed outcome, TEST ONLY signature verifies +PASS final report summarises zero admitted +ARTIFACT_PARSE: PASS +ARTIFACT_IDENTITY: PASS +ARTIFACT_SIGNATURE: PASS +ARTIFACT_ADMISSION: PASS +ARTIFACT_LOADED_BYTES: PASS +ARTIFACT_WX: PASS +SEED0B_AUTHORIZED_READ: PASS +SEED0B_WRITE_DENIED: PASS +SEED0B_FORGED_DENIED: PASS +SEED0B_RESOURCE_BOUND: PASS +SEED0B_CLEANUP: PASS +ADMISSION_RECEIPT: PASS +HOSTILE_MATRIX: PASS +SEED_0B_QEMU: PASS +QEMU_ARTIFACT: PASS + +--- [SEED-0A USB Keyboard in QEMU (input.keyboard.usb)] --- +attempts 1, 12 s (commit 13d02ab4b714), dma mode smmu, sent lines: abc, help, el, mem, exit +PASS left firmware and entered the kernel +PASS xHCI controller found before exit +PASS PCI segment swept for bus masters after exit +PASS no endpoint left with bus master stuck on +PASS xHCI bus master off before the DMA gate +PASS keyboard attached by the AIENOS driver +PASS IORT stream configured for xHCI DMA +PASS xHCI DMA window translated +PASS xHCI DMA granted only as confined +PASS typed text echoed on the serial console +PASS line ended by Enter and reported +PASS keyboard phase finished on Enter +PASS help command output +PASS EL command output +PASS memory command output +PASS keyboard phase finished on exit +PASS xHCI bus master revoked after the keyboard phase +PASS no unsafe DMA bypass in this image +QEMU_KEYBOARD: PASS (smmu) + +--- [SMMUv3 DMA Confinement in QEMU] --- +attempts 1, 11 s (commit 13d02ab4b714), dma mode smmu, sent lines: abc, help, el, mem, exit +PASS left firmware and entered the kernel +PASS xHCI controller found before exit +PASS PCI segment swept for bus masters after exit +PASS no endpoint left with bus master stuck on +PASS xHCI bus master off before the DMA gate +PASS keyboard attached by the AIENOS driver +PASS IORT stream configured for xHCI DMA +PASS xHCI DMA window translated +PASS xHCI DMA granted only as confined +PASS typed text echoed on the serial console +PASS line ended by Enter and reported +PASS keyboard phase finished on Enter +PASS help command output +PASS EL command output +PASS memory command output +PASS keyboard phase finished on exit +PASS xHCI bus master revoked after the keyboard phase +PASS no unsafe DMA bypass in this image +QEMU_KEYBOARD: PASS (smmu) +attempts 1, 8 s (commit 13d02ab4b714), dma mode fail-closed, sent lines: abc, help, el, mem, exit +PASS left firmware and entered the kernel +PASS xHCI controller found before exit +PASS PCI segment swept for bus masters after exit +PASS no endpoint left with bus master stuck on +PASS xHCI bus master off before the DMA gate +PASS xHCI DMA denied without an SMMU +PASS keyboard fail-closed without an SMMU +PASS xHCI never granted DMA +PASS keyboard never attached +PASS no unsafe DMA bypass in this image +QEMU_KEYBOARD: PASS (fail-closed) + +--- [M0 Native-Boot Rollback Verification in QEMU] --- +============================================================ +AIENOS M0 Native-Boot Rollback Test Suite (QEMU AArch64) +Host: spark-b87b | Firmware: AAVMF_CODE.no-secboot.fd +============================================================ +Building aienos-rollback-mock... + +--- [Subtest 1: Normal Candidate Execution & Rollback] --- +PASS AAVMF BdsDxe firmware one-shot BootNext dispatch & NVRAM persistence verified (Boot0000 -> Boot0001) +AAVMF_BOOTNEXT_NVRAM: PASS +NATIVE_ROLLBACK_NORMAL: PASS + +--- [Subtest 2: Candidate Fault / Panic & Rollback] --- +PASS Faulted candidate consumed BootNext and returned to Default via AAVMF BootOrder +NATIVE_ROLLBACK_FAULT: PASS + +--- [Subtest 3: Candidate Hang / Timeout & Rollback] --- +PASS Hung candidate reset consumed BootNext and returned to Default via AAVMF BootOrder +NATIVE_ROLLBACK_TIMEOUT: PASS + +--- [Subtest 4: Malformed / Corrupted Image Fallback] --- +PASS Malformed image rejected by AAVMF firmware with fallback to Default via BootOrder +NATIVE_ROLLBACK_REJECTED: PASS + +--- [Subtest 5: Absent Candidate Image Fallback] --- +PASS Absent candidate image handled cleanly with fallback to Default via BootOrder + +--- [Subtest 6: Repeated Boot Post-Consumption (No Loop Invariant)] --- +PASS Subsequent reboot stayed on Default OS via AAVMF BootOrder without re-executing candidate +NATIVE_ROLLBACK_BOOTNEXT_CONSUMED: PASS +NATIVE_ROLLBACK_DEFAULT_UNCHANGED: PASS + +============================================================ +AAVMF_BOOTNEXT_NVRAM: PASS +NATIVE_ROLLBACK_NORMAL: PASS +NATIVE_ROLLBACK_FAULT: PASS +NATIVE_ROLLBACK_TIMEOUT: PASS +NATIVE_ROLLBACK_REJECTED: PASS +NATIVE_ROLLBACK_BOOTNEXT_CONSUMED: PASS +NATIVE_ROLLBACK_DEFAULT_UNCHANGED: PASS +M0_NATIVE_ROLLBACK_QEMU: PASS +M0_ROLLBACK_QEMU: PASS + +--- [P3 NVMe + System Store v1 in QEMU] --- +nvme image: 67108864 bytes, 131072 x 512 B LBAs +sentinel: LBA 2048 offset 1048576, magic 'AIENOS-NVME-SENT' x32, sha256 8b688adcb13bef657e868313fb149e7e92e664b5f09fbd32f99d9cabf756fdf1 +attempts 1, 8 s (commit 13d02ab4b714), dma mode smmu +PASS ECAM discovery found the NVMe class device +PASS controller and namespace identify completed +PASS namespace geometry matches the image +PASS sentinel LBA read back exact bytes and SHA-256 +PASS read past the namespace end is rejected before any command +PASS device-reported command error is surfaced +PASS IORT stream configured for NVMe DMA +PASS NVMe DMA window translated +PASS NVMe DMA granted only as confined +PASS NVMe bus master revoked after the read phase +PASS no unsafe DMA bypass in this image +QEMU_NVME: PASS (smmu) +nvme image: 67108864 bytes, 131072 x 512 B LBAs +sentinel: LBA 2048 offset 1048576, magic 'AIENOS-NVME-SENT' x32, sha256 8b688adcb13bef657e868313fb149e7e92e664b5f09fbd32f99d9cabf756fdf1 +attempts 1, 7 s (commit 13d02ab4b714), dma mode fail-closed +PASS discovery found the device before the DMA gate +PASS NVMe DMA denied without an SMMU +PASS NVMe controller fail-closed without an SMMU +PASS NVMe controller never granted DMA +PASS NVMe controller never identified +PASS NVMe read never ran +PASS no unsafe DMA bypass in this image +QEMU_NVME: PASS (fail-closed) +nvme image: 67108864 bytes, 131072 x 512 B LBAs +sentinel LBA 2048 sha256 8b688adcb13bef657e868313fb149e7e92e664b5f09fbd32f99d9cabf756fdf1 +rw old LBA 4096 sha256 46fe054d5bfa8bf3b14ce240830da7445b26ebebe273349f9af22e6454244379 +rw new LBA 4096 sha256 76fa34c132173497a7bcd0c9618ebdcf0629f550934c164adf81cfa05e6a4451 +PASS ECAM discovery found the NVMe class device +PASS controller and namespace identify completed +PASS namespace geometry matches the image +PASS NVMe power-fail atomicity fields observed +INFO Store root-write power-fail atomicity NOT proven on this namespace +INFO NVME_ATOMICITY_IDENTIFY_QEMU: block_size=512 lbads=9 awupf_raw=0 nawupf_raw=0 nabspf_raw=0 nabo_blocks=0 effective_pf_blocks=1 boundary_blocks=-1 +INFO NVME_STORE_ROOT_ATOMICITY_QEMU: FAIL (slot0=not_atomic(ExceedsAtomicUnit { required_blocks: 8, guaranteed_blocks: 1 }) slot1=not_atomic(ExceedsAtomicUnit { required_blocks: 8, guaranteed_blocks: 1 })) +PASS read sentinel LBA returned exact bytes and SHA-256 +PASS read past the namespace end is rejected +PASS device-reported read error is surfaced +PASS write past the namespace end is rejected +PASS native write returned exact bytes and SHA-256 +PASS native flush completed +PASS write then flush then read-back matched +PASS invalid-namespace write surfaced a device error +PASS IORT stream configured for NVMe DMA +PASS NVMe DMA granted only as confined +PASS NVMe bus master revoked after the phase +PASS host read-back after power off equals the written bytes +PASS restart read-back observed the persisted pattern natively +QEMU_NVME_RW: PASS (smmu) +nvme image: 67108864 bytes, 131072 x 512 B LBAs +sentinel LBA 2048 sha256 8b688adcb13bef657e868313fb149e7e92e664b5f09fbd32f99d9cabf756fdf1 +rw old LBA 4096 sha256 46fe054d5bfa8bf3b14ce240830da7445b26ebebe273349f9af22e6454244379 +rw new LBA 4096 sha256 76fa34c132173497a7bcd0c9618ebdcf0629f550934c164adf81cfa05e6a4451 +PASS discovery found the device before the DMA gate +PASS NVMe DMA denied without an SMMU +PASS NVMe controller fail-closed without an SMMU +PASS no write marker without DMA +PASS no flush marker without DMA +PASS no durability marker without DMA +QEMU_NVME_RW: PASS (fail-closed) +nvme image: 67108864 bytes, 16384 x 4096 B LBAs +qemu-system-aarch64: terminating on signal 15 from pid 954064 (bash) +---- observed ---- +NVME_IDENTIFY_QEMU: PASS (vid=0x1b36 did=0x0010 nsid=1) +NVME_GEOMETRY_QEMU: PASS (nsid=1 block_count=16384 block_size=4096) +NVME_ATOMICITY_IDENTIFY_QEMU: block_size=4096 lbads=12 awupf_raw=0 nawupf_raw=0 nabspf_raw=0 nabo_blocks=0 effective_pf_blocks=1 boundary_blocks=-1 +NVME_STORE_ROOT_ATOMICITY_QEMU: PASS (slot0=atomic(effective=1) slot1=atomic(effective=1)) +------------------- +PASS controller and namespace identify completed +PASS namespace geometry is 4096-byte LBA +PASS atomicity Identify observed with 4096-byte LBA +PASS Store root write is power-fail atomic and boundary-safe +QEMU_NVME_ATOMICITY_4K: PASS +PASS integration smoke (provision + transact) +PASS reopen smoke +---- crash campaign results ---- +settle=0 cp=before_first_write saw=1 guest_reopen=1 guest_slot=1 recovered=1 state=Valid expect=N -> OK +settle=0 cp=after_payloads saw=1 guest_reopen=1 guest_slot=1 recovered=1 state=Valid expect=N -> OK +settle=0 cp=after_catalog saw=1 guest_reopen=1 guest_slot=1 recovered=1 state=Valid expect=N -> OK +settle=0 cp=after_commit_record saw=1 guest_reopen=1 guest_slot=1 recovered=1 state=Valid expect=N -> OK +settle=0 cp=after_first_flush saw=1 guest_reopen=1 guest_slot=1 recovered=1 state=Valid expect=N -> OK +settle=0 cp=after_superblock_write saw=1 guest_reopen=1 guest_slot=1 recovered=2 state=Valid expect=N_NP1 -> OK +settle=0 cp=after_final_flush saw=1 guest_reopen=1 guest_slot=1 recovered=2 state=Valid expect=NP1 -> OK +settle=3 cp=before_first_write saw=1 guest_reopen=1 guest_slot=1 recovered=4 state=Valid expect=N -> OK +settle=3 cp=after_payloads saw=1 guest_reopen=1 guest_slot=1 recovered=4 state=Valid expect=N -> OK +settle=3 cp=after_catalog saw=1 guest_reopen=1 guest_slot=1 recovered=4 state=Valid expect=N -> OK +settle=3 cp=after_commit_record saw=1 guest_reopen=1 guest_slot=1 recovered=4 state=Valid expect=N -> OK +settle=3 cp=after_first_flush saw=1 guest_reopen=1 guest_slot=1 recovered=4 state=Valid expect=N -> OK +settle=3 cp=after_superblock_write saw=1 guest_reopen=1 guest_slot=1 recovered=5 state=Valid expect=N_NP1 -> OK +settle=3 cp=after_final_flush saw=1 guest_reopen=1 guest_slot=1 recovered=5 state=Valid expect=NP1 -> OK + +=== Summary (commit 13d02ab4b7145579f6d3faa53442167bfcdcd7bc, tree_dirty=false, evidence level: QEMU only) === +STORE_NVME_INTEGRATION_QEMU: PASS +STORE_CHECKPOINT_CRASH_QEMU: PASS +STORE_REOPEN_QEMU: PASS +STORE_SLOT_REUSE_QEMU: PASS +STORE_V1_QEMU: PASS +P3_STORE_QEMU: NOT CLAIMED (QEMU campaign; native persistence conditions separate) +=== Building aienos-handoff (store-qual) and aienos-store-tool === +=== Integration Smoke (512-byte LBA) === +PASS integration smoke (provision + transact, 512b non-atomic qualification active) +PASS reopen smoke (generation=2 state=Valid peer=Valid) + +=== Tier 1: Checkpoint SIGKILL Campaign === +settle=0 cp=before_first_write saw=1 reopen=1 slot=1 gen=1 state=Valid peer=Zero expect=N -> OK +settle=0 cp=after_payloads saw=1 reopen=1 slot=1 gen=1 state=Valid peer=Zero expect=N -> OK +settle=0 cp=after_catalog saw=1 reopen=1 slot=1 gen=1 state=Valid peer=Zero expect=N -> OK +settle=0 cp=after_commit_record saw=1 reopen=1 slot=1 gen=1 state=Valid peer=Zero expect=N -> OK +settle=0 cp=after_first_flush saw=1 reopen=1 slot=1 gen=1 state=Valid peer=Zero expect=N -> OK +settle=0 cp=after_superblock_write saw=1 reopen=1 slot=1 gen=2 state=Valid peer=Valid expect=N_NP1 -> OK +settle=0 cp=after_final_flush saw=1 reopen=1 slot=1 gen=2 state=Valid peer=Valid expect=NP1 -> OK +settle=3 cp=before_first_write saw=1 reopen=1 slot=1 gen=4 state=Valid peer=Valid expect=N -> OK +settle=3 cp=after_payloads saw=1 reopen=1 slot=1 gen=4 state=Valid peer=Valid expect=N -> OK +settle=3 cp=after_catalog saw=1 reopen=1 slot=1 gen=4 state=Valid peer=Valid expect=N -> OK +settle=3 cp=after_commit_record saw=1 reopen=1 slot=1 gen=4 state=Valid peer=Valid expect=N -> OK +settle=3 cp=after_first_flush saw=1 reopen=1 slot=1 gen=4 state=Valid peer=Valid expect=N -> OK +settle=3 cp=after_superblock_write saw=1 reopen=1 slot=1 gen=5 state=Valid peer=Valid expect=N_NP1 -> OK +settle=3 cp=after_final_flush saw=1 reopen=1 slot=1 gen=5 state=Valid peer=Valid expect=NP1 -> OK +STORE_512B_CRASH_OBSERVED_QEMU: PASS + +=== Tier 2a: Root Tear Closure (host proof over Tier 1 images) === +settle=0 STORE_ROOT_TEAR_CLOSURE: PASS (slot=1 old=zero new=gen2 sector_bytes=512 differing_sectors=[0] combinations=256 as_old=128 as_new=128) +settle=3 STORE_ROOT_TEAR_CLOSURE: PASS (slot=0 old=gen3 new=gen5 sector_bytes=512 differing_sectors=[0] combinations=256 as_old=128 as_new=128) +STORE_512B_ROOT_TEAR_CLOSURE: PASS + +=== Tier 2b: Injected Root Recovery (media corruption, one defect per case) === +case=bad_crc decode=BadSuperblockCrc gen=1 state=DegradedRecovery peer=Malformed readonly=1 expect=degraded:Malformed -> OK +case=wrong_magic decode=BadSuperblockMagic gen=1 state=DegradedRecovery peer=Malformed readonly=1 expect=degraded:Malformed -> OK +case=nonzero_reserved decode=NonzeroReserved gen=1 state=DegradedRecovery peer=Malformed readonly=1 expect=degraded:Malformed -> OK +case=wrong_slot_id decode=WrongSuperblockSlot gen=1 state=DegradedRecovery peer=Malformed readonly=1 expect=degraded:Malformed -> OK +case=region_mismatch decode=Ok gen=1 state=DegradedRecovery peer=Malformed readonly=1 expect=degraded:Malformed -> OK +case=seeded_garbage decode=BadSuperblockMagic gen=1 state=DegradedRecovery peer=Malformed readonly=1 expect=degraded:Malformed -> OK +case=unsupported_version decode=UnsupportedVersion gen=none state=none peer=none readonly=0 expect=refuse:UnsupportedVersion -> OK +case=graph_bad_newer decode=Ok gen=1 state=DegradedRecovery peer=GraphBadNewer readonly=1 expect=degraded:GraphBadNewer -> OK +case=control_new_root decode=Ok gen=2 state=Valid peer=Valid readonly=0 expect=valid:gen2 -> OK +STORE_512B_INJECTED_ROOT_RECOVERY_QEMU: PASS + +=== Final Summary (commit 13d02ab4b7145579f6d3faa53442167bfcdcd7bc-dirty, tree_dirty=true, evidence level: QEMU only) === +STORE_NVME_INTEGRATION_512B_QEMU: PASS +STORE_512B_CRASH_OBSERVED_QEMU: PASS +STORE_512B_ROOT_TEAR_CLOSURE: PASS +STORE_512B_INJECTED_ROOT_RECOVERY_QEMU: PASS +STORE_512B_CRASH_RECOVERY_QEMU: PASS +P3_STORE_QEMU: NOT CLAIMED (QEMU campaign; native persistence conditions separate) +P3_STORE_NATIVE: NOT CLAIMED +=== Building aienos-handoff (continuity-qual) and aienos-store-tool === +=== 1. Refusals: no boot path mints an identity === +PASS resume on blank media stops (store Unformatted) and writes nothing +PASS resume on a formatted but unprovisioned store stops UNPROVISIONED and writes nothing +=== 2. Provisioning happens once === +PASS provisioned agent b7938600173787d9... (incarnation 1, empty memory, root branch) +PASS a second provisioning request is refused and writes nothing +PASS independent provisioning draws a different identity from RNDR +=== 3. Memory and lineage survive cold restarts === +PASS resume + remember: incarnation 2, one Cortex fact and one forked branch committed +PASS cold restart 1: same agent, same memory 93153a653f8f3b39, same lineage, incarnation 3 +PASS cold restart 2: same agent, same memory 93153a653f8f3b39, same lineage, incarnation 4 +=== 4. SIGKILL at every Store checkpoint of a continuity commit === +PASS kill at before_first_write: same agent, old memory +PASS kill at after_payloads: same agent, old memory +PASS kill at after_catalog: same agent, old memory +PASS kill at after_commit_record: same agent, old memory +PASS kill at after_first_flush: same agent, old memory +PASS kill at after_superblock_write: same agent, new memory +PASS kill at after_final_flush: same agent, new memory +=== 5. Degraded mount resumes read-only === +PASS malformed peer superblock: same agent and memory, read-only, nothing written + +=== Summary (commit 13d02ab4b7145579f6d3faa53442167bfcdcd7bc) === +CONTINUITY_QEMU: PASS +CONTINUITY_NATIVE: NOT CLAIMED (Machine 1 waits on TRUST-1) +=== Building aienos-handoff (recovery-qual) and aienos-store-tool === +=== 1. Degraded store: operator-authorised repair === +PASS inspection enters the Recovery Core (Degraded(Malformed)), shows the same agent, writes nothing +PASS repair with zero response refused, nothing written +PASS repair with wrong_key response refused, nothing written +PASS repair with wrong_action response refused, nothing written +PASS authorised repair done +PASS after repair a cold boot resumes writable with the same agent and memory +PASS replaying the repair authorisation on the healthy store does nothing +=== 2. Unprovisioned store: operator-authorised provisioning === +PASS unprovisioned store enters the Recovery Core and offers only provisioning +PASS provisioning with a wrong key refused, nothing written +PASS operator provisioning created one identity and a cold boot resumes it +=== 3. Identity loss: nothing may mint === +PASS corrupted agent root: Recovery Core entered, no action offered, nothing written (Degraded(GraphBadNewer)) +PASS mode 10 after identity loss refused, nothing written +PASS mode 11 after identity loss refused, nothing written +PASS a normal boot after identity loss does not resume or mint (19bda224e79b12b9... is not replaced) + +=== Summary (commit ae16b168e3c135a4770b4400f4cb9a18dcb289f4) === +RECOVERY_CORE_QEMU: PASS +RECOVERY_CORE_OPERATOR_CREDENTIAL: TEST-ONLY (real scheme undecided, ADR 0006 / M5) + + +--- [TRUST-1 Gate 4 Security Suite Verification] --- +Building aienos-handoff binary for Gate 4 suite... +=== Subtest 1: Software TPM 2.0 Integration & Live Boot === +PASS swTPM live boot reached kernel alive and final report +=== Subtest 2: Soak Testing (3 Sequential Boots) === +PASS Soak run 1/3: clean boot & reset +PASS Soak run 2/3: clean boot & reset +PASS Soak run 3/3: clean boot & reset +=== Subtest 3: Fault Injection (Corrupted EFI Image) === +qemu-system-aarch64: terminating on signal 15 from pid 1424241 (timeout) +PASS Corrupted binary cleanly rejected by firmware without reaching kernel alive (firmware banner present) +TRUST-1 Gate 4 Security Suite: ALL TESTS PASS + +--- [TRUST-1 Gate 1 Standalone Recovery Verification] --- +Building standalone recovery initrd... +Building standalone recovery root in /tmp/recovery-initrd-build.a4Z6jS... +Packaged 16 kernel modules for 7.0.0-1019-nvidia +Packaging standalone initrd to /tmp/tmp.8Q6AsVwJaJ/aienos-recovery-standalone-initrd.img... +81696 blocks +Standalone recovery initrd build complete: 16M /tmp/tmp.8Q6AsVwJaJ/aienos-recovery-standalone-initrd.img +Booting standalone recovery kernel in QEMU with ZERO hard disks attached... +qemu exit 0 after 8 s +PASS Recovery banner displayed +PASS 100% RAM disk verified +PASS Internal NVMe confirmed unmounted +PASS Automated recovery test passed +RECOVERY_ZERO_DISK: PASS (verified standalone RAM recovery with zero attached storage) +Booting recovery kernel with a scratch USB stick, NVMe drive and USB keyboard... +qemu exit 0 +PASS All packaged kernel modules loaded (16/16) +PASS USB keyboard detected +PASS USB stick visible +PASS NVMe drive visible +RECOVERY_DEVICES: PASS (packaged drivers found USB keyboard, USB stick and NVMe) + +--- [Recovery Media Tooling Manifest] --- +Building standalone recovery initrd... +Building standalone recovery root in /tmp/recovery-initrd-build.ycrGhm... +Packaged 16 kernel modules for 7.0.0-1019-nvidia +Packaging standalone initrd to /tmp/tmp.dJSya4fDNd/aienos-recovery-standalone-initrd.img... +81696 blocks +Standalone recovery initrd build complete: 16M /tmp/tmp.dJSya4fDNd/aienos-recovery-standalone-initrd.img +Extracting /tmp/tmp.dJSya4fDNd/aienos-recovery-standalone-initrd.img... + +-- required tools for NVMe root mount -- +PASS busybox present +PASS mount present +PASS lsblk present +PASS blkid present +PASS cryptsetup present +PASS nvme kernel module packaged +PASS dm-crypt kernel module packaged + +-- required tools for /boot/efi repair -- +PASS fsck.vfat present +PASS mkfs.vfat present +PASS fsck.ext4 present +PASS efibootmgr present + +-- required tools for boot-entry restore -- +PASS efibootmgr present (boot entries) +PASS chroot present +PASS findmnt present for attended evidence collector +PASS attended evidence collector packaged on media + +-- TRUST-1 Gate 1 items 8, 10, 11-12: TPM, signatures, recovery unlock -- +PASS tpm2_pcrread present +PASS tpm2 device transport library packaged (dlopen, not seen by ldd) +PASS sbverify present +PASS age present +PASS gocryptfs present +PASS fusermount3 present +PASS gocryptfs: every shared library it needs is inside the image +PASS age: every shared library it needs is inside the image +PASS sbverify: every shared library it needs is inside the image +PASS tpm2_pcrread: every shared library it needs is inside the image +PASS cryptsetup: every shared library it needs is inside the image +PASS fusermount3: every shared library it needs is inside the image +PASS efibootmgr: every shared library it needs is inside the image +PASS tpm2 device transport: its libraries are inside the image + +-- init hooks -- +PASS init is executable +PASS init keeps zero-disk test mode (aienos.test=1) +PASS init reports EFI boot entries (efibootmgr) +PASS init drops into an interactive maintenance shell + +RECOVERY_TOOLS: PASS (initrd ships mount, EFI repair, and boot-entry restore capability) + +--- [TRUST-1 Measurement Tools Self-Test] --- +PASS capture + compare: identical states compare equal +PASS capture refuses to overwrite +PASS compare names exactly PCR 7 after one extend +PASS receipt: restored rollback RECORDED, unrestored STOP, chained +PASS tampered captures refused +PASS credential decoder: header decoded, --live follows PCR 7 +TRUST-1 measurement tools self-test: ALL PASS + +--- [TRUST-1 Gate 4 Secure Boot Signing in QEMU] --- +Building aienos-handoff binary for the Secure Boot test... +PASS signed with enrolled test key: booted to kernel alive (Secure Boot on) +PASS unsigned image refused by firmware signature check (Access Denied) +PASS tampered image refused by firmware signature check (Access Denied) +PASS wrongkey image refused by firmware signature check (Access Denied) +TRUST-1 Gate 4 Secure Boot signing test: ALL PASS + +--- [TRUST-1 Gate 3 Key Ceremony Tool Self-Test] --- +PASS generate: four keys and a root-signed manifest that verifies +PASS every private key is stored encrypted +PASS generate refuses to overwrite +PASS two backups decrypt from their own copies; record has no private material +PASS a wrong passphrase cannot open the backup copy +PASS a changed manifest is refused +PASS a swapped public key is refused +PASS rotation add: generation 2 trusts old and new release keys; old signatures still verify +PASS rotation revoke: generation 3 trusts only the new key; old key quarantined, not deleted +PASS owner_root cannot be rotated by the routine tool (special recovery ceremony only) +PASS a validly signed older generation is refused when generation 3 is the minimum +PASS Boot Signer cert signs and verifies the EFI loader (sbsign/sbverify) +TRUST-1 key ceremony self-test (throwaway keys): ALL PASS + +--- [Evidence Receipt Label Lint] --- +PASS mutant: literal true, no addendum -> FAIL -> exit 1 +PASS amended by an addendum bound to the hash -> PASS -> exit 0 +PASS mutant: addendum bound to a different hash -> FAIL -> exit 1 +PASS NOT_RUN labels need no addendum -> PASS -> exit 0 +PASS receipt with no invariants block -> PASS -> exit 0 +CHECK_RECEIPT_LABELS_SELF_TEST: PASS +PASS gate1_zero_disk_recovery_receipt.json: hardcoded invariants are amended by an addendum bound to sha256 e1d6ac54 +RECEIPT_LABELS: PASS + +============================================================ +VERIFY_ALL: PASS (every step ran; QEMU steps are emulator evidence only, hardware NOT_RUN) +============================================================ diff --git a/evidence/allen-omega-L694/probe.txt b/evidence/allen-omega-L694/probe.txt new file mode 100644 index 00000000..5bf0d579 --- /dev/null +++ b/evidence/allen-omega-L694/probe.txt @@ -0,0 +1 @@ +Allen Omega native probe diff --git a/evidence/allen-omega-L694/push.log b/evidence/allen-omega-L694/push.log new file mode 100644 index 00000000..1dfa0d93 --- /dev/null +++ b/evidence/allen-omega-L694/push.log @@ -0,0 +1,5 @@ +ssh: Could not resolve hostname github.com: Temporary failure in name resolution +fatal: Could not read from remote repository. + +Please make sure you have the correct access rights +and the repository exists. diff --git a/evidence/allen-omega-L694/replay1.log b/evidence/allen-omega-L694/replay1.log new file mode 100644 index 00000000..462a8e50 --- /dev/null +++ b/evidence/allen-omega-L694/replay1.log @@ -0,0 +1,3 @@ +/home/drakestapleton/.local/bin/quiet-build: 47: cannot create /home/drakestapleton/.local/state/quiet/waits.log: Read-only file system +/home/drakestapleton/.local/bin/quiet-build: 47: printf: printf: I/O error +omc: line 1907: error 10 diff --git a/evidence/allen-omega-L694/replay2.log b/evidence/allen-omega-L694/replay2.log new file mode 100644 index 00000000..bbc81741 --- /dev/null +++ b/evidence/allen-omega-L694/replay2.log @@ -0,0 +1,22 @@ +/home/drakestapleton/.local/bin/quiet-build: 47: cannot create /home/drakestapleton/.local/state/quiet/waits.log: Read-only file system +/home/drakestapleton/.local/bin/quiet-build: 47: printf: printf: I/O error +runtime compile=0 native-exit=0 +code compile=0 native-exit=0 +courier compile=0 native-exit=0 +memory compile=0 native-exit=0 +intent compile=0 native-exit=0 +reply compile=0 native-exit=0 +view compile=0 native-exit=0 +scene compile=0 native-exit=0 +paint compile=0 native-exit=0 +edges compile=0 native-exit=0 +fixture compile=0 native-exit=0 +golden compile=0 native-exit=0 +render compile=0 native-exit=0 +stdio native-exit=0 golden-cmp=0 +stale mutant compile=0 rejected-exit=3 +crc mutant compile=0 rejected-exit=2 +hash mutant compile=0 rejected-exit=2 +readback mutant compile=0 rejected-exit=6 +session mutant compile=0 rejected-exit=0 +ALLEN_OMEGA_HOST: PASS; target=NOT_RUN; live=NOT_RUN diff --git a/evidence/allen-omega-L694/replay3.log b/evidence/allen-omega-L694/replay3.log new file mode 100644 index 00000000..42d1c377 --- /dev/null +++ b/evidence/allen-omega-L694/replay3.log @@ -0,0 +1,22 @@ +/home/drakestapleton/.local/bin/quiet-build: 47: cannot create /home/drakestapleton/.local/state/quiet/waits.log: Read-only file system +/home/drakestapleton/.local/bin/quiet-build: 47: printf: printf: I/O error +runtime compile=0 native-exit=0 +code compile=0 native-exit=0 +courier compile=0 native-exit=0 +memory compile=0 native-exit=0 +intent compile=0 native-exit=0 +reply compile=0 native-exit=0 +view compile=0 native-exit=0 +scene compile=0 native-exit=0 +paint compile=0 native-exit=0 +edges compile=0 native-exit=0 +fixture compile=0 native-exit=0 +golden compile=0 native-exit=0 +render compile=0 native-exit=0 +stdio native-exit=0 golden-cmp=0 +stale mutant compile=0 rejected-exit=3 +crc mutant compile=0 rejected-exit=2 +hash mutant compile=0 rejected-exit=2 +readback mutant compile=0 rejected-exit=6 +session mutant compile=0 rejected-exit=1 +ALLEN_OMEGA_HOST: PASS; target=NOT_RUN; live=NOT_RUN diff --git a/evidence/allen-omega-L694/replay4.log b/evidence/allen-omega-L694/replay4.log new file mode 100644 index 00000000..42d1c377 --- /dev/null +++ b/evidence/allen-omega-L694/replay4.log @@ -0,0 +1,22 @@ +/home/drakestapleton/.local/bin/quiet-build: 47: cannot create /home/drakestapleton/.local/state/quiet/waits.log: Read-only file system +/home/drakestapleton/.local/bin/quiet-build: 47: printf: printf: I/O error +runtime compile=0 native-exit=0 +code compile=0 native-exit=0 +courier compile=0 native-exit=0 +memory compile=0 native-exit=0 +intent compile=0 native-exit=0 +reply compile=0 native-exit=0 +view compile=0 native-exit=0 +scene compile=0 native-exit=0 +paint compile=0 native-exit=0 +edges compile=0 native-exit=0 +fixture compile=0 native-exit=0 +golden compile=0 native-exit=0 +render compile=0 native-exit=0 +stdio native-exit=0 golden-cmp=0 +stale mutant compile=0 rejected-exit=3 +crc mutant compile=0 rejected-exit=2 +hash mutant compile=0 rejected-exit=2 +readback mutant compile=0 rejected-exit=6 +session mutant compile=0 rejected-exit=1 +ALLEN_OMEGA_HOST: PASS; target=NOT_RUN; live=NOT_RUN diff --git a/evidence/allen-omega-L694/replay5.log b/evidence/allen-omega-L694/replay5.log new file mode 100644 index 00000000..29b40aa8 --- /dev/null +++ b/evidence/allen-omega-L694/replay5.log @@ -0,0 +1,22 @@ +/home/drakestapleton/.local/bin/quiet-build: 47: cannot create /home/drakestapleton/.local/state/quiet/waits.log: Read-only file system +/home/drakestapleton/.local/bin/quiet-build: 47: printf: printf: I/O error +runtime compile=0 native-exit=0 +code compile=0 native-exit=0 +courier compile=0 native-exit=0 +memory compile=0 native-exit=0 +intent compile=0 native-exit=0 +reply compile=0 native-exit=0 +view compile=0 native-exit=0 +scene compile=0 native-exit=0 +paint compile=0 native-exit=0 +edges compile=0 native-exit=0 +fixture compile=0 native-exit=0 +golden compile=0 native-exit=0 +render compile=0 native-exit=0 +stdio native-exit=0 golden-cmp=0 +stale mutant compile=0 rejected-exit=3 +crc mutant compile=0 rejected-exit=2 +hash mutant compile=0 rejected-exit=2 +readback mutant compile=0 rejected-exit=7 +session mutant compile=0 rejected-exit=1 +ALLEN_OMEGA_HOST: PASS; target=NOT_RUN; live=NOT_RUN diff --git a/evidence/allen-omega-L694/reply1.txt b/evidence/allen-omega-L694/reply1.txt new file mode 100644 index 00000000..d11a72ad --- /dev/null +++ b/evidence/allen-omega-L694/reply1.txt @@ -0,0 +1,15 @@ +801 0 +802 0 +803 0 +804 0 +805 0 +806 0 +807 0 +808 0 +809 0 +810 0 +811 0 +812 0 +813 0 +814 0 +815 0 diff --git a/evidence/allen-omega-L694/runtime-green.txt b/evidence/allen-omega-L694/runtime-green.txt new file mode 100644 index 00000000..5168e6f3 --- /dev/null +++ b/evidence/allen-omega-L694/runtime-green.txt @@ -0,0 +1,28 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 diff --git a/evidence/allen-omega-L694/runtime-red.om b/evidence/allen-omega-L694/runtime-red.om new file mode 100644 index 00000000..83d870c5 --- /dev/null +++ b/evidence/allen-omega-L694/runtime-red.om @@ -0,0 +1,198 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn start kind ulong now ulong to bool +ret false +end +fn answer seq ulong now ulong to bool +ret false +end +fn cancel to void +end +fn tick now ulong to ulong +ret 0 +end +fn reset to void +end +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end +text Ask "make me a calculator" +text Reply "Model supplied answer." +fn askload to void +put Inlen 0 len Ask +for i ulong len Ask +put In i get Ask i +end +end +fn main to int +askload +check start 2 0 1 +check eq get R 1 1 2 +check eq get R 2 2 3 +check eq get R 8 len Ack 4 +old = get R 0 +check not start 1 1 5 +put Inlen 0 len Reply +for i ulong len Reply +put In i get Reply i +end +check not answer add old 1 2 6 +check eq get R 8 len Ack 7 +check answer old 3 8 +check eq get R 1 0 9 +askload +check start 1 4 10 +check gt get R 0 old 11 +cancel +check eq get R 1 0 12 +check not answer get R 0 5 13 +askload +check start 1 10 14 +check eq tick 20009 0 15 +check eq tick 20010 1 16 +check eq tick 20011 0 17 +check eq tick 30010 2 18 +check eq get R 1 0 19 +old = get R 0 +reset +check eq get R 0 old 20 +askload +check start 2 40000 21 +check gt get R 0 old 22 +cancel +put Inlen 0 160 +check not start 1 40001 23 +check eq get R 1 0 24 +askload +check not start 3 40002 25 +put R 6 1 +check start 3 40003 26 +check eq get R 8 len Ackmore 27 +cancel +put R 0 4294967295 +check not start 1 40004 28 +ret int get Fails 0 +end diff --git a/evidence/allen-omega-L694/runtime-red.txt b/evidence/allen-omega-L694/runtime-red.txt new file mode 100644 index 00000000..60a1ad8d --- /dev/null +++ b/evidence/allen-omega-L694/runtime-red.txt @@ -0,0 +1,28 @@ +1 1 +2 1 +3 1 +4 1 +5 0 +6 0 +7 1 +8 1 +9 0 +10 1 +11 1 +12 0 +13 0 +14 1 +15 0 +16 1 +17 0 +18 1 +19 0 +20 0 +21 1 +22 1 +23 0 +24 0 +25 0 +26 1 +27 1 +28 0 diff --git a/evidence/allen-omega-L694/scene1.txt b/evidence/allen-omega-L694/scene1.txt new file mode 100644 index 00000000..99a75fb5 --- /dev/null +++ b/evidence/allen-omega-L694/scene1.txt @@ -0,0 +1,14 @@ +1001 0 +1002 0 +1003 1 +1004 0 +1005 0 +1006 0 +1007 0 +1008 0 +1009 0 +1010 0 +1011 0 +1012 0 +1013 0 +1014 0 diff --git a/evidence/allen-omega-L694/scene2.txt b/evidence/allen-omega-L694/scene2.txt new file mode 100644 index 00000000..44a4b2b1 --- /dev/null +++ b/evidence/allen-omega-L694/scene2.txt @@ -0,0 +1,14 @@ +1001 0 +1002 0 +1003 0 +1004 0 +1005 0 +1006 0 +1007 0 +1008 0 +1009 0 +1010 0 +1011 0 +1012 0 +1013 0 +1014 0 diff --git a/evidence/allen-omega-L694/short-native.txt b/evidence/allen-omega-L694/short-native.txt new file mode 100644 index 00000000..a9da2dc8 --- /dev/null +++ b/evidence/allen-omega-L694/short-native.txt @@ -0,0 +1,20 @@ +401 0 +410 0 +411 0 +412 0 +413 0 +414 0 +402 0 +403 0 +404 0 +405 0 +406 0 +700 0 +701 0 +702 0 +703 0 +704 0 +705 0 +407 0 +408 0 +409 0 diff --git a/evidence/allen-omega-L694/short.wire b/evidence/allen-omega-L694/short.wire new file mode 100644 index 00000000..d0d687da --- /dev/null +++ b/evidence/allen-omega-L694/short.wire @@ -0,0 +1,7 @@ +CODE 1 1/6 768 a75a7df7 python # calc.py: a small calculator that reads one sum at a time.\nimport operator\n\nOPS = {"+": operator.add, "-": operator.sub, "*": o +CODE 1 2/6 768 a75a7df7 python perator.mul, "/": operator.truediv}\n\n\ndef calculate(a, op, b):\n if op not in OPS:\n raise ValueError("unknown operator +CODE 1 3/6 768 a75a7df7 python " + op)\n if op == "/" and b == 0:\n raise ZeroDivisionError("cannot divide by zero")\n return OPS[op](a, b)\n\n\ndef mai +CODE 1 4/6 768 a75a7df7 python n():\n print("Type a sum like 3 + 4, or q to quit.")\n while True:\n line = input("> ").strip()\n if line in ("q +CODE 1 5/6 768 a75a7df7 python ", "quit"):\n break\n try:\n a, op, b = line.split()\n print(calculate(float(a), op, float(b +CODE 1 6/6 768 a75a7df7 python )))\n except (ValueError, ZeroDivisionError) as e:\n print("Sorry:", e)\n\n\nif __name__ == "__main__":\n main()\n +SAY 1 1/1 Here is a small calculator you can run with python3 calc.py. diff --git a/evidence/allen-omega-L694/source-closure.log b/evidence/allen-omega-L694/source-closure.log new file mode 100644 index 00000000..bb744f4a --- /dev/null +++ b/evidence/allen-omega-L694/source-closure.log @@ -0,0 +1,34 @@ +native/omega/allen/README.md: OK +native/omega/allen/base.om: OK +native/omega/allen/build-one.sh: OK +native/omega/allen/code.om: OK +native/omega/allen/courier.om: OK +native/omega/allen/gate.sh: OK +native/omega/allen/golden.sh: OK +native/omega/allen/intent.om: OK +native/omega/allen/main.om: OK +native/omega/allen/memory.om: OK +native/omega/allen/paint.om: OK +native/omega/allen/reply.om: OK +native/omega/allen/runtime.om: OK +native/omega/allen/scene.om: OK +native/omega/allen/tests/check.om: OK +native/omega/allen/tests/code.om: OK +native/omega/allen/tests/courier.om: OK +native/omega/allen/tests/edges.om: OK +native/omega/allen/tests/fixture.om: OK +native/omega/allen/tests/golden.om: OK +native/omega/allen/tests/intent.om: OK +native/omega/allen/tests/memory.om: OK +native/omega/allen/tests/paint.om: OK +native/omega/allen/tests/probe.om: OK +native/omega/allen/tests/render.om: OK +native/omega/allen/tests/reply.om: OK +native/omega/allen/tests/runtime.om: OK +native/omega/allen/tests/scene.om: OK +native/omega/allen/tests/view.om: OK +native/omega/allen/vendor/OMEGA-LICENSE: OK +native/omega/allen/vendor/PROVENANCE.md: OK +native/omega/allen/vendor/sha256-core.om: OK +native/omega/allen/vendor/sha256.om: OK +native/omega/allen/view.om: OK diff --git a/evidence/allen-omega-L694/stdio-display.txt b/evidence/allen-omega-L694/stdio-display.txt new file mode 100644 index 00000000..7d40356d --- /dev/null +++ b/evidence/allen-omega-L694/stdio-display.txt @@ -0,0 +1,2 @@ +I need to code that. Let me send it off to the Spark. +Code ready. diff --git a/evidence/allen-omega-L694/stdio-input.txt b/evidence/allen-omega-L694/stdio-input.txt new file mode 100644 index 00000000..6701617d --- /dev/null +++ b/evidence/allen-omega-L694/stdio-input.txt @@ -0,0 +1,3 @@ +ASK make me a calculator +CODE 1 1/1 9 3ce11e06 python print(1)\n +SAY 1 1/1 Code ready. diff --git a/evidence/allen-omega-L694/stdio-job.txt b/evidence/allen-omega-L694/stdio-job.txt new file mode 100644 index 00000000..db964ea1 --- /dev/null +++ b/evidence/allen-omega-L694/stdio-job.txt @@ -0,0 +1 @@ +JOB 1 code the person asked Allen for code. make me a calculator diff --git a/evidence/allen-omega-L694/verify-all.log b/evidence/allen-omega-L694/verify-all.log new file mode 100644 index 00000000..912f69ab --- /dev/null +++ b/evidence/allen-omega-L694/verify-all.log @@ -0,0 +1,1050 @@ +/home/drakestapleton/.local/bin/quiet-build: 47: cannot create /home/drakestapleton/.local/state/quiet/waits.log: Read-only file system +/home/drakestapleton/.local/bin/quiet-build: 47: printf: printf: I/O error +============================================================ +AIENOS Integration Verification Harness +Host: spark-b87b | Arch: aarch64 | Kernel: 7.0.0-1019-nvidia +Date: 2026-10-23T11:34:02Z +Strict: 1 | Serial log dir: none +============================================================ + +--- [Gate 1 Verification: Config A Freeze] --- +Config A capture verified for spark-b87b: 5 samples, mean decode 54.2 tokens/s +M0 closable: no (recovery procedure is documented_only; native boot rollback has not been tested on Machine 1) +PASS Gate 1 Config A reference bundle verified + +--- [Formatting: cargo fmt --check] --- +PASS formatting: cargo fmt --all --check + +--- [Host Component Testing: Workspace Crates] --- + Compiling aienos-crypto v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-crypto) + Compiling version_check v0.9.5 + Compiling typenum v1.20.1 + Compiling libc v0.2.189 + Compiling semver v1.0.28 + Compiling cfg-if v1.0.5 + Compiling zeroize v1.9.0 + Compiling signature v2.2.0 + Compiling subtle v2.6.1 + Compiling aienos-capability v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-capability) + Compiling serde_core v1.0.229 + Compiling zmij v1.0.23 + Compiling aienos-accel v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-accel) + Compiling serde_json v1.0.151 + Compiling memchr v2.8.3 + Compiling itoa v1.0.18 + Compiling proc-macro2 v1.0.107 + Compiling quote v1.0.47 + Compiling unicode-ident v1.0.26 + Compiling serde v1.0.229 + Compiling aienos-infer v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-infer) + Compiling rustc_version v0.4.1 + Compiling ed25519 v2.2.3 + Compiling allen-reflex v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/allen-reflex) + Compiling allen-design-tokens v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/allen-design-tokens) + Compiling aienos-capability-ffi v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-capability-ffi) + Compiling aienos-boot v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-boot) + Compiling generic-array v0.14.7 + Compiling allen-courier v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/allen-courier) + Compiling curve25519-dalek v4.1.3 + Compiling crypto-common v0.1.7 + Compiling block-buffer v0.10.4 + Compiling digest v0.10.7 + Compiling syn v3.0.6 + Compiling cpufeatures v0.2.17 + Compiling sha2 v0.10.9 + Compiling ed25519-dalek v2.2.0 + Compiling aienos-artifact v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-artifact) + Compiling aienos-kernel v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-kernel) + Compiling serde_derive v1.0.229 + Compiling aienos-evidence v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-evidence) + Compiling aienos-store-tool v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-store-tool) + Compiling aienos-agent-state v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-agent-state) + Compiling aienos-cortex v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-cortex) + Compiling aienos-artifact-tool v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-artifact-tool) + Compiling aienos-explain v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-explain) + Compiling aienos-c1-tree v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-c1-tree) + Compiling aienos-aegis v0.1.0 (/home/drakestapleton/workspace/aienos-allen-omega-L694/crates/aienos-aegis) + Finished `test` profile [unoptimized + debuginfo] target(s) in 8.22s + Running unittests src/lib.rs (target/debug/deps/aienos_accel-d25eb76ec36d0a33) + +running 16 tests +test pci::tests::capability_list_absence_is_empty_not_error ... ok +test pci::tests::decodes_msi_msix_and_pcie ... ok +test pci::tests::rejects_reserved_bar_encodings ... ok +test pci::tests::decodes_bar_sizes_with_bounds ... ok +test pci::tests::rejects_capability_loop_and_out_of_bounds ... ok +test pci::tests::decodes_bridge_header_and_window ... ok +test pci::tests::decodes_standard_header_and_64_bit_bar ... ok +test pci::tests::rejects_truncated_header_and_bridge_type ... ok +test pci::tests::walks_extended_capabilities_with_loop_and_bounds_checks ... ok +test profile::tests::match_gb10_is_property_based_not_bdf_based ... ok +test profile::tests::profile_classifies_source_and_native_verification ... ok +test profile::tests::profile_renders_deterministically ... ok +test registers::tests::ledger_is_exactly_the_two_established_offsets ... ok +test registers::tests::ledger_renders_without_claiming_semantics ... ok +test tests::diagnostics_report_refused_opens_segments_and_bar_state ... ok +test tests::validates_gb10_memory_bar ... ok + +test result: ok. 16 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running tests/gb10_fixtures.rs (target/debug/deps/gb10_fixtures-a1e328f7018003cd) + +running 10 tests +test follows_a_secondary_bus_window_to_a_downstream_gb10 ... ok +test decodes_capabilities_from_full_config_space ... ok +test handles_large_bar_and_extended_space_bounds ... ok +test profile_decodes_bar_kinds_and_keeps_sizes_unknown ... ok +test identifies_gb10_from_properties_under_bdf_relocation ... ok +test rejects_disabled_memory_decoding_unprogrammed_and_32_bit_bar ... ok +test rejects_malformed_capability_loops ... ok +test rejects_wrong_vendor_and_wrong_device ... ok +test reports_missing_msi_and_msix_as_absent_not_zero ... ok +test selects_the_gb10_among_multiple_nvidia_devices ... ok + +test result: ok. 10 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running unittests src/lib.rs (target/debug/deps/aienos_aegis-8549be8b0aa8de31) + +running 6 tests +test capability::tests::filesystem_scope_rejects_sibling_and_traversal_paths ... ok +test broker::tests::world_bound_write_uses_delta_and_rollback_discards_it ... ok +test effect::tests::intent_id_distinguishes_parameter_boundaries ... ok +test broker::tests::test_aegis_reversible_vs_irreversible_enforcement ... ok +test broker::tests::claimed_world_cannot_authorize_network_or_escaped_filesystem_effects ... ok +test capability::tests::test_capability_attenuation_and_cascading_revocation ... ok + +test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running tests/phase_3_to_5_integration.rs (target/debug/deps/phase_3_to_5_integration-b5f8a680ff6a79fb) + +running 1 test +test test_full_agent_epistemic_capability_and_c1_lifecycle ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.19s + + Running unittests src/lib.rs (target/debug/deps/aienos_agent_state-158f10fde7b3594d) + +running 22 tests +test id::tests::test_branch_id_derivation ... ok +test id::tests::test_agent_id_determinism ... ok +test history::tests::test_token_history_rolling_hash ... ok +test lineage::tests::test_lineage_extension ... ok +test manager::tests::re_registering_an_existing_identity_does_not_reset_its_root_branch ... ok +test manager::tests::restore_refuses_checkpoint_without_durable_identity ... ok +test manager::tests::test_suspend_resume_lifecycle_and_tamper_rejection ... ok +test manager::tests::restore_rejects_noncontiguous_persisted_fork_indexes ... ok +test manager::tests::restore_round_trips_branches_and_next_fork_indexes_exactly ... ok +test manager::tests::restore_rebuilds_fork_counters_without_reusing_branch_ids ... ok +test manager::tests::restore_rejects_duplicate_agent_identity ... ok +test manager::tests::restore_rejects_parentless_non_root_branch ... ok +test manager::tests::restore_rejects_branch_with_missing_parent ... ok +test manager::tests::re_registering_keeps_forked_branches_and_fork_indexes ... ok +test manager::tests::restore_rejects_missing_root_branch ... ok +test manager::tests::restore_rejects_child_id_not_derived_from_fork_index ... ok +test manager::tests::restore_rejects_branch_of_absent_agent ... ok +test manager::tests::restore_rejects_duplicate_branch_identity ... ok +test manager::tests::test_checkpoint_reboot_and_reconstruction ... ok +test manager::tests::restore_rejects_inconsistent_lineage ... ok +test manager::tests::restore_rejects_inconsistent_root_branch ... ok +test manager::tests::checkpoint_bytes_are_stable_across_restore ... ok + +test result: ok. 22 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.02s + + Running unittests src/lib.rs (target/debug/deps/aienos_artifact-cdcd8a005937d2db) + +running 24 tests +test receipt_tests::canary_failed_decision_and_status_must_agree ... ok +test receipt_tests::decision_consistency_rules_are_enforced ... ok +test receipt_tests::layout_matches_adr_table_offsets ... ok +test receipt_tests::nonce_and_verifier_identity_vectors ... ok +test receipt_tests::optional_fields_require_their_presence_flags ... ok +test receipt_tests::golden_bytes_are_stable ... ok +test receipt_tests::arbitrary_records_never_panic_the_decoder ... ok +test receipt_tests::rejects_length_magic_version_and_sizes ... ok +test receipt_tests::pi5_tier_round_trips_with_its_label ... ok +test tests::authority_attenuation_is_directly_checkable ... ok +test tests::accepts_canonical_artifact_and_exposes_exact_slices ... ok +test tests::rejects_header_and_length_mutations ... ok +test tests::every_truncation_of_a_valid_artifact_is_rejected ... ok +test tests::payload_manifest_and_resource_changes_change_artifact_identity ... ok +test receipt_tests::rejects_unknown_enum_and_code_values ... ok +test tests::rejects_section_entry_capability_resource_and_reserved_mutations ... ok +test tests::signature_bytes_are_not_recursively_included_in_artifact_id ... ok +test receipt_tests::rejects_unknown_flags_and_nonzero_reserved_bytes ... ok +test receipt_tests::encoding_is_deterministic_and_round_trips ... ok +test tests::ed25519_verifier_accepts_rfc8032_pure_signature_vector ... ok +test receipt_tests::unsigned_untrusted_and_production_verification_fail_closed ... ok +test receipt_tests::every_single_bit_change_in_the_signed_range_changes_meaning_or_is_rejected ... ok +test tests::arbitrary_bounded_bytes_never_panic_the_parser ... ok +test receipt_tests::signature_block_is_outside_the_digest_and_fully_authenticated ... ok + +test result: ok. 24 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.12s + + Running unittests src/main.rs (target/debug/deps/aienos_artifact_tool-9e56459db5557344) + +running 2 tests +test tests::deterministic_pack_uses_the_shared_parser_and_id ... ok +test receipt_cmd::tests::check_accepts_only_receipts_that_bind_the_supplied_artifact ... ok + +test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running unittests src/lib.rs (target/debug/deps/aienos_boot-03c1d141b379e741) + +running 4 tests +test wcslen::tests::empty_string_is_zero ... ok +test wcslen::tests::high_unit_values_are_not_terminators ... ok +test wcslen::tests::counts_units_before_first_zero ... ok +test wcslen::tests::stops_at_first_zero_not_slice_end ... ok + +test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running unittests src/lib.rs (target/debug/deps/aienos_c1_tree-1784af35e1503d05) + +running 4 tests +test tree::tests::test_reconstruct_branch_no_page_leak ... ok +test tree::tests::test_transactional_kv_reservation ... ok +test tree::tests::test_concurrent_multithreaded_branching_and_reservations ... ok +test tree::tests::test_zero_memory_increase_on_10k_tokens_fork ... ok + +test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.24s + + Running unittests src/lib.rs (target/debug/deps/aienos_capability-7cada4be6dbd4ee3) + +running 13 tests +test tests::amplification_lease_epoch_and_revoked_ancestor_fail ... ok +test tests::generation_exhaustion_fails_closed ... ok +test tests::forged_stale_subject_resource_and_rights_fail_closed ... ok +test tests::generation_wrap_restarts_and_cognition_cannot_mint ... ok +test tests::high_half_resource_is_kept ... ok +test tests::ordinary_capability_cannot_administer_and_depth_stops ... ok +test tests::privileged_rights_cannot_be_delegated_and_office_stays ... ok +test tests::promote_right_cannot_be_delegated ... ok +test tests::reclaimed_reference_stays_dead_after_restart ... ok +test tests::recycled_slot_does_not_honour_old_reference ... ok +test tests::stale_reference_after_revoke_is_refused ... ok +test tests::restart_refuses_above_an_exhausted_generation ... ok +test tests::unauthorized_capability_use_is_refused ... ok + +test result: ok. 13 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running unittests src/lib.rs (target/debug/deps/aienos_capability_ffi-0df678df0840af8b) + +running 4 tests +test tests::generation_exhaustion_fails_closed ... ok +test tests::stale_and_unauthorized_use_is_refused ... ok +test tests::reclaimed_reference_stays_dead_after_restart ... ok +test tests::layout_matches_the_cap32_contract ... ok + +test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running unittests src/lib.rs (target/debug/deps/aienos_cortex-7c4af692b3926248) + +running 2 tests +test store::tests::test_epistemic_grounding_and_hallucination_rejection ... ok +test store::tests::test_cortex_persistence_and_status_queries ... ok + +test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running unittests src/lib.rs (target/debug/deps/aienos_crypto-5af790ab185ac4fb) + +running 10 tests +test aes::tests::test_aes_256_fips_197_c2 ... ok +test aes::tests::test_constant_time_sbox_matches_fips197_table ... ok +test polyval::tests::test_polyval_rfc8452_appendix_a_worked_example ... ok +test sha256::tests::test_hmac_sha256_rfc4231_case_1 ... ok +test sha256::tests::test_sha256_abc ... ok +test polyval::tests::test_polyval_rfc8452_section_7_dot ... ok +test sha256::tests::test_sha256_empty ... ok +test aes_gcm_siv::tests::public_derived_keys_are_guarded_and_redacted ... ok +test aes_gcm_siv::tests::test_rfc8452_appendix_c_aes256_16byte_pt_0byte_aad ... ok +test aes_gcm_siv::tests::test_rfc8452_appendix_c_aes256_8byte_pt_1byte_aad ... ok + +test result: ok. 10 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running unittests src/lib.rs (target/debug/deps/aienos_evidence-d8215aee6143f1b4) + +running 30 tests +test capture::tests::counts_heterogeneous_cpu_parts ... ok +test canon::tests::key_order_and_whitespace_do_not_change_the_checksum ... ok +test canon::tests::sealed_bundle_verifies_and_any_edit_breaks_it ... ok +test capture::tests::reads_os_release_and_meminfo ... ok +test http::tests::dechunks_bodies_with_extensions ... ok +test http::tests::empty_stream_is_an_error ... ok +test http::tests::parses_endpoints ... ok +test http::tests::stream_timing_uses_first_content_and_usage ... ok +test pe::tests::accepts_arm64_efi_application ... ok +test pe::tests::rejects_wrong_machine_subsystem_and_garbage ... ok +test rollback::tests::duplicated_entry_changes_sequence ... ok +test rollback::tests::added_candidate_entry_outside_order_is_allowed ... ok +test rollback::tests::empty_boot_orders_fail ... ok +test rollback::tests::empty_pre_uuid_is_not_compared ... ok +test rollback::tests::identical_return_passes ... ok +test rollback::tests::missing_values_render_as_none ... ok +test rollback::tests::python_list_repr ... ok +test rollback::tests::read_only_root_or_changed_esp_fails ... ok +test rollback::tests::reordered_or_changed_default_fails ... ok +test rollback::tests::report_lines_match_former_python_rendering ... ok +test rollback::tests::secure_boot_change_is_still_a_violation ... ok +test rollback::tests::secure_boot_is_case_insensitive ... ok +test rollback::tests::secure_boot_off_is_observed_not_blocking ... ok +test rollback::tests::shape_rejects_values_the_verifier_cannot_use ... ok +test rollback::tests::unconsumed_boot_next_fails ... ok +test time::tests::known_instants ... ok +test verify::tests::sound_capture_passes_but_m0_stays_open_until_rollback_is_tested ... ok +test verify::tests::verified_recovery_closes_m0 ... ok +test verify::tests::tampering_dirty_repos_and_toy_workloads_are_rejected ... ok +test capture::tests::streams_file_hash_matches_one_shot_hash ... ok + +test result: ok. 30 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.76s + + Running unittests src/main.rs (target/debug/deps/aienos_evidence-f8f5ed62ab570014) + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running unittests src/lib.rs (target/debug/deps/aienos_explain-79b00631214213e1) + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running unittests src/main.rs (target/debug/deps/aienos_explain-ee23a1331acf4114) + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running tests/explain.rs (target/debug/deps/explain-5a1c8cb3ca31dd39) + +running 16 tests +test contradiction_remains_visible ... ok +test cycle_terminates_and_is_reported ... ok +test malformed_input_fails_safely ... ok +test branch_explanation_uses_only_what_the_branch_depended_on ... ok +test clarification_reads_the_same_bundle ... ok +test branching_support_is_deterministic_regardless_of_input_order ... ok +test token_history_never_enters_the_explanation ... ok +test shared_parent_appears_once ... ok +test missing_parent_stays_missing ... ok +test hypothesis_is_never_rendered_as_fact ... ok +test unsupported_claim_is_flagged ... ok +test cycle_through_imported_cortex_journal_terminates ... ok +test analogy_is_isolated_from_evidence ... ok +test linear_chain_is_ordered_parents_first ... ok +test identical_input_gives_identical_bundle_and_text ... ok +test depth_and_node_limits_bound_the_walk ... ok + +test result: ok. 16 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.08s + + Running tests/rsi_and_cli.rs (target/debug/deps/rsi_and_cli-47e96ebade6cc0c5) + +running 4 tests +test contradiction_disclosed_in_both_directions ... ok +test rsi_fixture_is_pinned ... ok +test rsi_cycle_explains_in_causal_order ... ok +test cli_explains_fixture ... ok + +test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.02s + + Running unittests src/lib.rs (target/debug/deps/aienos_infer-f019ca6909bea73a) + +running 26 tests +test decode::rope_tests::every_head_is_rotated_independently_with_the_same_table ... ok +test decode::rope_tests::score_depends_on_relative_position_only ... ok +test decode::rope_tests::pair_zero_rotates_by_the_position_angle ... ok +test decode::rope_tests::softmax_weights_are_shift_invariant_and_position_sensitive ... ok +test dotprod::tests::q4k_hand_computed_scale_application ... ok +test dotprod::tests::quantize_matches_q8k_round_and_sums ... ok +test dotprod::tests::row_dot_matches_scalar_path_and_checks_lengths ... ok +test dotprod::tests::token_only_when_flag_set ... ok +test half::tests::known_values ... ok +test math::tests::exp_matches_std ... ok +test math::tests::ln_matches_std ... ok +test dotprod::tests::q4k_integer_dot_equals_f32_dot_of_rounded_activations ... ok +test math::tests::powf_rope_theta_scale ... ok +test math::tests::sin_cos_matches_std_and_unit_norm ... ok +test math::tests::sqrt_matches_std ... ok +test quant::tests::length_checks ... ok +test quant::tests::q4k_hand_block ... ok +test quant::tests::q4k_scale_extension_bits ... ok +test quant::tests::q6k_hand_block ... ok +test dotprod::tests::q6k_integer_dot_equals_f32_dot_of_rounded_activations ... ok +test quant::tests::q6k_scales_are_signed_and_per_16 ... ok +test tokenizer::tests::byte_map_is_gpt2 ... ok +test tokenizer::tests::pretokenize_cases ... ok +test tokenizer::tests::pretokenize_covers_input ... ok +test dotprod::tests::sdot_accumulations_are_bit_exact_vs_portable_q4k ... ok +test dotprod::tests::sdot_accumulations_are_bit_exact_vs_portable_q6k ... ok + +test result: ok. 26 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running tests/forward.rs (target/debug/deps/forward-ab44d1dd89820bae) + +running 5 tests +test forward_matches_llama_cpp_q8k_emulation ... ignored, slow; run with --ignored +test decode_round_trips_text ... ok +test tokenization_matches_llama_cpp ... ok +test forward_matches_llama_cpp_dotprod ... ok +test forward_matches_llama_cpp_f32_activations has been running for over 60 seconds +test forward_matches_llama_cpp_f32_activations ... ok + +test result: ok. 4 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 148.59s + + Running tests/golden.rs (target/debug/deps/golden-bd0a1a22ab6375dc) + +running 15 tests +test absurd_counts_and_bad_fields ... ok +test dequantize_rejects_bad_lengths_without_panic ... ok +test q4k_round_trip_error_bound ... ok +test q6k_round_trip_error_bound ... ok +test round_trip_exact_when_grid_aligned ... ok +test small_good_file_parses ... ok +test byte_flip_fuzz_never_panics ... ok +test q4k_matches_ggml_bit_for_bit ... ok +test q6k_matches_ggml_bit_for_bit ... ok +test dot_helpers_match_dequant_then_dot ... ok +test real_type_histogram_and_table_sanity ... ok +test real_header_matches_known_facts ... ok +test every_truncation_is_an_error_not_a_panic ... ok +test real_layer0_dequantizes_to_sane_values ... ok +test real_file_matches_hf_metadata_hash ... ok + +test result: ok. 15 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.07s + + Running unittests src/lib.rs (target/debug/deps/aienos_kernel-d868610635245090) + +running 413 tests +test abi::tests::capability_fails_closed ... ok +test abi::tests::handle_generation_zero_fails_closed ... ok +test abi::tests::envelope_golden ... ok +test abi::tests::capability_golden ... ok +test abi::tests::handle_golden ... ok +test abi::tests::handle_raw_matches_syscall_packing ... ok +test abi::tests::memory_region_golden ... ok +test abi::tests::id_goldens ... ok +test abi::tests::message_golden ... ok +test abi::tests::envelope_fails_closed ... ok +test abi::tests::handle_raw_register_encoding ... ok +test abi::tests::resource_id_golden ... ok +test abi::tests::message_reserved_fields_fail_closed ... ok +test abi::tests::resource_id_rejects_unknown_kind_and_reserved ... ok +test abi::tests::rights_golden ... ok +test abi::tests::rights_reserved_bits_fail_closed ... ok +test abi::tests::rights_convert_with_caps_rights ... ok +test abi::tests::tags_are_distinct_and_round_trip ... ok +test acpi::tests::mcfg_finds_the_ecam_window_for_a_segment_and_bus ... ok +test acpi::tests::extracts_gicd_and_gicr_bases ... ok +test acpi::tests::rejects_bad_checksum_signature_and_lengths ... ok +test acpi::tests::spcr_selects_the_early_uart_driver ... ok +test acpi::tests::reads_xsdt_entry_addresses ... ok +test acpi::tests::counts_gb10_style_heterogeneous_cores_by_efficiency_class ... ok +test acpi::tests::finds_the_boot_core_class_ignoring_mpidr_flag_bits ... ok +test acpi::tests::parses_iort_smmuv3_base_and_pci_stream_mapping ... ok +test acpi::tests::skips_disabled_cores_and_counts_old_entries_as_unknown ... ok +test admission::tests::verified_but_policy_untrusted_signer_is_rejected ... ok +test admission::tests::unapproved_write_receives_no_capability ... ok +test artifact_loader::tests::boot_policy_digest_is_the_policy_the_loader_uses ... ok +test admission::tests::read_write_request_is_reduced_to_policy_read ... ok +test admission::tests::insufficient_resource_snapshot_rejects_before_authorization ... ok +test artifact_loader::tests::code_write_needs_a_permission_fault ... ok +test artifact_loader::tests::exec_nx_needs_a_permission_fault_inside_data_or_stack ... ok +test admission::tests::policy_digest_is_canonical_and_binds_signer_allowlist ... ok +test artifact_loader::tests::candidate_lines_are_stable ... ok +test arch::aarch64::tests::spark_uart_uses_32_bit_16550_register_stride ... ok +test admission::tests::policy_reduces_object_range_and_operation_byte_budgets ... ok +test admission::tests::read_is_granted_and_uses_the_existing_m3_rights_type ... ok +test artifact_loader::tests::ipc_request_exceeds_policy_and_is_rejected ... ok +test artifact_loader::tests::admitted_receipt_binds_identity_and_observed_outcome ... ok +test artifact_loader::tests::code_modified_during_execution_breaks_the_byte_chain ... ok +test artifact_loader::tests::kernel_root_without_free_window_is_a_mapping_failure ... ok +test artifact_loader::tests::full_scheduler_fails_closed_at_admission ... ok +test artifact_loader::tests::audit_rejects_writable_code_and_writable_alias ... ok +test artifact_loader::tests::receipt_line_carries_digest_and_full_record ... ok +test artifact_loader::tests::stage_and_reason_codes_match_adr_0014_section_7_3 ... ok +test artifact_loader::tests::task_layout_rejects_every_bound_violation ... ok +test block::tests::ram_disk_rejects_block_size_that_would_truncate ... ok +test boot::tests::boot_counter_conversion_rejects_invalid_samples ... ok +test boot::tests::early_allocator_retains_region_after_initialization ... ok +test boot::tests::firmware_region_requires_aligned_nonoverflowing_pages ... ok +test budget::tests::each_resource_limit_is_enforced_independently ... ok +test boot::tests::report_lists_gpu_allocator_timing_and_liveness ... ok +test artifact_loader::tests::scheduler_refusal_at_reservation_rolls_back ... ok +test budget::tests::arithmetic_is_overflow_safe_at_u64_limits ... ok +test budget::tests::explicit_policy_switch_changes_forge_allowance ... ok +test budget::tests::releasing_frames_restores_headroom ... ok +test budget::tests::watchdog_is_correct_across_counter_wrap ... ok +test budget::tests::watchdog_pet_expiry_and_sticky_quarantine ... ok +test caps::tests::removing_a_derived_parent_keeps_the_subtree_revocable ... ok +test caps::tests::removing_a_never_derived_capability_frees_its_slot ... ok +test caps::tests::revoke_cascades_two_levels_across_tables ... ok +test caps::tests::revoke_with_single_slot_tables_removes_cross_table_child ... ok +test caps::tests::stale_handle_rejected_after_slot_reuse ... ok +test caps::tests::transfer_needs_grant_and_table_full_is_reported ... ok +test artifact_loader::tests::admitted_task_sees_exact_entry_state_and_is_fully_reclaimed ... ok +test artifact_loader::tests::empty_and_oversized_inputs_are_refused_before_staging ... ok +test artifact_loader::tests::grant_lines_list_exactly_the_installed_grants ... ok +test artifact_loader::tests::staging_reservation_failure ... ok +test caps::tests::generation_exhaustion_retires_slot_without_reviving_old_handle ... ok +test artifact_loader::tests::tampered_payload_is_rejected_before_any_task_frame ... ok +test console::tests::unsupported_spcr_gives_no_console ... ok +test continuity::tests::branch_table_validation_rejects_broken_lineage ... ok +test artifact_loader::tests::unknown_signer_rejected_by_anchors_and_by_policy ... ok +test continuity::continuity_vectors::emitted_vectors_are_canonical ... ok +test artifact_loader::tests::sequential_candidates_reuse_resources_cleanly ... ok +test caps::tests::derive_cannot_add_rights ... ok +test artifact_loader::tests::rejection_receipts_record_earliest_stage_and_only_computed_fields ... ok +test artifact_loader::tests::receipt_flags_follow_observations_not_expectations ... ok +test continuity::tests::wrapping_fork_sum_is_refused_like_the_c_codec ... ok +test continuity::tests::encodings_round_trip_and_reject_tampering ... ok +test continuity::tests::huge_fork_count_with_underivable_child_is_refused_without_spinning ... ok +test crypto::envelope::tests::test_envelope_roundtrip_empty ... ok +test artifact_loader::tests::grants_never_exceed_requests_or_policy ... ok +test continuity::tests::two_roots_stop_with_conflict ... ok +test crypto::envelope::tests::test_expected_envelope_len_overflow_is_error ... ok +test continuity::tests::provisioning_twice_is_refused ... ok +test crypto::envelope::tests::test_hostile_header_at_bound_hits_length_check ... ok +test crypto::envelope::tests::test_envelope_roundtrip_small ... ok +test continuity::tests::unprovisioned_store_never_mints_an_identity ... ok +test crypto::hmac::tests::compare_tags ... ok +test crypto::envelope::tests::test_hostile_header_huge_total_rejected_before_alloc ... ok +test crypto::envelope::tests::test_envelope_cross_store_and_kind_binding ... ok +test crypto::envelope::tests::test_hostile_header_chunk_size_one_huge_count_rejected ... ok +test continuity::tests::provision_then_cold_restart_returns_the_same_identity_and_memory ... ok +test device::tests::activate_installs_translation_before_bus_master ... ok +test device::tests::activation_failure_at_each_step_leaves_bus_master_clear_and_stream_aborted ... ok +test device::tests::activation_records_its_authority ... ok +test device::tests::activation_refused_without_window_or_when_already_active ... ok +test crypto::hmac::tests::rfc4231_cases_1_to_7 ... ok +test device::tests::capability_for_other_resource_is_not_a_device ... ok +test device::tests::duplicate_or_missing_table_in_revoke_set_causes_no_effects ... ok +test device::tests::failed_teardown_blocks_activation_until_a_clean_retry ... ok +test device::tests::map_without_revoke_cannot_tear_down_an_active_device ... ok +test crypto::hkdf::tests::rfc5869_cases_1_to_3 ... ok +test device::tests::missing_capability_causes_no_effects ... ok +test device::tests::read_only_capability_causes_no_effects ... ok +test device::tests::register_rejects_clashes_and_live_devices ... ok +test device::tests::revoke_failure_at_each_step_still_closes_gates_and_revokes ... ok +test device::tests::revoke_forgets_window_so_next_holder_cannot_reuse_it ... ok +test device::tests::revoke_runs_exact_teardown_then_removes_capability_tree ... ok +test device::tests::state_discriminants_are_stable ... ok +test device::tests::sweep_leaves_devices_with_live_authority_alone ... ok +test device::tests::sweep_retries_a_failed_teardown ... ok +test device::tests::sweep_tears_down_after_holder_removes_or_table_is_gone ... ok +test device::tests::sweep_tears_down_when_ancestor_revoked_through_plain_cap_path ... ok +test device::tests::window_validation ... ok +test artifact_loader::tests::main_and_shadow_batch_failures_roll_back ... ok +test display::font::tests::every_glyph_is_five_by_seven_hashes_and_spaces ... ok +test display::font::tests::lowercase_maps_to_uppercase_and_unknown_to_question_mark ... ok +test device::tests::attenuated_capability_without_map_cannot_activate ... ok +test device::tests::activate_with_revoked_handle_fails_without_effects ... ok +test display::font::tests::digits_and_letters_are_distinct ... ok +test display::tests::rejects_geometry_larger_than_the_buffer ... ok +test dma_gate::tests::command_bits ... ok +test dma_gate::tests::failed_smmu_never_falls_back_to_bypass ... ok +test dma_gate::tests::grant_requires_smmu_or_explicit_bypass_without_smmu ... ok +test dma_gate::tests::sweep_clears_endpoints_and_leaves_bridges ... ok +test dma_gate::tests::sweep_reports_a_bus_master_bit_that_will_not_clear ... ok +test dma_gate::tests::sweep_keeps_counting_past_the_recorded_findings ... ok +test edu::tests::full_buffer_transfer_is_allowed ... ok +test edu::tests::interrupt_status_and_acknowledge ... ok +test edu::tests::last_byte_below_the_mask_is_accepted ... ok +test edu::tests::probe_reads_version_and_checks_liveness ... ok +test edu::tests::rejects_bad_lengths_and_addresses_before_touching_the_device ... ok +test edu::tests::round_trips_bytes_through_the_device_buffer ... ok +test edu::tests::times_out_when_the_transfer_never_finishes ... ok +test edu::tests::wider_dma_mask_accepts_higher_addresses ... ok +test edu::tests::spin_budget_covers_a_slow_transfer ... ok +test fatal::tests::access_syndrome_only_when_isv_set ... ok +test fatal::tests::decodes_abort_iss_fields_without_register_access ... ok +test fatal::tests::decodes_vector_slot_and_exception_class ... ok +test gic::tests::distributor_spi_programming_order ... ok +test gic::tests::redistributor_wakes_and_sets_ppi ... ok +test gic::tests::register_offsets_match_gicv3_spec ... ok +test infer::attention::tests::append_rejects_capacity_overflow ... ok +test infer::attention::tests::decode_refuses_wrong_shapes_and_head_counts ... ok +test infer::attention::tests::gqa_maps_groups_of_query_heads_to_kv_heads ... ok +test infer::attention::tests::dense_output_projection_mixes_heads_and_catches_a_permutation ... ok +test infer::attention::tests::one_token_returns_value_exactly ... ok +test edu::tests::blocked_transfer_completes_but_leaves_ram_untouched ... ok +test dma_gate::tests::sweep_walks_multifunction_devices_only_when_marked ... ok +test infer::attention::tests::query_rows_kv_groups_and_head_major_output_decode_from_bands ... ok +test infer::attention::tests::two_head_hand_computed_attention ... ok +test infer::gemm::tests::benchmark_matvec_4096 ... ignored, benchmark +test infer::attention::tests::random_inputs_match_scalar_reference ... ok +test infer::gemm::tests::rms_norm_hand_value ... ok +test infer::gemm::tests::softmax_sums_to_one ... ok +test infer::gemm::tests::strided_vector_matches_reference ... ok +test infer::rope::tests::position_zero_is_identity ... ok +test infer::rope::tests::rotation_preserves_each_pair_norm ... ok +test artifact_loader::tests::corrupted_mapped_bytes_fail_the_read_back_hash ... ok +test infer::rope::tests::sin_cos_matches_std_across_the_circle ... ok +test display::tests::scales_up_on_wide_screens_and_drops_text_past_the_last_row ... ok +test infer::tokenizer::tests::applies_lowest_ranked_merge_first ... ok +test display::tests::draws_glyph_pixels_and_respects_stride_padding ... ok +test crypto::hkdf::tests::length_limit_and_compare ... ok +test infer::tokenizer::tests::matches_special_tokens_before_bpe ... ok +test infer::tokenizer::tests::reports_missing_byte_and_bad_format ... ok +test ipc::tests::ancestor_revocation_reaches_the_derived_child ... ok +test ipc::tests::attenuated_child_cannot_write_or_escalate ... ok +test ipc::tests::channel_is_fifo_and_bounded ... ok +test ipc::tests::delegation_without_derive_right_is_denied ... ok +test ipc::tests::end_to_end_send_delegate_receive_read ... ok +test ipc::tests::message_abi_is_fixed_size_and_unaligned_free ... ok +test ipc::tests::receiver_table_full_rolls_back_cleanly ... ok +test ipc::tests::rights_escalation_is_rejected ... ok +test ipc::tests::send_requires_write_and_receive_requires_read ... ok +test ipc::tests::stale_and_forged_handles_are_invalid ... ok +test mem::frame_allocator::tests::allocator_rejects_unaligned_deallocation ... ok +test mem::frame_allocator::tests::batch_reservation_is_bounded_and_released_as_a_unit ... ok +test mem::frame_allocator::tests::insufficient_batch_reservation_leaves_no_partial_allocations ... ok +test mem::frame_allocator::tests::test_alloc_contiguous ... ok +test mem::frame_allocator::tests::test_allocator_basic ... ok +test mem::map_plan::tests::missing_mat_maps_runtime_code_rx_without_wx ... ok +test mem::map_plan::tests::mmio_is_device_nx_and_overlap_rejected ... ok +test mem::map_plan::tests::register_values_encode_required_fields ... ok +test mem::map_plan::tests::runtime_code_needs_ro_xp_split ... ok +test mem::map_plan::tests::section_permissions_are_wx_safe ... ok +test mem::map_plan::tests::translation_register_values_match_the_architecture ... ok +test mem::map_plan::tests::writable_executable_runtime_code_is_mapped_rx ... ok +test infer::tokenizer::tests::round_trips_ascii_utf8_empty_and_fallback ... ok +test mem::pagetable::tests::access_permission_and_attribute_bits ... ok +test mem::pagetable::tests::descriptor_encodes_attributes_exactly ... ok +test mem::frame_allocator::tests::allocator_rejects_capacity_overflow - should panic ... ok +test mem::pagetable::tests::execute_never_bits_follow_privilege ... ok +test mem::pagetable::tests::fixed_pool_is_bounded_and_never_reuses_released_frames ... ok +test mem::pagetable::tests::flags_round_trip_through_descriptors ... ok +test net::tests::cache_requires_solicited_and_expires ... ok +test net::tests::checksum_vectors ... ok +test net::tests::ipv4_reserved_flag_is_rejected ... ok +test mem::pagetable::tests::device_memory_is_never_executable ... ok +test net::tests::rejects_short_bad_and_fragments ... ok +test net::tests::udp_known_checksum ... ok +test nvme::atomicity::tests::boundary_offset_is_respected ... ok +test nvme::atomicity::tests::controller_fallback_when_namespace_absent ... ok +test nvme::atomicity::tests::boundary_safe_write_accepts ... ok +test nvme::atomicity::tests::empty_write_rejects ... ok +test nvme::atomicity::tests::encoding_edge_zero_and_max ... ok +test console::tests::pl011_writes_when_ready_and_gives_up_when_always_full ... ok +test nvme::atomicity::tests::insufficient_controller_awupf_rejects ... ok +test nvme::atomicity::tests::namespace_zero_falls_back_to_controller ... ok +test nvme::atomicity::tests::read_u16_le_bounds ... ok +test nvme::atomicity::tests::store_root_4096_geometry ... ok +test mem::pagetable::tests::chooses_block_and_page_leaves ... ok +test nvme::atomicity::tests::store_root_512_geometry ... ok +test nvme::atomicity::tests::sufficient_decoded_awupf_accepts ... ok +test nvme::atomicity::tests::sufficient_unit_but_crosses_boundary_rejects ... ok +test nvme::atomicity::tests::unknown_state_fails_closed ... ok +test nvme::atomicity::tests::unsupported_geometry_fails_closed ... ok +test net::tests::ethernet_and_arp_vector ... ok +test nvme::driver::tests::controller_requiring_larger_pages_is_refused ... ok +test nvme::driver::tests::creates_polled_io_queues ... ok +test continuity::tests::forked_or_gapped_manifest_chains_are_corrupt ... ok +test net::tests::ipv4_icmp_ping_vector ... ok +test mem::pagetable::tests::rejects_overlap_wx_and_misalignment ... ok +test mem::pagetable::tests::maps_and_walks_page ... ok +test nvme::driver::tests::explicit_namespace_write_surfaces_device_error ... ok +test mem::pagetable::tests::unmap_removes_leaf ... ok +test nvme::driver::tests::initializes_and_identifies_namespace ... ok +test continuity::tests::degraded_mount_resumes_read_only ... ok +test nvme::atomicity::tests::namespace_override_wins_over_controller ... ok +test nvme::driver::tests::io_queue_depth_above_mqes_is_rejected ... ok +test nvme::driver::tests::readiness_and_completion_errors_are_bounded ... ok +test nvme::driver::tests::invalid_range_has_no_io_command_and_write_completion_error_propagates ... ok +test nvme::driver::tests::block_io_roundtrips_small_and_prp_list_transfers_with_mdts_chunks ... ok +test nvme::tests::command_layouts ... ok +test nvme::tests::completion_phase_wrap_and_empty ... ok +test nvme::driver::tests::simulator_rejects_submission_queue_without_completion_queue ... ok +test nvme::driver::tests::parses_power_fail_atomicity_fields ... ok +test nvme::tests::controller_ready_failure_and_timeout ... ok +test nvme::tests::prp_spans ... ok +test nvme::driver::tests::readiness_wait_honours_cap_timeout ... ok +test nvme::tests::registers_and_doorbells ... ok +test nvme::tests::prp_list_chains_across_list_pages ... ok +test nvme::driver::tests::lbads_below_512_is_invalid_identify ... ok +test pci::tests::probes_bar_sizes_and_restores_state ... ok +test nvme::tests::submission_full_and_wrap ... ok +test pci::tests::read_bar_respects_header_type_and_slots ... ok +test pci::tests::requester_id_packs_bus_device_function ... ok +test pci::tests::functions_in_uses_the_window_bus_range ... ok +test pci::tests::update_command_sets_and_clears_bits_without_touching_status ... ok +test pci::tests::walk_covers_last_bus_and_device_without_overflow ... ok +test pci::tests::decodes_32_and_64_bit_memory_bars_and_io_bars ... ok +test pci::tests::finds_device_by_vendor_and_device_id ... ok +test pe::tests::rejects_truncation_and_invalid_headers ... ok +test pe::tests::rejects_wx_and_overlapping_ranges ... ok +test pci::tests::walk_skips_functions_1_to_7_unless_multi_function ... ok +test pe::tests::unaligned_sections_are_page_rounded_and_shared_pages_overlap ... ok +test pe::tests::valid_sections_use_base_and_page_rounded_max_size ... ok +test recovery::tests::operator_auth_rejects_legacy_bare_sha256_response ... ok +test recovery::tests::test_slot_rollback_on_failure ... ok +test recovery::tests::hmac_primitive_rfc4231_case_2 ... ok +test recovery::tests::test_wal_truncation_on_corruption ... ok +test recovery::tests::operator_auth_rejects_undomained_hmac_and_zero_response ... ok +test recovery::tests::operator_auth_known_answer_accepted ... ok +test recovery::tests::test_wal_zero_length_entry_and_overflow_protection ... ok +test nvme::driver::tests::shallow_io_queue_is_rejected_before_submission ... ok +test arch::aarch64::tests::a_uart_that_never_becomes_ready_is_abandoned_instead_of_hanging ... ok +test report::tests::formats_and_truncates_on_character_boundaries ... ok +test scheduler::tests::background_runs_within_configured_interval_under_latency_load ... ok +test scheduler::tests::empty_queues_and_invalid_cpu_are_handled ... ok +test scheduler::tests::idle_cpu_steals_and_runs_work ... ok +test scheduler::tests::equal_priority_tasks_share_n_ticks_fairly ... ok +test scheduler::tests::latency_keeps_large_majority_of_ticks_with_background_budget ... ok +test scheduler::tests::placement_uses_fast_cores_for_latency_and_efficient_for_background ... ok +test scheduler::tests::priority_prevents_basic_inversion ... ok +test scheduler::tests::removed_tasks_free_their_slot_and_leave_the_queue ... ok +test scheduler::tests::round_robin_placement_and_duplicate_rejection ... ok +test security::tests::test_anti_rollback_decision_matrix ... ok +test recovery_core::tests::malformed_peer_without_a_resolvable_identity_is_not_repaired ... ok +test security::tests::test_subkey_derivation_separation ... ok +test shell::tests::dispatches_report_and_diagnostics ... ok +test security::tests::test_security_manifest_roundtrip_and_mac ... ok +test security::tests::test_keyslot_manifest_roundtrip_and_unwrap ... ok +test shell::tests::parses_commands_and_bounded_arguments ... ok +test smmu::tests::bring_up_cleans_tables_after_writing_before_programming ... ok +test smmu::tests::bring_up_keeps_global_abort_through_smmuen ... ok +test smmu::tests::command_queue_wraps_and_times_out ... ok +test smmu::tests::command_timeout_and_error_fail_closed ... ok +test recovery_core::tests::orphaned_continuity_objects_are_corrupt_not_unprovisioned ... ok +test smmu::tests::gbpa_that_will_not_abort_is_an_error ... ok +test smmu::tests::gbpa_update_timeout_fails_closed ... ok +test smmu::tests::event_reader_decodes_and_consumes_records ... ok +test smmu::tests::descriptor_layouts ... ok +test smmu::tests::command_words_and_queue_wrap ... ok +test smmu::tests::event_reader_acknowledges_overflow ... ok +test smmu::tests::install_and_abort_ste_invalidate_that_stream ... ok +test smmu::tests::smmuen_ack_failure_fails_closed ... ok +test smmu::tests::unsupported_hardware_or_bad_sid_fails_closed ... ok +test smmu::tests::tables_reject_misaligned_or_bad_geometry ... ok +test smmu::tests::submit_refuses_to_overwrite_a_full_queue ... ok +test smmu::tests::policy_maps_only_allowed_windows ... ok +test continuity::tests::a_crash_at_every_write_of_a_commit_leaves_old_or_new_never_a_third_state ... ok +test recovery_core::tests::challenges_bind_state_and_action ... ok +test store::engine::tests::store_generation_overflow_zero_writes ... ok +test store::engine::tests::store_checkpoint_order_does_not_change_persistent_bytes ... ok +test store::engine::tests::store_full_graph_validation_rejects_damaged_payload_and_keeps_io_distinct ... ok +test store::engine::tests::store_history_rejects_deleting_an_old_catalog_entry ... ok +test recovery_core::tests::identity_lost_in_the_newest_root_never_looks_unprovisioned ... ok +test recovery_core::tests::identity_loss_through_corruption_offers_no_action_that_mints ... ok +test store::engine::tests::store_io_fail_closed ... ok +test recovery::tests::operator_auth_rejects_any_single_bit_flip ... ok +test store::engine::tests::store_dedup_corruption_and_descriptor_conflict_fail_before_writes ... ok +test store::engine::tests::store_open_side_effect_free ... ok +test store::engine::tests::store_mount_classification_is_deterministic ... ok +test store::tests::block_store_rejects_wrong_magic ... ok +test store::tests::block_store_rejects_corrupt_in_memory_length_without_panicking ... ok +test store::tests::block_store_persists_reopens_and_falls_back_from_bad_copy ... ok +test store::tests::test_content_addressed_extent_storage ... ok +test store::tests::test_slice_store_operations_and_boundaries ... ok +test artifact_loader::tests::sealed_address_space_is_wx_with_read_only_code_alias ... ok +test store::v1::tests::malformed_object_catalog_and_extent_vectors_are_rejected ... ok +test store::v1::tests::object_id_and_catalog_vectors_match_adr_0015 ... ok +test sync::spinlock::tests::test_spinlock_basic ... ok +test recovery_core::tests::inspection_never_writes_and_names_the_reason ... ok +test store::v1::tests::malformed_generation_high_water_and_superblock_bytes_are_rejected ... ok +test sync::spinlock::tests::test_spinlock_try_lock ... ok +test task_runtime::tests::deadline_uses_tighter_budget_and_survives_counter_wrap ... ok +test task_runtime::tests::denials_are_classified_from_observed_lookups ... ok +test task_runtime::tests::granted_read_returns_object_word_and_charges_budget ... ok +test store::engine::tests::store_nospace_zero_writes ... ok +test task_runtime::tests::read_outside_grant_range_or_object_or_unaligned_is_denied ... ok +test task_runtime::tests::read_past_operation_budget_is_denied ... ok +test task_runtime::tests::syscall_after_deadline_times_out ... ok +test task_runtime::tests::unknown_syscall_and_nonzero_immediate_terminate ... ok +test store::v1::tests::commit_superblock_genesis_and_adjacent_vectors_match_adr_0015 ... ok +test task_runtime::tests::write_with_write_right_updates_kernel_copy ... ok +test task_runtime::tests::write_without_write_right_is_denied_and_object_unchanged ... ok +test thread::tests::placement_fills_lowest_class_first_then_wraps ... ok +test thread::tests::context_offsets_match_assembly_layout ... ok +test task_runtime::tests::syscall_budget_overrun_terminates ... ok +test task_runtime::tests::forged_stale_and_unbacked_handles_are_denied ... ok +test thread::tests::stack_setup_aligns_sp_and_records_trampoline_arguments ... ok +test thread::tests::placement_of_empty_topology_is_unplaced ... ok +test thread::tests::trap_frame_layout_matches_800_bytes_and_16_byte_alignment ... ok +test timer::tests::conversion_rounding_and_frequency_validation ... ok +test timer::tests::deadline_detects_overflow ... ok +test thread::tests::trap_frame_setup_aligns_and_initializes_registers ... ok +test uefi::tests::honors_48_and_56_byte_descriptor_strides ... ok +test store::engine::tests::store_peer_condition_reports_open_classification ... ok +test uefi::tests::rejects_truncated_and_short_descriptors ... ok +test task_runtime::tests::read_past_byte_budget_is_denied ... ok +test usb::audio::tests::isoch_schedule_stays_ahead_and_wraps_frame_id ... ok +test usb::audio::tests::oversized_packet_is_not_truncated_and_zero_stride_schedules_nothing ... ok +test usb::audio::tests::parses_uac1_and_uac2 ... ok +test usb::audio::tests::short_uac1_format_descriptor_does_not_panic ... ok +test usb::audio::tests::ring_wraps_and_tone_is_bounded ... ok +test usb::audio::tests::uac1_channels_come_from_format_type_not_as_general_delay ... ok +test usb::descriptor::tests::reads_the_control_packet_size_from_a_device_descriptor ... ok +test usb::descriptor::tests::skips_a_mouse_interface_and_out_endpoints_in_a_composite_device ... ok +test usb::descriptor::tests::stops_at_total_length_and_malformed_descriptors ... ok +test usb::hid::tests::control_keys_and_arrows ... ok +test usb::hid::tests::letter_make_and_release_produces_one_character ... ok +test usb::hid::tests::punctuation_and_space_decode ... ok +test usb::hid::tests::rollover_error_and_wrong_length_are_ignored ... ok +test usb::hid::tests::shift_and_digits_use_the_shifted_column ... ok +test usb::hid::tests::sink_truncates_instead_of_overflowing ... ok +test usb::hid::tests::unmapped_usages_are_dropped ... ok +test usb::xhci::context::tests::address_device_context_puts_port_and_endpoint_zero_in_place ... ok +test usb::xhci::context::tests::endpoint_addresses_map_to_device_context_indexes ... ok +test usb::xhci::context::tests::interval_converts_frames_and_exponents_to_125us_units ... ok +test usb::xhci::context::tests::isoch_interval_and_high_bandwidth_burst ... ok +test usb::xhci::context::tests::isochronous_out_endpoint_fields_encode_in_context ... ok +test usb::xhci::context::tests::large_contexts_double_the_stride_and_bad_sizes_are_refused ... ok +test usb::xhci::ring::tests::controller_sees_every_push_in_order_across_many_wraps ... ok +test usb::xhci::ring::tests::dequeue_pointer_carries_the_cycle_state_and_flips_after_the_link ... ok +test usb::xhci::ring::tests::event_ring_consumes_matching_cycles_and_wraps_without_a_link ... ok +test usb::xhci::tests::capabilities_decode_qemu_xhci_registers ... ok +test usb::xhci::tests::capabilities_decode_scratchpads_large_contexts_and_reject_absent_blocks ... ok +test usb::xhci::tests::portsc_neutral_never_disables_the_port_or_acks_changes ... ok +test usb::xhci::tests::recognizes_xhci_class_and_memory_bars ... ok +test usb::xhci::tests::rejects_other_classes_io_and_unprogrammed_bars ... ok +test usb::xhci::trb::tests::command_trbs_place_slot_and_input_context ... ok +test recovery_core::tests::provisioning_is_operator_only_and_only_on_an_unprovisioned_store ... ok +test usb::xhci::trb::tests::control_stages_carry_idt_transfer_type_and_directions ... ok +test task_runtime::tests::non_object_or_other_object_grant_is_denied ... ok +test usb::xhci::trb::tests::event_fields_decode_from_their_bit_positions ... ok +test usb::xhci::trb::tests::isoch_trb_encodes_frame_id_and_batch_flags ... ok +test usb::xhci::trb::tests::normal_trb_asks_for_an_event_on_short_reports ... ok +test usb::xhci::trb::tests::trb_is_sixteen_bytes_and_sixteen_aligned ... ok +test user::tests::capability_handle_round_trips ... ok +test user::tests::el0_mapping_attributes_are_wx_and_non_global ... ok +test user::tests::trap_frame_layout_matches_assembly ... ok +test usb::audio::tests::stereo_44100_scheduler_emits_one_second_of_pcm_bytes ... ok +test virtio_net::tests::parses_modern_virtio_net_capabilities ... ok +test virtio_net::tests::rejects_loops_and_short_vendor_capabilities ... ok +test usb::audio::tests::fractional_44100_packet_pattern_totals_one_second ... ok +test usb::descriptor::tests::finds_the_keyboard_interrupt_in_endpoint ... ok +test usb::xhci::trb::tests::setup_packet_bytes_match_the_usb_wire_order ... ok +test store::engine::tests::store_transaction_commit_dedup_and_tail_reuse ... ok +test store::engine::tests::store_malformed_peer_recovery_matrix ... ok +test store::engine::tests::store_history_matrix_equivalent_and_adjacent_roots ... ok +test recovery_core::tests::degraded_repair_needs_the_operator_and_restores_a_writable_store ... ok +test infer::gemm::tests::products_match_reference_odd_and_even ... ok +test store::tests::block_store_crash_boundaries_keep_old_or_new_commit ... ok +test store::engine::tests::store_catalogfull_zero_writes ... ok +test crypto::envelope::tests::tampered_late_chunk_rejects_the_entire_plaintext ... ok +test crypto::envelope::tests::test_envelope_roundtrip_multi_chunk ... ok +test artifact_loader::tests::largest_envelope_loads_in_one_l3_table ... ok +test continuity::tests::branch_table_at_the_maximum_legal_fork_sum_is_accepted ... ok +test continuity::continuity_vectors::committed_fixtures_match_the_oracle ... ok + +test result: ok. 412 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.62s + + Running tests/nvme_completion.rs (target/debug/deps/nvme_completion-dafc6afe36974715) + +running 14 tests +test admin_status_word_decodes_exact_sc_and_sct ... ok +test completion_accessors_decode_little_endian_fields ... ok +test admin_command_id_mismatch_reports_invalid_identify ... ok +test completion_queue_phase_flips_at_depth_eight ... ok +test admin_cq_phase_flips_when_head_wraps_at_depth_eight ... ok +test controller_fatal_status_maps_to_controller_failed ... ok +test controller_never_ready_maps_to_controller_timeout ... ok +test admin_timeout_is_bounded_no_infinite_loop ... ok +test io_command_id_mismatch_reports_device_error ... ok +test io_cq_wraparound_consumes_completions_in_order ... ok +test io_nonzero_status_maps_to_device_error ... ok +test malformed_completions_do_not_panic ... ok +test stale_phase_completion_is_skipped_and_matching_one_consumed ... ok +test io_timeout_is_bounded_no_infinite_loop ... ok + +test result: ok. 14 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running tests/nvme_flush.rs (target/debug/deps/nvme_flush-592b420dc2ed9f8b) + +running 6 tests +test flush_after_write_in_same_session_uses_fresh_cid ... ok +test flush_submits_opcode_zero_nsid_one_without_data_pointer ... ok +test flush_is_not_a_silent_no_op_doorbell_and_command_reach_device ... ok +test successful_flush_completion_returns_ok ... ok +test nonzero_flush_completion_status_returns_device_error ... ok +test flush_timeout_returns_timeout_and_is_bounded ... ok + +test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running tests/nvme_identify.rs (target/debug/deps/nvme_identify-a2be85435664a0af) + +running 9 tests +test init_identifies_namespace_and_capacity_round_trips ... ok +test lbads_9_and_12_map_to_block_sizes ... ok +test mdts_255_shift_does_not_panic ... ok +test maximum_flbas_descriptor_offset_stays_in_bounds ... ok +test lbads_at_or_above_32_is_invalid_identify ... ok +test nonzero_flbas_selects_its_own_descriptor ... ok +test nsid_zero_identify_does_not_panic ... ok +test zero_block_count_is_invalid_identify ... ok +test mdts_byte_77_controls_transfer_chunking ... ok + +test result: ok. 9 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running tests/nvme_prp.rs (target/debug/deps/nvme_prp-dd973e4fd7815701) + +running 14 tests +test invalid_non_power_of_two_page_size ... ok +test invalid_zero_length_and_page_size ... ok +test list_buffer_too_small_is_bounded ... ok +test max_address_short_length_is_invalid_without_panic ... ok +test multi_page_requires_aligned_nonzero_list ... ok +test list_page_chaining_4k_exact_used ... ok +test one_page_boundary_crossing ... ok +test page_boundaries_64k ... ok +test single_page_aligned_and_unaligned ... ok +test prp_values_are_full_physical_addresses ... ok +test transfer_limit_arithmetic_is_bounded ... ok +test two_pages_use_prp2_with_zero_used ... ok +test offset_plus_length_overflow_is_invalid ... ok +test list_page_chaining_64k_exact_used ... ok + +test result: ok. 14 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running tests/nvme_write.rs (target/debug/deps/nvme_write-244f9e3fbc2a458c) + +running 9 tests +test each_io_command_gets_a_new_cid_and_completion_is_consumed ... ok +test empty_and_non_block_multiple_buffers_are_invalid_input ... ok +test nonzero_write_completion_maps_to_device_error ... ok +test offset_write_splits_lba_across_cdw10_and_cdw11 ... ok +test write_one_block_encodes_opcode_nsid_lba_nlb_and_prp1 ... ok +test write_eight_blocks_is_one_command_with_nlb_seven ... ok +test write_past_block_count_is_out_of_range_without_io_submission ... ok +test written_bytes_read_back_exactly ... ok +test mdts_chunking_submits_per_chunk_commands_with_correct_lba_and_nlb ... ok + +test result: ok. 9 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running tests/nvme_write_completion.rs (target/debug/deps/nvme_write_completion-05ceb97712eccfdb) + +running 8 tests +test failed_flush_completion_maps_to_device_error ... ok +test failed_write_completion_maps_to_device_error ... ok +test invalid_namespace_identify_surfaces_completion_status ... ok +test write_batch_cq_wraparound_flips_phase_and_consumes_in_order ... ok +test write_command_id_mismatch_maps_to_device_error ... ok +test flush_timeout_is_bounded_no_infinite_loop ... ok +test wrong_phase_zero_completion_is_ignored_not_consumed ... ok +test write_timeout_is_bounded_no_infinite_loop ... ok + +test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running tests/nvme_write_prp.rs (target/debug/deps/nvme_write_prp-49d57198a86480f2) + +running 14 tests +test address_near_u64_max_is_invalid_without_panic_or_wrap ... ok +test flush_submits_opcode_zero_command ... ok +test list_address_zero_or_unaligned_is_invalid_for_list_cases ... ok +test offset_plus_length_overflow_is_invalid ... ok +test multi_block_write_crossing_page_emits_prp2 ... ok +test one_block_aligned_write_is_single_prp1_page ... ok +test unaligned_prp1_spans_pages_correctly ... ok +test write_crossing_page_boundary_uses_prp1_and_prp2 ... ok +test write_one_aligned_block_carries_single_prp1 ... ok +test write_page_list_chains_at_4k_exact_entries ... ok +test write_past_namespace_end_is_rejected_before_any_command ... ok +test write_spanning_three_pages_uses_prp_list ... ok +test write_larger_than_mdts_is_split_into_commands ... ok +test write_page_list_chains_at_64k_exact_entries ... ok + +test result: ok. 14 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running tests/store_v1_golden_vectors.rs (target/debug/deps/store_v1_golden_vectors-f6fdbcdb080f13e9) + +running 8 tests +test crc32c_check_value ... ok +test one_entry_catalog ... ok +test object_id ... ok +test top_level_is_the_frozen_schema ... ok +test empty_catalog ... ok +test adjacent_generations ... ok +test genesis ... ok +test equivalent_roots ... ok + +test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s + + Running tests/store_v1_negative.rs (target/debug/deps/store_v1_negative-7a130c126f2edc56) + +running 10 tests +test catalog_entry_bounds_reject_metadata_overflow_and_high_water_violations ... ok +test catalog_extents_reject_overlap_and_metadata_overlap ... ok +test catalog_rejects_bad_header_counts_and_exact_lengths ... ok +test catalog_rejects_entry_reserved_flags_and_invalid_lengths ... ok +test catalog_rejects_unsorted_and_duplicate_object_ids ... ok +test commit_record_rejects_lengths_features_generation_and_high_water ... ok +test generation_link_requires_adjacent_generation_and_exact_predecessor_ids ... ok +test superblock_commit_validation_binds_commit_unit_catalog_and_high_water ... ok +test object_id_rejects_semantic_mutation_wrong_identity_and_nonzero_padding ... ok +test crc32c_known_answer_and_superblock_rejects_corruption_reserved_and_slot ... ok + +test result: ok. 10 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.54s + + Running unittests src/main.rs (target/debug/deps/aienos_store_tool-03e09a0e1ba60bc3) + +running 2 tests +test tests::garbage_is_stable_and_not_a_superblock ... ok +test tests::tear_outcomes_detects_a_third_state ... ok + +test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running unittests src/main.rs (target/debug/deps/allen_courier-e491f6ef3b9d347e) + +running 26 tests +test code::tests::a_sentence_and_a_fenced_block_are_read ... ok +test code::tests::an_unclosed_block_runs_to_the_end_and_no_block_is_none ... ok +test code::tests::crc_is_zlibs ... ok +test code::tests::short_names_and_odd_bytes_are_made_plain ... ok +test plain_tests::a_cut_answer_stays_within_the_room_with_its_mark ... ok +test key_tests::no_key_sends_no_header_and_https_is_refused_out_loud ... FAILED +test key_tests::a_good_key_is_sent_once_as_a_bearer_and_the_first_model_comes_back ... FAILED +test tests::a_busy_server_is_asked_again_with_growing_waits ... ok +test key_tests::claude_gets_its_own_headers_and_a_refused_key_says_so ... FAILED +test tests::a_busy_server_names_its_wait_exactly ... ok +test plain_tests::typographic_marks_become_plain_ones ... ok +test code::tests::long_code_is_cut_at_a_line_within_the_limits ... ok +test tests::a_code_reply_becomes_pieces_and_a_closing_sentence ... ok +test tests::a_job_line_carries_the_memory_fields ... ok +test tests::chunked_bodies_are_joined ... ok +test tests::datagram_heads_round_trip ... ok +test tests::a_sentence_end_too_early_is_not_used ... ok +test tests::dates_are_civil ... ok +test tests::json_strings_round_trip ... ok +test tests::long_answers_are_cut_at_a_sentence_end ... ok +test tests::saved_exchanges_reach_the_model_as_ordered_conversation_turns ... FAILED +test tests::short_answers_pass_whole_with_whitespace_folded ... ok +test tests::the_assistant_text_is_found_in_a_chat_completion ... ok +test tests::what_was_already_said_in_parts_is_kept ... ok +test tests::words_on_the_wire ... ok +test code::tests::pieces_carry_length_checksum_and_escapes ... ok + +failures: + +---- key_tests::no_key_sends_no_header_and_https_is_refused_out_loud stdout ---- + +thread 'key_tests::no_key_sends_no_header_and_https_is_refused_out_loud' (6774) panicked at crates/allen-courier/src/main.rs:1893:50: +called `Result::unwrap()` on an `Err` value: Os { code: 1, kind: PermissionDenied, message: "Operation not permitted" } + +---- key_tests::a_good_key_is_sent_once_as_a_bearer_and_the_first_model_comes_back stdout ---- + +thread 'key_tests::a_good_key_is_sent_once_as_a_bearer_and_the_first_model_comes_back' (6772) panicked at crates/allen-courier/src/main.rs:1893:50: +called `Result::unwrap()` on an `Err` value: Os { code: 1, kind: PermissionDenied, message: "Operation not permitted" } +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace + +---- key_tests::claude_gets_its_own_headers_and_a_refused_key_says_so stdout ---- + +thread 'key_tests::claude_gets_its_own_headers_and_a_refused_key_says_so' (6773) panicked at crates/allen-courier/src/main.rs:1893:50: +called `Result::unwrap()` on an `Err` value: Os { code: 1, kind: PermissionDenied, message: "Operation not permitted" } + +---- tests::saved_exchanges_reach_the_model_as_ordered_conversation_turns stdout ---- + +thread 'tests::saved_exchanges_reach_the_model_as_ordered_conversation_turns' (6787) panicked at crates/allen-courier/src/main.rs:1719:57: +called `Result::unwrap()` on an `Err` value: Os { code: 1, kind: PermissionDenied, message: "Operation not permitted" } + + +failures: + key_tests::a_good_key_is_sent_once_as_a_bearer_and_the_first_model_comes_back + key_tests::claude_gets_its_own_headers_and_a_refused_key_says_so + key_tests::no_key_sends_no_header_and_https_is_refused_out_loud + tests::saved_exchanges_reach_the_model_as_ordered_conversation_turns + +test result: FAILED. 22 passed; 4 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s + +error: test failed, to rerun pass `-p allen-courier --bin allen-courier` diff --git a/evidence/allen-omega-L694/view2.txt b/evidence/allen-omega-L694/view2.txt new file mode 100644 index 00000000..8b194f11 --- /dev/null +++ b/evidence/allen-omega-L694/view2.txt @@ -0,0 +1,13 @@ +901 0 +902 0 +903 0 +904 0 +905 0 +906 0 +907 0 +908 0 +909 0 +910 0 +911 0 +912 0 +913 0 diff --git a/evidence/allen-portable-build-20261023/README.md b/evidence/allen-portable-build-20261023/README.md new file mode 100644 index 00000000..dba6e42f --- /dev/null +++ b/evidence/allen-portable-build-20261023/README.md @@ -0,0 +1,46 @@ +# Allen portable compiler build qualification + +Base: aienos/aienux `f52f17a9e9520c1d16ba4d30aa8ee3bda8ee12a5`. +Compiler source: omega-bridge `0fc7d8662cb799e7c206b17c18ea4c3ec2b8fea9`. +Platform: Linux AArch64 on Spark. No live services or hardware configuration changed. + +## Executed + +- RED: the original build followed a dangling output link and published through + it. `red.log` exits 1 after the existing-output check. The relocated-compiler + probe alone did not establish selection: the original ignored the setting. +- One test setup attempt could not append to a read-only copied compiler. + `fixture-setup-failure.log` records it. The test now makes its private copy + writable before corrupting it; this was not a production failure. +- GREEN: the complete component gate includes the relocated-compiler probe, + existing-file preservation, dangling-link refusal, corrupt compiler refusal, + failed compilation leaving no output, absent compiler/argument refusal and + temporary-file cleanup. `host-gate.log`, exit 0. +- Rebuilt the original Omega compiler from its exact Git source archive using + `quiet-build sh tools/bootstrap.sh --offline`. `bootstrap.log`, exit 0. +- Replayed the complete Allen gate in a clean exported source directory using + the repository-local default compiler location, with no `OMEGA_COMPILER` + override and no private handoff compiler. Native modules, golden bytes, + provider stream/fragment/refusal checks and all 24 compiled mutants pass. +- After Drake explicitly authorized publication, Allen and omega-bridge became + public on 2026-10-23. Anonymous GitHub API reads verified both. Downloaded the + pinned compiler tarball without credentials and independently rebuilt it; + `public-bootstrap.log`, exit 0. Its digest equals the original compiler pin. +- `git diff --check` and `sh -n` for the three changed build scripts pass. + +Source and artifact digests are in `source.sha256` and `artifacts.sha256`. +The broader repository verification is separate from these component results; +its eventual result must be recorded before claiming repository-wide qualification. + +## Scope limits + +The bootstrap proves source reconstruction and self-rebuild equality, not +independent diverse compiler ancestry. These checks do not qualify a hosted +window/input loop, live inference, durable device storage, x86/macOS/EFI output, +native boot or a physical iMac trial. Public source availability is PASS; +the interactive Alpha 1.0 release is not complete. No release tag was created. + +Author review: compiler digest remains fixed; compilation and ELF inspection +must succeed before atomic no-replace publication; existing output links and +files are refused; transient files are removed on failure. Independent source +review remains pending with the publication desk. diff --git a/evidence/allen-portable-build-20261023/artifacts.sha256 b/evidence/allen-portable-build-20261023/artifacts.sha256 new file mode 100644 index 00000000..dba34560 --- /dev/null +++ b/evidence/allen-portable-build-20261023/artifacts.sha256 @@ -0,0 +1,3 @@ +191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9 /tmp/allen-source-replay-20261023/allen/build/allen-toolchain/build/bootstrap/omc +7920f4faf33ee312a4e40bd059cfbd596ed6dde41a4d72e3d7b841762ab961a1 /tmp/allen-source-replay-20261023/allen/final-output/provider +676f3d56de19603e07766f2b859b58a55090071cb4a43081b4e7800031872066 /tmp/allen-source-replay-20261023/allen/final-output/provider-surface.ppm diff --git a/evidence/allen-portable-build-20261023/bootstrap.log b/evidence/allen-portable-build-20261023/bootstrap.log new file mode 100644 index 00000000..be820a3f --- /dev/null +++ b/evidence/allen-portable-build-20261023/bootstrap.log @@ -0,0 +1 @@ +PASS source-only seed bootstrap and compiler fixpoint diff --git a/evidence/allen-portable-build-20261023/fixture-setup-failure.log b/evidence/allen-portable-build-20261023/fixture-setup-failure.log new file mode 100644 index 00000000..819c9d22 --- /dev/null +++ b/evidence/allen-portable-build-20261023/fixture-setup-failure.log @@ -0,0 +1,6 @@ +PASS relocated compiler and actual native program +fresh output required +PASS existing output preserved +fresh output required +PASS dangling output link refused +native/omega/allen/test-build.sh: 29: cannot create /tmp/allen-portable-green-20261023/compiler with spaces: Permission denied diff --git a/evidence/allen-portable-build-20261023/host-gate.log b/evidence/allen-portable-build-20261023/host-gate.log new file mode 100644 index 00000000..9931d0bf --- /dev/null +++ b/evidence/allen-portable-build-20261023/host-gate.log @@ -0,0 +1,72 @@ +PASS relocated compiler and actual native program +fresh output required +PASS existing output preserved +fresh output required +PASS dangling output link refused +compiler digest differs from the qualified pin +PASS changed compiler refused before output creation +omc: line 3: error 4 +PASS failed compilation publishes no executable +usage: build-one.sh SOURCE OUTPUT +pinned compiler missing; follow native/omega/allen/README.md +PASS missing compiler and missing argument refused +PASS no temporary build files retained +runtime compile=0 native-exit=0 +code compile=0 native-exit=0 +courier compile=0 native-exit=0 +scheduler compile=0 native-exit=0 +application compile=0 native-exit=0 +provider-core compile=0 native-exit=0 +presentation compile=0 native-exit=0 +font compile=0 native-exit=0 +surface compile=0 native-exit=0 +memory compile=0 native-exit=0 +context compile=0 native-exit=0 +intent compile=0 native-exit=0 +reply compile=0 native-exit=0 +view compile=0 native-exit=0 +scene compile=0 native-exit=0 +scene-input compile=0 native-exit=0 +paint compile=0 native-exit=0 +edges compile=0 native-exit=0 +fixture compile=0 native-exit=0 +golden compile=0 native-exit=0 +render compile=0 native-exit=0 +font-output compile=0 native-exit=0 +font-render compile=0 native-exit=0 +surface-render compile=0 native-exit=0 +font native masks match frozen external legacy oracle +stdio native-exit=0 golden-cmp=0 +stdio overflow native-exit=65 no-later-command=PASS +provider malformed mode=1 exit=65 no-later-command=PASS +provider malformed mode=2 exit=65 no-later-command=PASS +provider malformed mode=3 exit=65 no-later-command=PASS +provider malformed mode=4 exit=65 no-later-command=PASS +provider malformed mode=5 exit=65 no-later-command=PASS +provider malformed mode=6 exit=65 no-later-command=PASS +provider native-exit=0 fragmented-pipe=0 output-verifier=0 +stale mutant compile=0 rejected-exit=3 +crc mutant compile=0 rejected-exit=2 +hash mutant compile=0 rejected-exit=2 +readback mutant compile=0 rejected-exit=7 +session mutant compile=0 rejected-exit=1 +keepalive mutant compile=0 rejected-exit=40 +ackstop mutant compile=0 rejected-exit=27 +pendingwire mutant compile=0 rejected-exit=1 +appcode mutant compile=0 rejected-exit=3 +thinking mutant compile=0 rejected-exit=6 +scenecap mutant compile=0 rejected-exit=3 +contextnote mutant compile=0 rejected-exit=5 +contextjob mutant compile=0 rejected-exit=36 +autosent mutant compile=0 rejected-exit=1 +framecheck mutant compile=0 rejected-exit=1 +staleview mutant compile=0 rejected-exit=1 +inputtail mutant compile=0 rejected-exit=1 +fontroot mutant compile=0 rejected-exit=1 +fontalpha mutant compile=0 rejected-exit=1 +rawask mutant compile=0 rejected-exit=1 +rawrecv mutant compile=0 rejected-exit=1 +rawreset mutant compile=0 rejected-exit=1 +clipright mutant compile=0 rejected-exit=1 +blendbg mutant compile=0 rejected-exit=1 +ALLEN_OMEGA_HOST: PASS; target=NOT_RUN; live=NOT_RUN diff --git a/evidence/allen-portable-build-20261023/public-bootstrap.log b/evidence/allen-portable-build-20261023/public-bootstrap.log new file mode 100644 index 00000000..be820a3f --- /dev/null +++ b/evidence/allen-portable-build-20261023/public-bootstrap.log @@ -0,0 +1 @@ +PASS source-only seed bootstrap and compiler fixpoint diff --git a/evidence/allen-portable-build-20261023/red.log b/evidence/allen-portable-build-20261023/red.log new file mode 100644 index 00000000..2fe13e81 --- /dev/null +++ b/evidence/allen-portable-build-20261023/red.log @@ -0,0 +1,3 @@ +PASS relocated compiler and actual native program +fresh output required +PASS existing output preserved diff --git a/evidence/allen-portable-build-20261023/source.sha256 b/evidence/allen-portable-build-20261023/source.sha256 new file mode 100644 index 00000000..63d03825 --- /dev/null +++ b/evidence/allen-portable-build-20261023/source.sha256 @@ -0,0 +1,4 @@ +4023744d3f3009327cd0a94f0f4373cfb5a91bc7cb1f6144dddc0a8f28ddbbe8 native/omega/allen/build-one.sh +314553cfe714f1bc85767d1add35b03de826d08bdee8d4993991451dbf97e546 native/omega/allen/gate.sh +2c1cc34edcf091717b10c5c39118f6ff59af41ccb1c844170e7a30140c5cee32 native/omega/allen/test-build.sh +213fc47c365767db8a12cbd22ef0cec4a6bbb61c34ee3daae9b8182a122da8f4 native/omega/allen/tests/build-probe.om diff --git a/native/.crumb b/native/.crumb index 83c71823..7b208ec2 100644 --- a/native/.crumb +++ b/native/.crumb @@ -56,7 +56,7 @@ }, { "digest": "52e6a6fd88b4494a709eb8807fcc13736cd2286ee4f529f3d0facb104f4e2627", - "last_commit": "800595d0", + "last_commit": "5e0c7970", "name": "boot", "purpose": "Directory native/boot. Purpose not yet described by a human." }, @@ -79,8 +79,8 @@ "purpose": "Directory native/disk. Purpose not yet described by a human." }, { - "digest": "3c10adfc819ba82707e4d8ddc996fadd9d7408f6b4017353aedd5e31d448639e", - "last_commit": "f26a7a2f", + "digest": "af273c64a35fb82517e60ba5feea763c5ee416443ae7f9a48bc3a20b29ddc481", + "last_commit": "432c9447", "name": "kernel", "purpose": "Directory native/kernel. Purpose not yet described by a human." }, @@ -97,8 +97,8 @@ "purpose": "Directory native/net. Purpose not yet described by a human." }, { - "digest": "f3c7ee4f18f768fa9964c123e07f076c544c58c0966a8a5e9571b0397bf57b06", - "last_commit": "c93a5f57", + "digest": "6a2dad3c256c6f916442b3256f3eabc05da9ea6a82114256aec43f53e75fc2cd", + "last_commit": "a14aa34c", "name": "omega", "purpose": "Seeded Omega native modules" }, @@ -115,15 +115,15 @@ "purpose": "Directory native/store. Purpose not yet described by a human." } ], - "children_root": "sha256:55d63319aaf74dda6aedad3236cc4a8b8737062d30c89402a2654762e1a53cbe", - "compiled_at": "2026-11-06T12:57:47Z", + "children_root": "sha256:2fcf34c940bbdc6d6d426e1610847be64c3d9b5ceae3d455c51af26c0c89f3e3", + "compiled_at": "2026-11-06T15:04:49Z", "compiler": "crumb-compile/1", - "digest": "sha256:45c897a7055a0c25a1ee482e5dd8674f527bc91d12bae901c9e73ed3ada3d7d2", + "digest": "sha256:773512413893fb607ea2e93c237b7ec15c3c55d8c656e8224a42b92b6bf0a6e5", "evidence_files": 24, "evidence_root": "sha256:ecc7ccf2e924c221a5bac1d91e23b13d8f3c8d78c2a893a882ed7ca5e88d855d", - "files": 901, - "generated_at_commit": "f26a7a2fe1dbd0632b1b9fcaeacb6d18ec8707e8", - "source_tree": "sha256:e1edd726cecca8741ed09d0e18d4908e321ad4a257dcfa616698f43165fc8494" + "files": 1020, + "generated_at_commit": "a14aa34c9249188cc771a2a565494b5ce61ad432", + "source_tree": "sha256:2db6157faff537ba9160bc50742fdebe5d3185beb36d0647a8ec7fc1ef03127e" }, "owner_lane": "", "provenance": { diff --git a/native/kernel/.crumb b/native/kernel/.crumb index 937d4c43..b27415b5 100644 --- a/native/kernel/.crumb +++ b/native/kernel/.crumb @@ -52,19 +52,19 @@ }, { "digest": "b3ec8c7d0aef7d59d5b2733c3985bc8944799a1d693b3975b70d24fc413f681e", - "last_commit": "2c057c5d", + "last_commit": "5e0c7970", "name": "artifact", "purpose": "Directory native/kernel/artifact. Purpose not yet described by a human." }, { "digest": "61a172288ebf844e840e09f1c1c6cf60020ebe20534843ff0958fd7f8c7403b0", - "last_commit": "f26a7a2f", + "last_commit": "5e0c7970", "name": "core", "purpose": "Directory native/kernel/core. Purpose not yet described by a human." }, { - "digest": "bb1590a998c55526c1e9db5695814df0a4473a78d1fcf800fc6f46ea21eaa902", - "last_commit": "f26a7a2f", + "digest": "eadad3ae0c0adef9284d1040ee1ea04c0399b5fd25bd9d11b5ccdb2856907118", + "last_commit": "432c9447", "name": "dev", "purpose": "Directory native/kernel/dev. Purpose not yet described by a human." }, @@ -76,38 +76,38 @@ }, { "digest": "3c703a23e77318cb2711acdf82d3252007fdfdb972ba96dda96f261afb10e37c", - "last_commit": "2c057c5d", + "last_commit": "d05e080b", "name": "mm", "purpose": "Directory native/kernel/mm. Purpose not yet described by a human." }, { "digest": "f16e0e7ecbfd61786aff570cdb98c12abcd7cee18b1121e94f55f26b6abf7adb", - "last_commit": "f26a7a2f", + "last_commit": "5e0c7970", "name": "svc", "purpose": "Directory native/kernel/svc. Purpose not yet described by a human." }, { "digest": "b59cf15dae1176673f4400a34367e1f6f22dc5cfc8125197301375e805bfc64c", - "last_commit": "f26a7a2f", + "last_commit": "5e0c7970", "name": "tests", "purpose": "Directory native/kernel/tests. Purpose not yet described by a human." }, { "digest": "5a45af6994ac4e8e94d4f95f30f5345008fbcfa9785032b7f9b8391c86b53b7c", - "last_commit": "f26a7a2f", + "last_commit": "5e0c7970", "name": "tools", "purpose": "Hosted (Linux-built) checkers for the native kernel, run by `make -C native/kernel test`; nothin" } ], - "children_root": "sha256:0d5c84695671f16bb5807527e1569c4ef812d7661d6802ac1420b23cc99ba818", - "compiled_at": "2026-11-06T12:57:47Z", + "children_root": "sha256:dd22d8853baa41fc0830dbc9e739364d7f6c7c73c177cf6a05004d8a0e9e9fd4", + "compiled_at": "2026-11-06T14:13:40Z", "compiler": "crumb-compile/1", - "digest": "sha256:3c10adfc819ba82707e4d8ddc996fadd9d7408f6b4017353aedd5e31d448639e", + "digest": "sha256:af273c64a35fb82517e60ba5feea763c5ee416443ae7f9a48bc3a20b29ddc481", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 644, - "generated_at_commit": "f26a7a2fe1dbd0632b1b9fcaeacb6d18ec8707e8", - "source_tree": "sha256:f6ddc0728ef568a6235e893df21a5074ece28e79c9f8e07886a437dd80844fc0" + "generated_at_commit": "432c9447df58c134b21be92447164f33f92e70b2", + "source_tree": "sha256:60c5bf4b990a11a7d55a500e086bfd1ace4778e04f0e9fe0258c94c2de1026c2" }, "owner_lane": "", "provenance": { diff --git a/native/kernel/dev/.crumb b/native/kernel/dev/.crumb index a4d0cba9..fd2be65d 100644 --- a/native/kernel/dev/.crumb +++ b/native/kernel/dev/.crumb @@ -7,14 +7,14 @@ "generated": { "children": [], "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-11-06T12:57:47Z", + "compiled_at": "2026-11-06T14:13:40Z", "compiler": "crumb-compile/1", - "digest": "sha256:bb1590a998c55526c1e9db5695814df0a4473a78d1fcf800fc6f46ea21eaa902", + "digest": "sha256:eadad3ae0c0adef9284d1040ee1ea04c0399b5fd25bd9d11b5ccdb2856907118", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 64, - "generated_at_commit": "f26a7a2fe1dbd0632b1b9fcaeacb6d18ec8707e8", - "source_tree": "sha256:be8d7f594d9c2649dbbb634dc2439115e8c005eef4fc1368cb4f3f03a18ece16" + "generated_at_commit": "432c9447df58c134b21be92447164f33f92e70b2", + "source_tree": "sha256:16fd5ab40c30397772119fe59b71683bed7d212380b91e657879ebb5283ca0d3" }, "owner_lane": "", "provenance": { diff --git a/native/kernel/dev/usb_hid.c b/native/kernel/dev/usb_hid.c index aa97255f..8511e363 100644 --- a/native/kernel/dev/usb_hid.c +++ b/native/kernel/dev/usb_hid.c @@ -253,7 +253,7 @@ void ck_recovery_identity(const char *commit, uint8_t out[32]) sha256_update(&c, (const uint8_t *)dom, sizeof dom); size_t n = 0; if (commit) - while (commit[n] && n < 64) n++; + while (n < 64 && commit[n]) n++; sha256_update(&c, (const uint8_t *)(commit ? commit : ""), n); sha256_final(&c, out); } diff --git a/native/omega/.crumb b/native/omega/.crumb index 1c75880b..3977b05d 100644 --- a/native/omega/.crumb +++ b/native/omega/.crumb @@ -4,20 +4,20 @@ "children": [ { "digest": "5b8954046044cd9e509cf3696330a580e8bdb515ee73f500184be22daa1dc1bb", - "last_commit": "92e4bc6", + "last_commit": "c93a5f57", "name": "platform", "purpose": "Spark read-only ACPI resource readback" } ], "children_root": "sha256:fcc350d101f87cb9e531f243a85d6664b62bbe63cf4b8c71b61bcb4d63d3e9b0", - "compiled_at": "2026-10-28T23:11:15Z", + "compiled_at": "2026-11-06T15:04:49Z", "compiler": "crumb-compile/1", - "digest": "sha256:f3c7ee4f18f768fa9964c123e07f076c544c58c0966a8a5e9571b0397bf57b06", + "digest": "sha256:6a2dad3c256c6f916442b3256f3eabc05da9ea6a82114256aec43f53e75fc2cd", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 8, - "generated_at_commit": "92e4bc688150b9754b6f37d3a701c58f7764d7ee", - "source_tree": "sha256:2f18a7d9ab0e0bf0b9e2a3f97a3b3d9a58ee97417a799178c906b8ac9d65b5bd" + "files": 127, + "generated_at_commit": "a14aa34c9249188cc771a2a565494b5ce61ad432", + "source_tree": "sha256:34c55e6b1ef7deab8e3df5b9fbf27b39809cfeba18a85708cf7fe42a13139c59" } }, "name": "omega", diff --git a/native/omega/allen/ALPHA.md b/native/omega/allen/ALPHA.md new file mode 100644 index 00000000..7dd08f7e --- /dev/null +++ b/native/omega/allen/ALPHA.md @@ -0,0 +1,49 @@ +# Allen alpha delivery contract + +User direction: Allen is a sovereign stack, not a mandatory client of Drake's +Spark. The initial visual release targets the iMac. One shared handwritten +Omega core supports native boot and an optional hosted application experience. +These launch modes are qualified separately; current Linux AArch64 module tests +do not qualify an iMac boot image or a macOS application. + +## Free, temporary hosted experience + +The hosted app is a free, temporary way to experience the interface and speed +before choosing a native installation. It must leave boot configuration, +partitions and drivers untouched, and uninstall cleanly. It is not meant to +replace the sovereign stack with a permanent dependency on another OS or service. +The hosted trial necessarily uses its host OS interfaces; native boot remains +the path where Allen owns boot/kernel/device behavior. + +## User-controlled inference + +- Local: use supported compute on the user's own machine through AIEN's engine. + This is a first-class path, not gated on an AIEN account or remote API key. +- User cloud: use compute the user provisions and controls, through AIEN's stack. +- Drake's Spark: optional hosted inference requiring an API key for that service. + +No mandatory Spark service, cloud provider, vendor runtime or subscription is +introduced by these choices. Unsupported local hardware is reported honestly, +not silently substituted with remote inference. Backend selection and permission +to send data off-device must be explicit. Keys are never baked into a download +or logs. Do not ask users to paste keys into development chat. + +Every displayed speed result must identify the inference location and relevant +hardware. A Spark-backed response is not evidence of the user's local speed. +A free app does not imply free third-party cloud infrastructure; any such cost +must be disclosed before the user selects it. No performance guarantee without +measurements on the actual named path. + +## Public alpha acceptance + +Publicly obtainable artifact, supported-platform instructions, source/license +provenance, checksums, clean acquisition outside a developer checkout, actual +visual conversation and persistence, and recovery/uninstall instructions. +Qualify one bundled native iMac trial separately from the hosted safe trial. +Unknown hardware gets detection and bounded capability checks, not guessed writes. + +The font, provider and retained-presentation components are implemented. The +bounded RGB surface is being qualified. Live backend binding, hosted window/input +and platform packaging, native boot/device integration and physical iMac acceptance +remain unfinished. Do not label component images or protocol fixtures a released +interactive alpha. diff --git a/native/omega/allen/FONT.md b/native/omega/allen/FONT.md new file mode 100644 index 00000000..090cb1a9 --- /dev/null +++ b/native/omega/allen/FONT.md @@ -0,0 +1,30 @@ +# L758 native stroke-font implementation + +Continuation of L694 checkpoint5, executed inline with RED/GREEN. Language: +handwritten seeded Omega. Reuse the exact existing Allen glyph design and sine +lookup data from native/kernel/ui/allen_font.c at4c7888f; do not transpile C. +The legacy source is an external pixel oracle only, never construction/runtime. + +Create font-data.om (95 glyph command strings,91 sine samples), font.om (integer +sqrt/trig, fixed-pool segment generation and single-glyph antialiased masks), +tests/font.om, tests/font-output.om and tests/font-render.om. No heap or font file. +API afinit(cap,weight) accepts1..64px and1..2500 weight units; afglyph(byte) maps +nonprintable input to '?'. Af fields: scale256,halfwidth256,segment count,width, +height,advance256. Ab[0,1] is signed mask origin relative to baseline. Alpha is +fixed65536 bytes; Ag contains at most160 line segments. Invalid init preserves +last state; successful init clears validity. A glyph render replaces the single +mask; no caching/per-face heap allocation claim. + +- Write compilable stub and native tests; observe meaningful behavior RED. +- Handwrite geometry/parser/rasterization with bounded cap/weight and arithmetic. +- Run native tests including all95 glyphs, space, fallback, symmetry, bounds, + signed angles, full-width sqrt cases and fixed nonzero assertion failure exits. +- Compile the unmodified legacy font as a separately labeled host oracle; externally + collect mask metadata/bytes, compare with an Omega-emitted glyph stream. Neither + oracle C nor collection Python is linked into or used to produce Omega code. +- Produce an actual native-rendered specimen, inspect it visually, record hashes. +- Run the native combined gate; publish source, exact receipts and known limits. + +The current provider/presentation review continues separately; do not duplicate +it or alter its frozen source. Full scene layout, sky, motion, framebuffer device +and physical iMac qualification remain subsequent work, not implied by a font. diff --git a/native/omega/allen/PRESENTATION.md b/native/omega/allen/PRESENTATION.md new file mode 100644 index 00000000..e5d943dd --- /dev/null +++ b/native/omega/allen/PRESENTATION.md @@ -0,0 +1,34 @@ +# L756 application presentation binding + +Next attachment within L694 checkpoint5: use the qualified application, scene +normalizer and code-row layout instead of another parser or scripted UI. +No change to L748 provider source while its independent review is running. + +`dask(now)` and `drecv(now)` call appask/appreceive respectively, preserve their +boolean admission result, then project only accepted event1 into presentation. +`dpresent()` consumes current Answer/R/A; it is called once per accepted event, +never to replay stale A2 after a failed operation. It returns true when a scene +or completed-code snapshot was updated. A rejected/hidden/empty answer leaves +the last accepted scene visible; it does not clear the display. Ordinary words +use the existing bounded plain fallback. Existing SAY folding/159-byte limit +remains; this does not establish multiline 2048-byte model scene transport. + +Scene snapshots: Ds[8], Dt[64], Dtext[2304], Dsay[1]. Dm[0] scene valid, +Dm[1] completed code valid, Dm[2] last successfully projected conversation ID. +A validated completed-code event copies Code into Dcode[32768] and the existing +80-column/4096-row layout into Dstart/Dlen/Dline[4096], Dview[rows,top,bytes]. +An in-progress/new/refused reply cannot corrupt the previous completed snapshot. +Code bytes are retained independently because codebeg/codetake reuse Code. + +Input In/Inlen and offered Outb/Outlen/Err must survive presentation exactly. +Decoder scratch Sc/Things/Stext and view scratch may change; renderer consumers +must read the retained D* state. Pending transport state is never acknowledged. +`dreset()` calls appreset and zeros all retained presentation buffers/metadata; +conversation/wire counters retain the existing reset contract. No fabricated +answers, fonts, pixels, display device, disk or live socket implementation. + +Qualification: compilable native stub RED, direct state checks and actual +ASK->courier LINE->drecv integration including pending offers, code completion, +invalid/hidden payloads, new-code mutation isolation and reset. Compile via the +pinned191b776e seed; add only module/test paths to the existing host build gate. +All behavioral decisions stay Omega. Independent review follows source freeze. diff --git a/native/omega/allen/PROVIDER.md b/native/omega/allen/PROVIDER.md new file mode 100644 index 00000000..0a94d7c9 --- /dev/null +++ b/native/omega/allen/PROVIDER.md @@ -0,0 +1,70 @@ +# Native provider stream v1 (L748) + +Builder choice: an explicitly host-development, bounded binary stream entry for +already-built Omega application functions. It is not a network, clock, storage +or device provider. All executable implementation and fixtures are Omega; host +shell only compiles and compares. The legacy development stdio main stays intact. + +Input header:40 bytes, magic ASCII ALNPRV01, then four little-endian u64 fields: +operation, monotonic milliseconds, argument, body length. Body follows exactly. +No separators/padding after body. Header/body fragmentation is permitted. + +| op | operation | argument | body | +|---|---|---|---| +|1|BOOT|nonzero unique run ID|empty| +|2|ASK|0|1..159 prompt bytes| +|3|POLL|link0/1|empty| +|4|SENT|actual whole-datagram success0/1|empty| +|5|RECV|0|65..1200 datagram bytes| +|6|CANCEL|0|empty; timestamp must0| +|7|RESET|0|empty; timestamp must0| +|8|COPY|slot0/1|4096 record bytes; timestamp0| +|9|NOTE|index0..511|4096 record bytes; timestamp0| +|10|LOAD|0|empty; timestamp0| + +LOAD is optional before BOOT. It explicitly resets restore staging and begins a +new two-copy read. COPY accepts each slot once, valid or damaged, choosing the +newest valid memory copy with existing codec; both invalid means empty memory. +After both copies, ctxbegin runs. NOTE visits each declared slot once; damaged +records are visited as gone. BOOT refuses until restore is complete. LOAD may +restart restoration only before BOOT. COPY/NOTE/LOAD refuse after BOOT. Raw record +bytes come from a future provider; no physical persistence claim. + +Output header uses same magic and four u64 fields: echoed op, status, application +event, body length. Status0 refused/no successful dispatch,1 accepted,2 accepted +record visit but damaged,3 accepted POLL with outgoing datagram. POLL without an +offer is status1, not refusal. On accepted non-offer event1, body is exact visible +Answer bytes. When that event also completes a valid code request, one additional +record op11/status1/event1 carries the exact Code bytes. No fabricated text. +## Retained presentation attachment (L763) + +The actual provider dispatch uses dask for ASK, drecv for RECV and dreset for +RESET. Accepted event1 updates the retained D* scene/code state; malformed or +semantically refused operations never project stale event state. RESET clears +all retained presentation, while CANCEL retains it. BOOT still initializes once. +The source concatenation places presentation.om before provider-core.om because +the seed requires definitions before calls. There is no new operation or output +record: the external wire contract and exact answer/code bytes remain unchanged. +The renderer must consume retained D* buffers, not mutable assembly scratch. +This connects provider dispatch to display state, not yet to pixels or hardware. + +Qualification: expand native prdo tests first (136 assertions;24 fail against +unchanged provider), bind the three existing calls, then replay the complete +host gate and three compiled call-bypass mutants. File/fragmented-pipe output +fixtures remain unchanged. Independent exact-source review follows publication. + +The stream reply writer uses a separate buffer: application Outb/Outlen/Err remain +intact until SENT reports the real transport outcome. Writing an offer to stdout +never counts as sending its datagram. + +Bad magic/op/unused fields/size => immediate exit65 before body or later command +execution. A well-framed semantic refusal produces status0 and permits subsequent +records. EOF between records is exit0; partial header/body is exit65. Read/write +errors are exit74 (inherited Linux signal disposition remains a separate limit). +No synthetic timestamps, link readiness, datagram send outcomes or storage writes. + +Implementation/qualification sequence: native compilable stub + behavioral RED; +provider core with real application calls; native stream entry and real pipe/file +replay; valid workflow golden, partial/oversized/unknown frame refusal; combined +native gate and compiled mutations; immutable independent review. No target or +live-model acceptance from these host fixtures. diff --git a/native/omega/allen/README.md b/native/omega/allen/README.md new file mode 100644 index 00000000..f1431105 --- /dev/null +++ b/native/omega/allen/README.md @@ -0,0 +1,283 @@ +# Allen in seeded Omega (L694, WIP) + +This directory contains handwritten seeded Omega implementations of Allen's +transport-independent state, protocol, memory codecs, scene state, code layout +and paint primitives. It compiles directly to static native Linux AArch64 ELF. +It has no foreign implementation, interpreter, C translator, launcher or fallback. + +It is **not the complete iMac Allen replacement**. The old production C/Rust +paths remain live. No service, machine, physical disk or boot path was changed. + +Build on Linux AArch64 from the pinned public compiler source. These are +component build instructions, not a released interactive alpha. The compiler is +omega-mv commit 81ab1900, held by the tag `allen-omc-pin-81ab1900` (the +`feat/x86efi-file-word` head of #981, stacked on #980 register slots and #977 site +tables; #980 is not merged, so this commit is not on omega-mv main): +look-paint.om needs its `const` and `bitcast`, the firmware unit its larger +trap/exit-site tables, look-install.om its `efi 11` file word, and the x86 back +end's live-slot calls and register-resident slots make the firmware's per-pixel +code run. From this repository root: + +```sh +git clone https://github.com/aien-dev/omega-mv.git build/allen-toolchain +git -C build/allen-toolchain checkout --detach 81ab1900 +sha256sum build/allen-toolchain/seed/out/omc # expect 9995f8534e0e5447... +``` + +The committed `seed/out/omc` on that branch is the pinned compiler; its +self-rebuild (`sh seed/omega-from-seed.sh` in a disposable clone) reproduces +the same bytes. Self-rebuild equality does not establish diverse compiler +ancestry; that qualification is a separate claim. The expected SHA-256 is +`9995f8534e0e54470194d57f163421add779cf1994062f8d9a417d0a39f2b075`; pass the +executable as `OMEGA_COMPILER` (on the Spark: `~/work/IMacLook/omc5`). + +The firmware image for the iMac is one unit of every module in the order +`build-fw.sh` lists (platform, base, sha256, font, the look, surface, GitHub, +HTTP, net, TLS, session, repository screen, runtime, courier, memory, intent, +reply, context, application, chat, install, stopwatch, show, efi-main, demo): + +```sh +OMEGA_COMPILER=... sh native/omega/allen/build-fw.sh target/BOOTX64.EFI +``` + +The typed line `stats` makes Allen say the stopwatch's last line (look-stat.om); +`install allen on this computer` copies the image to the internal EFI System +Partition (look-install.om); nothing is written at boot. + +Run the complete component gate: + +```sh +sh native/omega/allen/gate.sh target/allen-omega-L694/fresh-output +``` + +On the shared Spark, prefix bootstrap and gate commands with `quiet-build`. +For a compiler reconstructed elsewhere, set `OMEGA_COMPILER` to its executable +path. The same fixed digest is mandatory; this setting does not permit an +unqualified compiler. Paths containing spaces are supported. Build-orchestration +checks are available through `sh native/omega/allen/test-build.sh COMPILER FRESH_OUTPUT`. + +The output directory must be fresh. `build-one.sh` hashes the compiler before +**every invocation**, rejects empty/wrong-machine/nonstatic ELF and marks only +qualified output executable. Failed compilation leaves no published executable; +existing outputs, including dangling links, are never replaced. +The gate builds all modules together for every test, +executes handwritten Omega test programs, compares a byte-exact independent memory +fixture and rejects compiled behavioral mutants. The build uses POSIX shell, +Git (source reconstruction), GNU file/text utilities, readelf, dd, xxd and +sha256sum as external development tools. Existing Rust courier `--split` was used +once as a fixture oracle, never as an Omega runtime dependency. + +## Modules and API boundary + +* `runtime.om`: one outstanding job, chat/code/follow-up, immediate code ack, + ID exhaustion refusal, stale answer rejection, cancel/reset,20s slow-once and + 30s silence timeout. Injected monotonic milliseconds, no clock syscall. + 32 transcript lines of159 bytes, evict oldest whole line, restoration entry. +* `intent.om`: legacy intent word tables and JOB composition, preserving Allen + and restored self/person names. No new canned ordinary answer table. +* `code.om`: CODE headers/escapes,128-byte pieces/32768-byte code,256 pieces, + IEEE CRC32,800 lines, reorder/loss/duplicate handling; display only when whole. +* `reply.om`: SAY multipart/WAIT folding,159-byte answer capacity, one AGAIN + retry for missing/bad code before giving up. Model text is always external input. +* `courier.om`: byte-compatible ALLEN-COURIER datagrams, session binding, + JOB reassembly4096 bytes, ordered LINE queue8x319 bytes and duplicate receipt. + This is protocol core, not a socket, Ethernet driver or cryptographic peer check. +* `scheduler.om`: serialized client lifecycle over that protocol. `qstart(run,now)` + requires a nonzero caller-supplied boot/session ID. `qsubmit(now)` snapshots + In/Inlen (1..4096 bytes), maps CR/LF to spaces, increments the bounded wire ID, + and queues 1000-byte JOB parts. A new submission is refused while the previous + job is unacknowledged or a send result is outstanding. Once acknowledged, a new + submission explicitly abandons the previous reply queue; the runtime must still + enforce its one-outstanding-conversation rule. `qcancel` discards pending sends, + received lines and job state, retaining session ID/clock/keepalive state. + `qnext(now,link)` publishes one datagram in Outb/Outlen, prioritizing pending GOT, + then HELLO, then JOB. Consume those bytes before any other serializer. Call + `qsent(now,success)` for each offered datagram, using actual whole-datagram send + success, not an assumption; failed sends remain due. `qincoming(now)` consumes + In/Inlen and returns refused0/accepted1/duplicate2. Drain accepted lines with + `qtake`. GOT is only scheduled after a line is retained or recognized as a + duplicate; queue-full and out-of-order input get no receipt. One pending GOT + slot provides backpressure rather than silently losing acknowledgments. + HELLO uses2s before readiness/after expiry and10s while ready; HI remains ready + for strictly less than30s. Whole JOB sets retry after2s until ACK or LINE. + All mutating timed entries refuse backward clocks. `qready(now)` is read-only. + The provider owns a genuine monotonic millisecond clock, link state and actual + datagram transport. No clock/socket, Ethernet or iMac attachment is claimed. +* `memory.om`:4096-byte AIENALM1 v2/v3/v4 and AIENNOT1 codecs. `Mem` is canonical + decoded payload, `Unit` is input/staging, `Enc` is committed encoder output. + SHA256(header0:32 || payload) is **unkeyed integrity**, never authorization or + rollback freshness. Those independent proofs remain absent in this legacy format. + `loadbeg` resets load state, `loadcopy(slot)` considers each valid copy once. + `txbegin -> txwrite -> txflush -> txread` publishes store generation only after + exact readback. Provider reads back into Unit and writes Enc to Tx's target. + `nbegin -> nwrite -> nflush -> nread` verifies note writes before parent saves; + provider must update the parent's note count only after nread succeeds. No disk + syscall/driver is bound. Crash tests use explicit fixed simulated disk buffers. +* `context.om`: restores a512-slot catalog from already committed note records + and appends bounded memory context to actual application JOBs. After loading + canonical Mem through the memory codec, call `ctxbegin`; for each declared slot, + place its4096-byte record in Unit and call `ctxtake(index)` exactly once, in any + order. Return0 means refused/no visit,1 valid retained,2 damaged visit retained + as gone. Deleted/damaged notes never enter model context. The catalog becomes + ready only after every declared slot was visited. Cx contains declared count, + visited count, readiness, damaged count and loading flag. Loading is refused + during a live conversation or note/parent write transaction. The provider must + keep the chosen Mem generation stable and restart catalog loading after any + memory reload; this is not an incremental concurrent store interface. + `ctxmeta(limit)` stages byte-exact legacy self/name/starts/fact and newest-live- + note metadata into Meta/Mx without touching Unit, Enc or outgoing bytes. + `ctxappend` appends all or none within the4096-byte JOB cap, preserving outgoing + bytes/length/error on refusal. `appask` validates context before reading its + variable-layout identity fields, includes the newest six live notes, and refuses + incomplete catalogs/oversized context before conversation or wire IDs advance. + SHA validation is still unkeyed integrity, not authentication. No physical disk + loader/writer, note search index or concurrent mutation/commit provider is bound. +* `view.om`: legacy code row wrapping, continuation numbering and saturated scroll, + bounded4096 rows. The full code remains held when the row index reaches capacity. +* `scene.om`: mood/say/eight thing kinds, placement/emphasis/arrival/direction, + typed field bounds, four things/six fields/2048-byte input/12 lines. +* `scene-input.om`: `scdecode` consumes In/Inlen through bounded scene cleanup, + restores the exact caller input and length, and fills the same Sc/Things/Stext + output as the strict `scene` parser. Input and normalized output each have a + 2048-byte cap. NUL or normalization overflow refuses the whole scene and clears + published scene metadata. ASCII tabs/spaces collapse; CR, other control bytes + and non-ASCII bytes are dropped, matching the legacy ASCII display boundary. + Case-insensitive exact ``/`` tags hide their entire lines and all + enclosed lines; an unclosed thought block hides the remainder. Lines beginning + with triple backticks are discarded, not the enclosed scene. Supported markdown + prefixes and keyword emphasis are stripped. Known kind/placement/mood words are + case-folded without changing displayed field text. The first twelve retained + canonical lines are eligible, including for mood-only and fallback decisions. + If no recognized scene exists, the first short unrecognized line becomes the + answer (159-byte cap); rejected known structured commands do not become prose. + This fallback is deliberately stricter than legacy truncation/ellipsis. + Nm[0..8] reports thinking, normalized bytes, tidying count, hidden lines, + scratch-line bytes, eligible mood seen, invalid/overflow, fallback bytes and + retained canonical-line count. Like other modules, calls must be serialized. + This scene API is not yet connected to the application reply/display provider. +* `paint.om`: legacy integer color operations and soft-light pixel evaluation. + Executed192x128 halo/heart component pose, colors from `ck_mind_draw`. This is + not the full Allen sky/network animation, font, canvas item renderer or UI. + +Fixed global pools model the platform boundary because seeded Omega globals +cannot be passed as array parameters. Functions are serialized, not reentrant. +Caller-owned metadata is trusted only where stated; lengths and external wire +values are validated at entry. Kernel/platform ABI and object ownership wrappers +must be specified when a qualified native provider exists. + +## Bound conversation/provider API + +`application.om` connects the runtime, intent/job builder, courier scheduler, +CODE assembly and SAY/WAIT handling. This is an executed native core entry path, +not a bound socket/device loop. The older development `main.om` stdio entry +remains separate; it does not exercise this datagram binding. + +1. `appinit(run,now)` initializes one boot session using a nonzero unique run ID + and actual monotonic milliseconds supplied by the future qualified provider. + Reinitialization is refused rather than reusing job IDs. +2. Put a prompt into In/Inlen, then `appask(now)`. It validates admission before + adding a transcript entry, builds the real JOB text and queues it. Code requests + expose the existing acknowledgement immediately. Restored facts and up to six + newest live notes are included in the queued job. Busy, outstanding-send, + pending-receipt, invalid-prompt and ID-exhaustion cases refuse admission. +3. `apppoll(now,link)` advances silence/slow deadlines and returns whether one + datagram is offered in Outb/Outlen. Send those exact bytes and call + `appsent(now,success)` with the real whole-datagram outcome. Do not call core + serializers yourself while a send is pending. +4. Copy a received datagram into In/Inlen and call `appreceive(now)`. Its boolean + reports **transport acceptance**, not acceptance of the inner reply. A[2] + distinguishes visible text1, queued code recovery2, code give-up3, refused + payload4, slow notice5 and silence timeout6; zero means no UI event. Consume + events after each successful call; later successful calls may replace them. + Answer/R[8], Code and transcript remain the actual retained content. +5. `appcancel` cancels both layers; `appreset` additionally clears runtime session + display/history state, without resetting conversation or wire counters. + +A missing-code response queues AGAIN with the original conversation ID. The +triggering LINE is acknowledged first, then AGAIN uses a **new wire sequence**. +Consequently the two counters can differ; subsequent valid responses still bind +correctly. Incoming reply parsing preserves any outstanding outgoing datagram. +Old CODE cannot populate or change a code buffer during a newer chat request. +WAIT updates the silence deadline without fabricating an answer. Silence timeout +cancels courier retries as well as the conversation. Calls remain serialized; +fixed global arrays are not thread-safe. Provider must not mix direct core queue +operations with this application API. + +## Runnable bound provider entry + +`provider-core.om` and `provider.om` expose the actual bound application through +versioned length-framed stdin/stdout. See [PROVIDER.md](PROVIDER.md) for the exact +40-byte header, operations and status/event/body format. The gate produces the +static native executable at `/provider`, plus native input and output +verification programs. For example the already-built fixture can drive it: + +```sh +printf 0 | /provider-input > /path/to/private/events.bin +/provider < /path/to/private/events.bin > /path/to/private/results.bin +/provider-output < /path/to/private/results.bin +``` + +These are deterministic test events, not a live model conversation. The entry +actually calls the memory/catalog/application/scheduler/code functions, reads +and writes real streams, and keeps offered datagrams pending until an explicit +SENT outcome. It emits actual retained answers and completed code, never canned +ordinary replies. Restore records are supplied by the caller, not read from disk. +Malformed/oversized/truncated frames stop immediately with exit65; well-framed +semantic refusals return status0. Real pipe replay with byte-at-a-time writes and +six framing/refusal cases run in the full gate. The old line-oriented `main.om` +remains separate and its byte-exact goldens are unchanged. + +This is an executable host integration boundary, **not** a qualified socket, +monotonic clock, storage/device provider, live-model service or EFI/iMac build. + +## Stable application presentation + +`presentation.om` binds successful `dask`/`drecv` application events to retained +scene state and completed code rows. See [PRESENTATION.md](PRESENTATION.md). +The display snapshot survives hidden/invalid replies and later reuse of the code +assembly buffer. Input bytes and pending wire output are preserved; reset clears +retained presentation bytes. Native tests exercise real courier envelopes through +these wrappers, not merely direct scene-parser calls. + +The provider executable now calls these display wrappers for ASK/RECV/RESET, +while exporting the same raw answer/code records as before. Native provider tests +check retained scene/code updates, refused-frame isolation and complete reset; +compiled bypass mutants catch regressions in each attachment. This is a host-side +presentation binding, not a pixel renderer or display device. Existing SAY folding and its +159-byte bound remain; multiline model-scene transport is not yet attached. + +## Native stroke font + +`font-data.om` retains Allen's existing95 printable-ASCII glyph designs and91 +integer sine samples; `font.om` is a handwritten fixed-buffer Omega rasterizer. +It supports cap heights1..64 and weights1..2500, maps nonprintable bytes to `?`, +and produces one antialiased glyph mask at a time without a C font runtime. +The full gate compares native output for294 glyph/size/weight/fallback records +against frozen bytes collected from the unmodified legacy implementation. That +legacy code is an external reference oracle, not an Omega compiler or runtime. +`/font-specimen.ppm` is drawn entirely by the native Omega executable. + +See [FONT.md](FONT.md) and `evidence/allen-omega-L694/L758/`. This implements the font +rasterization component, not scene layout, frame animation or the display driver. +The presentation/provider attachment still needs the actual screen renderer. + +## Intentional refusals and unfinished compatibility + +Overflow refuses whole prompts/answers/scene fields instead of silent truncation. +Reply capacity159, prompt capacity159, code32768, job4096, note127. Conflicting +CODE duplicates and differing language headers are refused rather than overwriting. +Numeric overflow, backward timestamps, request ID wrap and v4 sky pad are refused. +Job instructions and record bytes retain legacy structure; envelope metadata is +never added to Store v1 superblocks. No identity migration fields are rewritten. + +Remaining portable work: remaining scene aliases/missing-colon repairs, field +ellipsis, timer interpretation, transcript-to-notes restore, +full notes indexing/retrieval, catalog update/store integration, transport binding, +full sky/catalogue/font/animated-network/canvas visual parity, integration and +broader malformed-input coverage. Partial modules are not whole compatibility. + +Required target gates: qualified seeded x86 EFI target (FR9), privileged/MMIO and +interrupt/native device access(FR8), durable I/O(FR1), bounded networking(FR16), +keyboard/framebuffer/disk/NIC providers, iMac QEMU boot/chat/keyboard/bootdisk, +then signed physical trial. No C bridge can satisfy these. L408 owns compiler +work; L690 owns Hermes JSON/WebSocket/admission. Neither tree was modified. diff --git a/native/omega/allen/SURFACE.md b/native/omega/allen/SURFACE.md new file mode 100644 index 00000000..ad5c7e94 --- /dev/null +++ b/native/omega/allen/SURFACE.md @@ -0,0 +1,41 @@ +# Bounded native text surface (L765) + +A necessary rendering component for the iMac-first visual alpha, not a full +window system, animation, layout engine or display driver. Handwritten Omega; +qualified existing font geometry and retained presentation are reused. + +`Canvas` is a fixed884736-byte RGB buffer. `Cv` fields are width,height, +clip-x,clip-y,clip-width,clip-height,initialized,last-advance256. + +- `cvinit(w,h)`: accepts1..768 by1..384, clears the full buffer, fills active + pixels with night RGB(6,8,18), and establishes a full-surface clip. +- `cvclip(x,y,w,h)`: unsigned clip must fit wholly within active dimensions. + Zero-area clips at the edge are valid. Validate using subtraction before + adding coordinates, so an oversized width cannot wrap into acceptance. +- `cvglyph(byte,x,y,color)`: requires initialized surface and font, signed + baseline coordinates within[-4096,4096], packed24-bit RGB. Renders through + the existing font and clips every pixel. Saves glyph advance in Cv[7]. +- `cvspan(beg,size,x,y,color)`: same guards; reads an explicit bounded Dtext + span. Length0 at2304 is legal. Glyph advance accumulates in256ths of a pixel, + with signed floor at each baseline; no per-glyph rounding drift. All bytes + use the existing font fallback. No implicit wrapping/newline interpretation. + +Invalid public arguments preserve Canvas/Cv; font, mask and pose are scratch +for admitted drawing. Global arrays are module-owned, not an untrusted caller +mutation interface. Valid font settings and immutable glyph data are required; +this component does not promise rollback after arbitrary corruption of those +private globals. Maximum span is2304 bytes and positions remain bounded by the +qualified maximum glyph advance. No heap, file font or foreign runtime. + +Blend each channel using integer `(background*(255-alpha)+foreground*alpha)/255`, +truncated down, from the CURRENT destination pixel. In/Inlen, retained D* text, +and offered Outb/Outlen/Err are not renderer scratch. Native tests cover analytic +alpha0/128/255 and repeated overlap, an independent crop comparison, negative +origins, exact edge/zero clips, oversized/refused arguments and span/glyph parity. +Compiled mutants remove the right clip or replace the destination color. + +The actual `surface-render` executable submits BOOT/ASK/RECV through prdo, +projects a fixture note into retained presentation, and draws its title/body. +Its P6 image is real Omega-produced pixels; reply content is an explicit test +fixture, NOT a claimed live-model response. PNG conversion is external lossless +format conversion only. Hosted application/boot/device qualification remains open. diff --git a/native/omega/allen/application.om b/native/omega/allen/application.om new file mode 100644 index 00000000..f84faff6 --- /dev/null +++ b/native/omega/allen/application.om @@ -0,0 +1,241 @@ +note Native application binding: conversation state, courier lifecycle and reply/code. +note A initialized, queued AGAIN bytes, per-call event, reserved. +note Events:0 none,1 visible answer/ack,2 AGAIN queued,3 code give-up, +note 4 refused LINE payload,5 slow notice,6 silence timeout. +note Transport acceptance is separate from payload acceptance: appreceive true +note means envelope accepted; inspect A2 for malformed payload, never invent text. +global A ulong 4 +global Appjob uchar 4096 +global Appwire uchar 8192 +global Askin uchar 160 +fn appinit run ulong now ulong to bool +if or ne get A 0 0 ne get R 0 0 +ret false +end +if ne get Q 0 0 +ret false +end +if not qstart run now +ret false +end +constants +put A 0 1 +put A 1 0 +put A 2 0 +ret true +end +fn appclock now ulong to bool +if eq get A 0 0 +ret false +end +ret and ge now get T 0 ge now get R 4 +end +fn appask now ulong to bool +if not appclock now +ret false +end +if or ne get R 1 0 ne get A 1 0 +ret false +end +if or ne get T 10 0 ne get T 13 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +if or ge get R 0 4294967295 ge get Q 1 4294967295 +ret false +end +if not textok +ret false +end +kind = classify +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +note Validate restored context before jobbuild reads its variable-layout names. +if not ctxmeta 6 +ret false +end +if not jobbuild kind add get R 0 1 +ret false +end +if not ctxappend +ret false +end +n = get Inlen 0 +size = get Outlen 0 +for i ulong n +put Askin i get In i +end +for i ulong size +put Appjob i get Outb i +end +for i ulong size +put In i get Appjob i +end +put Inlen 0 size +queued = qsubmit now +for i ulong n +put In i get Askin i +end +put Inlen 0 n +if not queued +ret false +end +note start preconditions were checked before qsubmit; no concurrent calls permitted. +if not start kind now +qcancel +ret false +end +put A 2 0 +if gt kind 1 +codebeg get R 0 +put A 2 1 +end +ret true +end +fn appcancel to void +cancel +qcancel +put A 1 0 +put A 2 0 +end +fn appreset to void +appcancel +reset +end +note First acknowledge the triggering LINE, then submit AGAIN with a new wire +note sequence while retaining the original conversation ID in its body. +fn appqueue now ulong to bool +if eq get A 1 0 +ret true +end +if or ne get T 10 0 ne get T 13 0 +ret true +end +put Inlen 0 get A 1 +for i ulong get A 1 +put In i get Appjob i +end +if not qsubmit now +ret false +end +put A 1 0 +ret true +end +fn apppoll now ulong online bool to bool +if not appclock now +ret false +end +put A 2 0 +put T 0 now +status = tick now +if eq status 1 +put A 2 5 +end +if eq status 2 +qcancel +put A 1 0 +put A 2 6 +end +if not appqueue now +appcancel +put A 2 3 +ret false +end +ret qnext now online +end +fn appsent now ulong ok bool to bool +if not appclock now +ret false +end +if not qsent now ok +ret false +end +put A 2 0 +ret true +end +fn appbody now ulong to bool +if eq get R 1 0 +put A 2 4 +ret true +end +if ineq 0 67 +if or le get R 2 1 ne get C 0 get R 0 +put A 2 4 +ret true +end +if codetake +if heard get C 0 now +ret true +end +end +put A 2 4 +ret true +end +if or ineq 0 83 ineq 0 87 +status = saytake now +if eq status 1 +if eq get R 1 0 +put A 1 0 +end +if ne get S 1 0 +put A 2 1 +end +ret true +end +if eq status 2 +n = get Outlen 0 +if or eq n 0 gt n 4096 +cancel +put A 1 0 +put A 2 3 +ret true +end +for i ulong n +put Appjob i get Outb i +end +put A 1 n +put A 2 2 +ret true +end +if eq status 3 +put A 1 0 +put A 2 3 +ret true +end +end +put A 2 4 +ret true +end +note Reply parsing can serialize AGAIN internally. Preserve the already offered +note datagram until the provider records its send result, including on refusal. +fn appreceive now ulong to bool +if not appclock now +ret false +end +result = qincoming now +if eq result 0 +ret false +end +put A 2 0 +if not qtake +ret true +end +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Appwire i get Outb i +end +ok = appbody now +for i ulong n +put Outb i get Appwire i +end +put Outlen 0 n +put Err 0 e +ret ok +end diff --git a/native/omega/allen/base.om b/native/omega/allen/base.om new file mode 100644 index 00000000..73cc6511 --- /dev/null +++ b/native/omega/allen/base.om @@ -0,0 +1,102 @@ +note L694 fixed-buffer utilities. No platform effects in product functions. +global In uchar 8192 +global Inlen ulong 1 +global Outb uchar 8192 +global Outlen ulong 1 +global Err ulong 1 +text Digits "0123456789abcdef" +fn emitb c uchar to void +n = get Outlen 0 +if ge n len Outb +put Err 0 1 +else +put Outb n c +put Outlen 0 add n 1 +end +end +fn emitn v ulong to void +d = new uchar 20 0 +n = ulong 0 +x = v +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +while gt x 0 +put d n uchar add rem x 10 48 +n = add n 1 +x = div x 10 +end +while gt n 0 +n = sub n 1 +emitb get d n +end +end +fn outreset to void +put Outlen 0 0 +put Err 0 0 +end +fn ineq at ulong c uchar to bool +if ge at get Inlen 0 +ret false +end +ret eq get In at c +end +fn isdigit c uchar to bool +ret and ge c 48 le c 57 +end +note Parser cursor P0, number P1, error P2. Never wraps a u32. +global P ulong 3 +fn number to void +v = ulong 0 +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if not isdigit c +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +ret +end +if or ge n 10 gt v 429496729 +put P 2 1 +ret +end +v = add mul v 10 sub ulong c 48 +if gt v 4294967295 +put P 2 1 +ret +end +n = add n 1 +p = add p 1 +end +put P 0 p +put P 1 v +if eq n 0 +put P 2 1 +end +end +fn expect c uchar to void +p = get P 0 +if not ineq p c +put P 2 1 +else +put P 0 add p 1 +end +end +fn crc off ulong count ulong to uint +c = uint 4294967295 +for i ulong count +c = xor c uint get In add off i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end diff --git a/native/omega/allen/build-fw.sh b/native/omega/allen/build-fw.sh new file mode 100755 index 00000000..130518c6 --- /dev/null +++ b/native/omega/allen/build-fw.sh @@ -0,0 +1,43 @@ +#!/bin/sh +# The firmware-hosted Allen with the native look, as one Omega unit for `target x86efi`. +# usage: build-fw.sh OUT.EFI (OMEGA_COMPILER selects the compiler; its digest must be the pin) +# Order matters: globals and texts precede their use; every module lists what it needs. +set -eu +[ "$#" = 1 ] || { echo 'usage: build-fw.sh OUT.EFI' >&2; exit 64; } +root=$(CDPATH= cd -- "$(dirname "$0")/../../.." && pwd) +A=$root/native/omega/allen +compiler=${OMEGA_COMPILER:-"$root/build/allen-toolchain/seed/out/omc"} +[ -f "$compiler" ] && [ -x "$compiler" ] || { echo 'pinned compiler missing; follow native/omega/allen/README.md' >&2; exit 69; } +# Pin: omega-mv 81ab1900, tag allen-omc-pin-81ab1900 (#981 head on unmerged #980 on #977): register slots, live-slot calls, +# the efi 11 file word, const/bitcast and the 65536-entry site tables the firmware unit needs. +[ "$(sha256sum "$compiler" | cut -d' ' -f1)" = 9995f8534e0e54470194d57f163421add779cf1994062f8d9a417d0a39f2b075 ] || { + echo 'compiler digest differs from the qualified pin' >&2 + exit 65 +} +out=$1 +[ ! -e "$out" ] || { echo 'fresh output required' >&2; exit 73; } +unit="$out.om" +{ + echo 'target x86efi' + for f in platform.om base.om vendor/sha256-core.om font-data.om font.om look-paint.om look-skydata.om look-sky.om \ + look-night.om look-mind.om look-home.om surface.om github.om http.om net.om tls-crypto.om vendor/cert-sha384.om \ + vendor/cert-p256.om tls-p384.om vendor/cert-root.om tls-cert.om tls.om session.om repository-screen.om runtime.om \ + code.om courier.om scheduler.om memory.om intent.om reply.om context.om application.om look-chat.om look-install.om \ + look-stat.om look-show.om efi-main.om demo.om; do cat "$A/$f"; done +} > "$unit" +# Names are one namespace across the unit: a duplicate fn/global/const/text/struct is refused here, not by omc's line. +dup=$(grep -E '^(fn|global|const|text|struct) ' "$unit" | awk '{print $2}' | sort | uniq -d) +[ -z "$dup" ] || { echo "duplicate names in the unit: $dup" >&2; exit 65; } +if ! "$compiler" < "$unit" > "$out.tmp" 2> "$out.err"; then + rc=$? + L=$(grep -o 'line [0-9]*' "$out.err" | cut -d' ' -f2 || true) + echo "compile rc=$rc $(cat "$out.err")" >&2 + [ -n "$L" ] && { sed -n "${L}p" "$unit"; awk -v L="$L" 'NR<=L && /^fn /{f=$2} END{print "in fn " f}' "$unit"; } >&2 + rm -f "$out.tmp" + exit "$rc" +fi +[ -s "$out.tmp" ] +# PE32+ for x64: MZ at 0 and the PE signature where e_lfanew points. +[ "$(head -c 2 "$out.tmp")" = MZ ] || { echo 'not a PE image' >&2; rm -f "$out.tmp"; exit 65; } +mv "$out.tmp" "$out" +echo "ok $(sha256sum "$out" | cut -c1-16) $(wc -c < "$out") bytes, $(wc -l < "$unit") lines, $(grep -c '^fn ' "$unit") fns, compiler $(sha256sum "$compiler" | cut -c1-8)" diff --git a/native/omega/allen/build-one.sh b/native/omega/allen/build-one.sh new file mode 100755 index 00000000..8863651a --- /dev/null +++ b/native/omega/allen/build-one.sh @@ -0,0 +1,29 @@ +#!/bin/sh +# External development orchestration. Every compiler invocation verifies its pin. +set -eu +[ "$#" = 2 ] || { echo 'usage: build-one.sh SOURCE OUTPUT' >&2; exit 64; } +root=$(CDPATH= cd -- "$(dirname "$0")/../../.." && pwd) +compiler=${OMEGA_COMPILER:-"$root/build/allen-toolchain/seed/out/omc"} +[ -f "$compiler" ] && [ -x "$compiler" ] || { + echo 'pinned compiler missing; follow native/omega/allen/README.md' >&2 + exit 69 +} +# Pin: omega-mv 81ab1900, tag allen-omc-pin-81ab1900 (#981 head on unmerged #980 on #977): register slots, live-slot calls, the efi 11 file word, const/bitcast and the site tables. +[ "$(sha256sum "$compiler" | cut -d' ' -f1)" = 9995f8534e0e54470194d57f163421add779cf1994062f8d9a417d0a39f2b075 ] || { + echo 'compiler digest differs from the qualified pin' >&2 + exit 65 +} +[ ! -e "$2" ] && [ ! -L "$2" ] || { echo 'fresh output required' >&2; exit 73; } +temporary=$(mktemp "${2}.build.XXXXXX") +trap 'rm -f -- "$temporary" "$temporary.header" "$temporary.dynamic"' EXIT +trap 'exit 74' HUP INT TERM +"$compiler" < "$1" > "$temporary" +[ -s "$temporary" ] +readelf -h "$temporary" > "$temporary.header" +grep -q 'Machine:.*AArch64' "$temporary.header" +grep -q 'Type:.*EXEC' "$temporary.header" +readelf -l -d "$temporary" > "$temporary.dynamic" +if grep -Eq 'INTERP|NEEDED' "$temporary.dynamic"; then exit 65; fi +chmod 700 "$temporary" +# Atomic no-replace publication also refuses a link created during compilation. +ln -T -- "$temporary" "$2" diff --git a/native/omega/allen/code.om b/native/omega/allen/code.om new file mode 100644 index 00000000..059c85c9 --- /dev/null +++ b/native/omega/allen/code.om @@ -0,0 +1,264 @@ +note CODE protocol: C seq, parts, bytes, crc, got. D parsed header. +global C ulong 8 +global D ulong 8 +global Code uchar 32769 +global Have uchar 256 +global Piece uchar 128 +global Lang uchar 16 +global Newlang uchar 16 +fn codebeg seq ulong to void +for i ulong 8 +put C i 0 +end +put C 0 seq +for i ulong 256 +put Have i 0 +end +put Code 0 0 +end +fn decfield slot ulong sep uchar to void +number +put D slot get P 1 +expect sep +end +fn hexread to void +v = ulong 0 +for i ulong 8 +p = get P 0 +if ge p get Inlen 0 +put P 2 1 +ret +end +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +put P 2 1 +ret +end +v = add mul v 16 d +put P 0 add p 1 +end +put D 4 v +expect 32 +end +fn codehead to bool +put P 0 0 +put P 2 0 +expect 67 +expect 79 +expect 68 +expect 69 +expect 32 +decfield 0 32 +decfield 1 47 +decfield 2 32 +decfield 3 32 +hexread +if ne get P 2 0 +ret false +end +if or ne get D 0 get C 0 eq get D 3 0 +ret false +end +if gt get D 3 32768 +ret false +end +if ne get D 2 div add get D 3 127 128 +ret false +end +if or lt get D 1 1 gt get D 1 get D 2 +ret false +end +if ne get C 1 0 +if or ne get C 1 get D 2 ne get C 2 get D 3 +ret false +end +if ne get C 3 get D 4 +ret false +end +end +ret true +end +fn langread to bool +for i ulong 16 +put Newlang i 0 +end +n = ulong 0 +p = get P 0 +while lt p get Inlen 0 +c = get In p +if eq c 32 +if eq n 0 +ret false +end +put P 0 add p 1 +put D 5 n +ret true +end +ok = or and ge c 97 le c 122 isdigit c +ok = or ok or eq c 43 eq c 35 +ok = or ok or eq c 46 or eq c 95 eq c 45 +if or not ok ge n 15 +ret false +end +put Newlang n c +p = add p 1 +n = add n 1 +end +ret false +end +fn pieceread to ulong +p = get P 0 +n = ulong 0 +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if ge p get Inlen 0 +ret 129 +end +c = get In p +p = add p 1 +if eq c 110 +c = 10 +else +if ne c 92 +ret 129 +end +end +else +if or lt c 32 gt c 126 +ret 129 +end +end +if ge n 128 +ret 129 +end +put Piece n c +n = add n 1 +end +ret n +end +fn codetake to bool +if gt get Inlen 0 320 +ret false +end +if not codehead +ret false +end +if not langread +ret false +end +n = pieceread +want = ulong 128 +if eq get D 1 get D 2 +want = sub get D 3 mul sub get D 2 1 128 +end +if ne n want +ret false +end +slot = sub get D 1 1 +off = mul slot 128 +if ne get C 1 0 +for i ulong 16 +if ne get Lang i get Newlang i +ret false +end +end +end +if ne get Have slot 0 +for i ulong n +if ne get Code add off i get Piece i +ret false +end +end +ret true +end +put C 1 get D 2 +put C 2 get D 3 +put C 3 get D 4 +for i ulong 16 +put Lang i get Newlang i +end +for i ulong n +put Code add off i get Piece i +end +put Have slot 1 +put C 4 add get C 4 1 +ret true +end +fn codecrc to uint +c = uint 4294967295 +for i ulong get C 2 +c = xor c uint get Code i +for k ulong 8 +if ne and c 1 0 +c = xor shr c 1 3988292384 +else +c = shr c 1 +end +end +end +ret not c +end +fn codestat to ulong +if eq get C 1 0 +ret 0 +end +if lt get C 4 get C 1 +ret 1 +end +if ne ulong codecrc get C 3 +ret 3 +end +lines = ulong 0 +for i ulong get C 2 +c = get Code i +if eq c 0 +ret 3 +end +if eq c 10 +lines = add lines 1 +end +end +if ne get Code sub get C 2 1 10 +lines = add lines 1 +end +if gt lines 800 +ret 3 +end +put Code get C 2 0 +ret 2 +end +fn missing to ulong +if eq get C 1 0 +ret 1 +end +for i ulong get C 1 +if eq get Have i 0 +ret add i 1 +end +end +ret 0 +end +note Display admission is distinct from a model's closing sentence. +fn codeshow seq ulong to bool +if eq get R 1 0 +ret false +end +if or ne seq get R 0 ne seq get C 0 +ret false +end +if ne codestat 2 +ret false +end +put R 6 1 +ret true +end diff --git a/native/omega/allen/context.om b/native/omega/allen/context.om new file mode 100644 index 00000000..401d4185 --- /dev/null +++ b/native/omega/allen/context.om @@ -0,0 +1,237 @@ +note Restored note catalog and bounded model-job context. No storage provider. +note Cx declared count,visited count,ready,damaged,loading. Damaged notes stay gone. +global Cx ulong 5 +global Ctxtext uchar 65536 +global Ctxlen ulong 512 +global Ctxgone uchar 512 +global Ctxseen uchar 512 +global Ctxstart ulong 512 +global Meta uchar 4096 +global Mx ulong 2 +global Mdigits uchar 20 +text Mtself "\tself=" +text Mtname "\tname=" +text Mtstart "\tstarts=" +text Mtfact "\tfact " +text Mtis " is " +text Mtare " are " +text Mtnote "\tnote " +fn ctxidle to bool +if ne get R 1 0 +ret false +end +ret and eq get Tx 0 0 eq get Nt 0 0 +end +fn ctxbegin to bool +if not ctxidle +ret false +end +n = mem32 36 +if gt n 512 +ret false +end +for i ulong 512 +put Ctxlen i 0 +put Ctxgone i 1 +put Ctxseen i 0 +put Ctxstart i 0 +end +put Cx 0 n +put Cx 1 0 +put Cx 2 0 +put Cx 3 0 +put Cx 4 1 +if eq n 0 +put Cx 2 1 +put Cx 4 0 +end +ret true +end +note Returns0 refused without visit,1 valid record retained,2 damaged visit retained. +fn ctxtake index ulong to ulong +if not ctxidle +ret 0 +end +if or eq get Cx 4 0 ge index get Cx 0 +ret 0 +end +if ne get Ctxseen index 0 +ret 0 +end +status = ulong 2 +if notedec index +n = get Ns 0 +for i ulong n +put Ctxtext add mul index 128 i get Note i +end +put Ctxlen index n +put Ctxgone index uchar get Ns 3 +put Ctxstart index get Ns 2 +status = 1 +else +put Cx 3 add get Cx 3 1 +end +put Ctxseen index 1 +put Cx 1 add get Cx 1 1 +if eq get Cx 1 get Cx 0 +put Cx 2 1 +put Cx 4 0 +end +ret status +end +fn mtemit c uchar to void +if ne get Mx 1 0 +ret +end +n = get Mx 0 +if ge n 4096 +put Mx 1 1 +ret +end +put Meta n c +put Mx 0 add n 1 +end +fn mtnum v ulong to void +n = ulong 0 +while gt v 9 +put Mdigits n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Mdigits n uchar v +n = add n 1 +for i ulong n +mtemit add uchar 48 get Mdigits sub sub n 1 i +end +end +note Memory fields are length-bounded; require a terminator and printable bytes. +fn mtfield off ulong cap ulong to bool +for i ulong cap +c = get Mem add off i +if eq c 0 +if eq i 0 +put Mx 1 1 +ret false +end +ret true +end +if or lt c 32 gt c 126 +put Mx 1 1 +ret false +end +mtemit c +end +put Mx 1 1 +ret false +end +fn mtfacts count ulong to bool +for k ulong count +off = add 40 mul k 113 +for i ulong len Mtfact +mtemit get Mtfact i +end +if not mtfield off 48 +ret false +end +are = get Mem add off 112 +if gt are 1 +put Mx 1 1 +ret false +end +if eq are 1 +for i ulong len Mtare +mtemit get Mtare i +end +else +for i ulong len Mtis +mtemit get Mtis i +end +end +if not mtfield add off 48 64 +ret false +end +end +ret eq get Mx 1 0 +end +fn mtnotes count ulong limit ulong to void +given = ulong 0 +for k ulong count +index = sub sub count 1 k +if and eq get Ctxgone index 0 lt given limit +for i ulong len Mtnote +mtemit get Mtnote i +end +for i ulong get Ctxlen index +mtemit get Ctxtext add mul index 128 i +end +given = add given 1 +end +end +end +fn ctxmeta limit ulong to bool +put Mx 0 0 +put Mx 1 1 +facts = mem32 32 +notes = mem32 36 +if or gt facts 32 gt notes 512 +ret false +end +if gt limit 512 +ret false +end +if gt notes 0 +if or eq get Cx 2 0 ne get Cx 0 notes +ret false +end +end +put Mx 1 0 +for i ulong len Mtself +mtemit get Mtself i +end +off = add 40 mul facts 113 +if eq get Mem off 0 +for i ulong len Allen +mtemit get Allen i +end +else +if not mtfield off 24 +ret false +end +end +if ne get Mem 8 0 +for i ulong len Mtname +mtemit get Mtname i +end +if not mtfield 8 24 +ret false +end +end +for i ulong len Mtstart +mtemit get Mtstart i +end +mtnum mem32 0 +if not mtfacts facts +ret false +end +mtnotes notes limit +ret eq get Mx 1 0 +end +note Publish all metadata or none; preserve outgoing bytes/length/error on refusal. +fn ctxappend to bool +if or ne get Mx 1 0 ne get Err 0 0 +ret false +end +n = get Outlen 0 +size = get Mx 0 +if or gt n 4096 gt size 4096 +ret false +end +if gt add n size 4096 +ret false +end +for i ulong size +put Outb add n i get Meta i +end +put Outlen 0 add n size +ret true +end diff --git a/native/omega/allen/courier.om b/native/omega/allen/courier.om new file mode 100644 index 00000000..a17d8f81 --- /dev/null +++ b/native/omega/allen/courier.om @@ -0,0 +1,261 @@ +note Pure courier datagrams. Q session, current seq, last LINE, head, count. +global Q ulong 8 +global N ulong 8 +global Queue uchar 2560 +global Qlens ulong 8 +global Jbuf uchar 4096 +global Jhave uchar 5 +global J ulong 3 +text Keys "ALLEN-COURIER v=1 run= kind= seq= part= bytes=" +text Kinds "JOBLINEGOTACKHELLOHI" +fn keyread off ulong count ulong to void +for i ulong count +expect get Keys add off i +end +end +fn keyemit off ulong count ulong to void +for i ulong count +emitb get Keys add off i +end +end +fn kindoff k ulong to ulong +if eq k 1 +ret 0 +end +if eq k 2 +ret 3 +end +if eq k 3 +ret 7 +end +if eq k 4 +ret 10 +end +if eq k 5 +ret 13 +end +ret 18 +end +fn kindlen k ulong to ulong +if eq k 2 +ret 4 +end +if eq k 5 +ret 5 +end +if eq k 6 +ret 2 +end +ret 3 +end +fn qbegin run ulong seq ulong to void +for i ulong 8 +put Q i 0 +end +put Q 0 run +put Q 1 seq +for i ulong 5 +put Jhave i 0 +end +for i ulong 3 +put J i 0 +end +end +note Serializer takes body In/Inlen; Outb/Outlen are published only on success. +fn packet k ulong seq ulong part ulong total ulong bytes ulong to bool +if or lt k 1 gt k 6 +ret false +end +if gt get Inlen 0 1000 +ret false +end +outreset +keyemit 0 22 +for i ulong 16 +d = and shr get Q 0 mul sub 15 i 4 15 +emitb get Digits d +end +keyemit 22 6 +off = kindoff k +for i ulong kindlen k +emitb get Kinds add off i +end +keyemit 28 5 +emitn seq +keyemit 33 6 +emitn part +emitb 47 +emitn total +keyemit 39 7 +emitn bytes +emitb 10 +for i ulong get Inlen 0 +emitb get In i +end +ret eq get Err 0 0 +end +fn pkparse to bool +if or gt get Inlen 0 1200 lt get Inlen 0 65 +ret false +end +put P 0 0 +put P 2 0 +keyread 0 22 +run = ulong 0 +for i ulong 16 +p = get P 0 +c = get In p +d = ulong 16 +if isdigit c +d = sub ulong c 48 +else +if and ge c 97 le c 102 +d = sub ulong c 87 +end +end +if ge d 16 +ret false +end +run = or shl run 4 d +put P 0 add p 1 +end +if ne run get Q 0 +ret false +end +keyread 22 6 +kind = ulong 0 +for k ulong 6 +at = get P 0 +off = kindoff add k 1 +size = kindlen add k 1 +ok = true +for i ulong size +if not ineq add at i get Kinds add off i +ok = false +end +end +if and ok ineq add at size 32 +kind = add k 1 +end +end +if eq kind 0 +ret false +end +put N 0 kind +put P 0 add get P 0 kindlen kind +keyread 28 5 +number +put N 1 get P 1 +keyread 33 6 +number +put N 2 get P 1 +expect 47 +number +put N 3 get P 1 +keyread 39 7 +number +put N 4 get P 1 +expect 10 +put N 5 get P 0 +put N 6 sub get Inlen 0 get P 0 +ret eq get P 2 0 +end +fn jobtake to ulong +note n via N4 +note part via N2 +note total via N3 +if or eq get N 4 0 gt get N 4 4096 +ret 0 +end +if ne get N 3 div add get N 4 999 1000 +ret 0 +end +if or eq get N 2 0 gt get N 2 get N 3 +ret 0 +end +want = ulong 1000 +if eq get N 2 get N 3 +want = sub get N 4 mul sub get N 3 1 1000 +end +if ne want get N 6 +ret 0 +end +if ne get J 0 0 +if or ne get J 0 get N 4 ne get J 1 get N 3 +ret 0 +end +end +slot = sub get N 2 1 +off = mul slot 1000 +if ne get Jhave slot 0 +for i ulong want +if ne get Jbuf add off i get In add get N 5 i +ret 0 +end +end +ret 2 +end +for i ulong want +put Jbuf add off i get In add get N 5 i +end +put Jhave slot 1 +put J 0 get N 4 +put J 1 get N 3 +put J 2 add get J 2 1 +ret 1 +end +note Return0 refused,1 accepted,2 duplicate requiring GOT/ACK again. +fn qreceive to ulong +if not pkparse +ret 0 +end +if ne get N 1 get Q 1 +ret 0 +end +kind = get N 0 +if eq kind 1 +ret jobtake +end +if ne kind 2 +if ne get N 6 0 +ret 0 +end +ret 1 +end +note part via N2 +if eq get N 2 0 +ret 0 +end +if le get N 2 get Q 2 +ret 2 +end +if or ne get N 2 add get Q 2 1 eq get Q 4 8 +ret 0 +end +n = get N 6 +if or eq n 0 gt n 319 +ret 0 +end +slot = rem add get Q 3 get Q 4 8 +for i ulong n +put Queue add mul slot 320 i get In add get N 5 i +end +put Qlens slot n +put Q 4 add get Q 4 1 +put Q 2 get N 2 +ret 1 +end +fn qtake to bool +if eq get Q 4 0 +ret false +end +slot = get Q 3 +n = get Qlens slot +for i ulong n +put In i get Queue add mul slot 320 i +end +put Inlen 0 n +put Q 3 rem add slot 1 8 +put Q 4 sub get Q 4 1 +ret true +end diff --git a/native/omega/allen/demo.om b/native/omega/allen/demo.om new file mode 100644 index 00000000..6b1677ae --- /dev/null +++ b/native/omega/allen/demo.om @@ -0,0 +1,166 @@ +note SPDX-License-Identifier: MIT +note Repository demonstration screen state. Platform independent; no device calls. +note UI state (Dmo, Dprm, Dprmn, Dstat) is declared in platform.om. +text Dmotext "Allen\nType a request, then press Enter.\nI recognise requests to open Allen's GitHub repository.\nRequest:\nRecognised as a deterministic repository request; no model was used.\nNative boot: UEFI firmware services remain active.\nNetwork is up. Type a request.\nNo firmware network yet, retrying. Code: \n" +fn dmglyphs at ulong n ulong x long y long color ulong to bool +pen = mul x 256 +for i ulong n +if not afglyph get Dmotext add at i +ret false +end +cvblit affloor pen y color +pen = add pen long get Af 5 +end +ret true +end +fn dmline wanted ulong x long y long color ulong to bool +line = ulong 0 +at = ulong 0 +for i ulong len Dmotext +if eq get Dmotext i 10 +if eq line wanted +ret dmglyphs at sub i at x y color +end +line = add line 1 +at = add i 1 +end +end +ret false +end +fn dmprompt x long y long to bool +pen = mul x 256 +for i ulong get Dprmn 0 +if not afglyph get Dprm i +ret false +end +cvblit affloor pen y 16777215 +pen = add pen long get Af 5 +end +ret true +end +fn dmnum v ulong x long y long color ulong to bool +note Reuse the existing decimal writer, then draw those bytes with the Allen font. +outreset +emitn v +pen = mul x 256 +for i ulong get Outlen 0 +if not afglyph get Outb i +ret false +end +cvblit affloor pen y color +pen = add pen long get Af 5 +end +ret true +end +fn dmrender to bool +if eq get Dmo 0 1 +ret ghrender +end +if or lt get Cv 0 320 lt get Cv 1 288 +ret false +end +if not cvclip 0 0 get Cv 0 get Cv 1 +ret false +end +for i ulong mul get Cv 0 get Cv 1 +at = mul i 3 +put Canvas at 6 +put Canvas add at 1 8 +put Canvas add at 2 18 +end +if not afinit 22 1300 +ret false +end +if not dmline 0 32 52 16777215 +ret false +end +if not afinit 11 1000 +ret false +end +if not dmline 1 32 92 13161215 +ret false +end +if not dmline 2 32 116 13161215 +ret false +end +if not dmline 5 32 140 9871556 +ret false +end +if not afinit 13 1100 +ret false +end +if not dmline 3 32 196 16766102 +ret false +end +if ne get Es 6 0 +if not dmline 6 32 260 8555696 +ret false +end +else +if not dmline 7 32 260 8555696 +ret false +end +if not dmnum get Es 12 364 260 8555696 +ret false +end +end +ret dmprompt 112 196 +end +fn dmsubmit to bool +n = get Dprmn 0 +if or eq n 0 gt n 159 +ret false +end +if eq get Es 6 0 +note Never show a transport error for a network that was never up: keep the request. +put Dstat 0 1 +ret false +end +put Dstat 0 0 +for i ulong n +put In i get Dprm i +end +put Inlen 0 n +if not ghask +ret false +end +put Dmo 0 1 +put Dprmn 0 0 +ret true +end +fn dmkey key ulong to bool +if eq get Dmo 0 1 +if eq key 27 +put Dmo 0 0 +put Dprmn 0 0 +ghinit +ret true +end +ghkey key +ret true +end +if and ge key 32 le key 126 +n = get Dprmn 0 +if ge n len Dprm +ret false +end +put Dprm n uchar key +put Dprmn 0 add n 1 +ret true +end +if or eq key 8 eq key 127 +if gt get Dprmn 0 0 +put Dprmn 0 sub get Dprmn 0 1 +end +ret true +end +if or eq key 10 eq key 13 +ret dmsubmit +end +ret false +end +fn dminit to void +ghinit +put Dmo 0 0 +put Dprmn 0 0 +end diff --git a/native/omega/allen/efi-main.om b/native/omega/allen/efi-main.om new file mode 100644 index 00000000..4611dcf6 --- /dev/null +++ b/native/omega/allen/efi-main.om @@ -0,0 +1,466 @@ +note SPDX-License-Identifier: MIT +note Firmware-hosted native Allen: UEFI Boot Services stay active. Display via GOP Blt, +note keys via Simple Text Input, packets via Simple Network, time via GetTime, entropy via +note EFI_RNG or CPU RDRAND, elapsed time via calibrated invariant TSC. Compile with the +note leading line `target x86efi`. All application, network, TLS and UI logic is Omega. +global Eb uchar 64 +global Ek uchar 8 +global Ep uchar 32 +global Et uchar 16 +global Eclk uchar 8 +global Erx uchar 1608 +global Etx uchar 2048 +note Es (screen and network state) is declared in platform.om. +fn efok st ulong to bool +ret eq st 0 +end +fn efms to ulong +st = efi 10 0 Eclk 0 8 +if not efok st +put Es 12 10 +ret 18446744073709551615 +end +v = ulong 0 +for i ulong 8 +v = or v shl ulong get Eclk i mul i 8 +end +ret v +end +fn efdays y ulong m ulong d ulong to ulong +note Days since 1970-01-01, proleptic Gregorian (civil_from_days inverse). +yy = y +if le m 2 +yy = sub yy 1 +end +era = div yy 400 +yoe = sub yy mul era 400 +mp = add m 9 +if gt m 2 +mp = sub m 3 +end +doy = mul 153 mp +doy = div add doy 2 5 +doy = add doy sub d 1 +doe = mul yoe 365 +doe = add doe div yoe 4 +doe = sub doe div yoe 100 +doe = add doe doy +days = mul era 146097 +days = add days doe +ret sub days 719468 +end +fn efepoch to ulong +st = efi 4 0 Et 0 16 +if not efok st +ret 0 +end +y = or ulong get Et 0 shl ulong get Et 1 8 +mo = ulong get Et 2 +d = ulong get Et 3 +h = ulong get Et 4 +mi = ulong get Et 5 +s = ulong get Et 6 +if or or lt y 2024 gt y 2099 or lt mo 1 gt mo 12 +ret 0 +end +if or or lt d 1 gt d 31 or gt h 23 gt mi 59 +ret 0 +end +if gt s 59 +ret 0 +end +v = mul efdays y mo d 86400 +v = add v add mul h 3600 add mul mi 60 s +tz = or ulong get Et 12 shl ulong get Et 13 8 +if ne tz 2047 +note UEFI 2.10 8.3: Localtime = UTC - TimeZone (signed 16-bit minutes), so UTC = local + TimeZone. +note EFI_UNSPECIFIED_TIMEZONE (2047): firmware time is taken as UTC; shown on screen for the operator. +if ge tz 32768 +v = sub v mul sub 65536 tz 60 +else +v = add v mul tz 60 +end +end +ret v +end +fn efentropy to bool +st = efi 5 0 Gsrand 0 96 +if not efok st +put Es 12 5 +note No firmware random source (neither EFI_RNG nor RDRAND): name it on the repository +note screen as stage 15 with the firmware status byte, not as a bare transport error. +put Gdiag 0 15 +put Gdiag 1 and st 255 +ret false +end +put Gsrandn 0 96 +ret true +end +fn efrows y0 ulong rows ulong to bool +note Rows of Efa (as zeros) to the screen: used before the show owns the frame. +w = get Es 0 +n = mul mul w rows 4 +note Computed-count loops trap past 1,000,000 passes: clear row by row. +for r ulong rows +base = mul mul r w 4 +for x ulong mul w 4 +put Efa add base x 0 +end +end +arg = or or w shl rows 32 shl y0 48 +st = efi 3 arg Efa 0 n +ret efok st +end +fn efscreen to bool +st = efi 0 0 Eb 0 64 +if not efok st +ret false +end +w = or ulong get Eb 8 shl ulong get Eb 9 8 +w = or w shl ulong get Eb 10 16 +h = or ulong get Eb 12 shl ulong get Eb 13 8 +h = or h shl ulong get Eb 14 16 +if not shfits w h +ret false +end +put Es 0 w +put Es 1 h +put Es 2 1 +put Es 3 0 +put Es 4 0 +band = div len Efa mul w 4 +y = ulong 0 +while lt y h bound 64 +n = band +if gt add y n h +n = sub h y +end +if not efrows y n +ret false +end +y = add y n +end +put Lg 0 long w +put Lg 1 long h +ret cvinit 768 384 +end + +fn efnetup now ulong to void +st = efi 8 0 Eb 0 0 +if not efok st +put Es 12 and st 255 +ret +end +st = efi 0 0 Eb 0 64 +if or not efok st eq and ulong get Eb 4 2 0 +put Es 12 and st 255 +ret +end +for i ulong 6 +put Nmac i get Eb add 24 i +end +netinit now +put Es 6 1 +end +fn efpackets now ulong to void +if eq get Es 6 0 +ret +end +for burst ulong 32 +st = efi 6 0 Erx 0 len Erx +if not efok st +ret +end +n = ulong 0 +for i ulong 8 +n = or n shl ulong get Erx i mul i 8 +end +if and ge n 14 le n 1514 +for i ulong n +put Nrx i get Erx add 8 i +end +netinput n now +end +end +end +fn eftransmit now ulong to void +if or eq get Es 6 0 eq get Ntxlen 0 0 +ret +end +n = get Ntxlen 0 +for i ulong n +put Etx i get Ntx i +end +st = efi 7 0 Etx 0 n +note EFI_NOT_READY: the previous private copy is still owned by firmware; retry later. +if eq st 9223372036854775814 +ret +end +netsent efok st now +end +fn efkeymap scan ulong ch ulong to ulong +if ne ch 0 +ret ch +end +if eq scan 1 +ret 256 +end +if eq scan 2 +ret 257 +end +if eq scan 3 +ret 261 +end +if eq scan 4 +ret 260 +end +if eq scan 9 +ret 258 +end +if eq scan 10 +ret 259 +end +if eq scan 23 +ret 27 +end +ret 0 +end +fn efkeys to bool +changed = false +for burst ulong 16 +st = efi 1 0 Ek 0 4 +if not efok st +ret changed +end +scan = or ulong get Ek 0 shl ulong get Ek 1 8 +ch = or ulong get Ek 2 shl ulong get Ek 3 8 +key = efkeymap scan ch +if ne key 0 +ok = shkey key +changed = true +end +end +ret changed +end +fn efpointer to bool +st = efi 9 0 Ep 0 32 +if not efok st +ret false +end +z = ulong 0 +y = ulong 0 +for i ulong 8 +z = or z shl ulong get Ep add 24 i mul i 8 +y = or y shl ulong get Ep add 16 i mul i 8 +end +if ne get Dmo 0 1 +ret false +end +note Wheel/scroll: signed rows. Drag with button held: accumulate vertical swipe. +if ne z 0 +if ge z 9223372036854775808 +ghscroll -3 +else +ghscroll 3 +end +ret true +end +if and ne and ulong get Ep 4 1 0 ne y 0 +if ge y 9223372036854775808 +ghswipe -1 +else +ghswipe 1 +end +ret true +end +ret false +end +fn efnet now ulong to void +if eq get Es 6 0 +if ne get Ghreq 0 0 +ok = ghreply get Ghreq 0 0 0 get Ghreq 2 +end +ret +end +if and eq get Gs 0 0 ne get Ghreq 0 0 +if not efentropy +ok = ghreply get Ghreq 0 0 0 get Ghreq 2 +ret +end +epoch = efepoch +if eq epoch 0 +put Es 12 4 +note No usable firmware clock for certificate validity: stage 16 on the repository screen. +put Gdiag 0 16 +ok = ghreply get Ghreq 0 0 0 get Ghreq 2 +ret +end +gsnext now epoch +ret +end +if ge get Gs 0 4 +put Gs 0 0 +ret +end +gspoll now +end +fn efsig to ulong +v = get Gh 0 +v = add v shl get Gh 1 8 +v = add v shl get Gs 0 40 +v = add v shl get Ghreq 0 48 +v = add v shl get Dmo 0 56 +ret v +end +fn efstep to int +now = efms +if eq now 18446744073709551615 +ret 4 +end +if eq get Es 6 0 +note Keep trying to bring the firmware network up; the link may settle after boot. +if gt now add get Es 13 2000 +put Es 13 now +efnetup now +end +end +efpackets now +changed = efkeys +if efpointer +put Sh 5 1 +end +before = efsig +efnet now +if ne before efsig +put Sh 5 1 +end +chstep now ne get Es 6 0 +shanswer +ststep ne get Es 6 0 +eftransmit now +if not shstep now +ret 6 +end +st = efi 2 1000 Eb 0 0 +ret 0 +end +fn efdrain to void +note Discard keys left in the firmware buffer by the shell before the image started. +note Four consecutive empty reads prove the queue is quiet; 4096 bounds the loop. +empty = ulong 0 +for i ulong 4096 +st = efi 1 0 Ek 0 4 +if not efok st +empty = add empty 1 +if ge empty 4 +break +end +else +empty = 0 +end +end +end +fn efloop to int +for oloop ulong 1000 +for tloop ulong 60000 +rc = efstep +if ne rc 0 +ret rc +end +end +end +ret 0 +end +fn efbpaint rh ulong gh ulong bh ulong w ulong n ulong to bool +for r ulong n +base = mul mul r w 4 +for x ulong w +at = add base mul x 4 +put Efa at uchar bh +put Efa add at 1 uchar gh +put Efa add at 2 uchar rh +put Efa add at 3 0 +end +end +arg = or w shl n 32 +st = efi 3 arg Efa 0 mul mul w n 4 +ret efok st +end +fn efbanner code ulong to int +note Paint a distinct colour for a failing stage, then hold it so a photograph is possible. +note No font or canvas dependency: this must work even when efscreen failed. +w = ulong 640 +h = ulong 480 +st = efi 0 0 Eb 0 64 +if efok st +tw = or ulong get Eb 8 shl ulong get Eb 9 8 +th = or ulong get Eb 12 shl ulong get Eb 13 8 +if and gt tw 0 le tw 1280 +w = tw +end +if and gt th 0 le th 800 +h = th +end +end +note Colour encodes the failing stage: red/green/blue derived from code. +rr = and mul code 37 255 +gg = and mul code 91 255 +bb = and mul code 149 255 +ok = efbpaint rr gg bb w h +for k ulong 12 +st = efi 2 500000 Eb 0 0 +end +ret int code +end +fn efpaint code ulong to void +note Paint the whole screen a colour derived from code and blit it. Used as a visible +note progress meter during startup, so a failure is identifiable from a photograph. +w = get Es 0 +h = get Es 1 +if or eq w 0 eq h 0 +w = ulong 640 +h = ulong 480 +end +if gt mul mul w h 4 len Efa +h = div len Efa mul w 4 +end +rr = and mul code 37 255 +gg = and mul code 91 255 +bb = and mul code 149 255 +ok = efbpaint rr gg bb w h +end +fn main to int +constants +if not efscreen +ret efbanner 1 +end +efpaint 1 +dminit +efdrain +efpaint 2 +now = efms +if eq now 18446744073709551615 +ret efbanner 2 +end +efpaint 3 +efnetup now +efpaint 4 +if not shinit now +ret efbanner 7 +end +if not efentropy +put Es 12 5 +end +run = or ulong get Gsrand 0 shl now 8 +if eq run 0 +run = 1 +end +ok = chinit now run +put Es 7 1 +rc = efloop +if ne rc 0 +bad = add ulong 10 ulong rc +ret efbanner bad +end +ret 0 +end diff --git a/native/omega/allen/font-data.om b/native/omega/allen/font-data.om new file mode 100644 index 00000000..c146baa0 --- /dev/null +++ b/native/omega/allen/font-data.om @@ -0,0 +1,4 @@ +note Declarative Allen glyph designs and integer sine samples, retained from +note native/kernel/ui/allen_font.c at4c7888f. No foreign executable implementation. +text Afdata "w6|w6 M3,0 L3,14 D3,20|w10 M3,0 L3,5 M7,0 L7,5|w15 M6,2 L4,20 M11,2 L9,20 M2,8 L13,8 M1,14 L12,14|w15 A8,5,5,5,-30,-270 A8,15,5,5,270,510 M8,-2 L8,22|w16 A4,4,2,3,0,360 A12,16,2,3,0,360 M13,1 L3,19|w16 M14,20 L5,9 A7,5,3,4,150,400 L3,14 A7,15,4,5,180,60 L13,11|w6 M3,0 L3,5|w9 A10,10,6,12,240,120|w9 A-1,10,6,12,-60,60|w14 M7,2 L7,10 M3,4 L11,8 M11,4 L3,8|w14 M2,12 L12,12 M7,7 L7,17|w6 M3,19 L2,23|w11 M2,13 L9,13|w6 D3,20|w12 M10,0 L2,20|w14 A7,10,5,10,0,360|w14 M3,4 L8,0 L8,20|w14 A7,6,5,6,200,400 L2,20 L12,20|w14 A7,5,5,5,200,450 A7,15,5,5,270,520|w14 M10,20 L10,0 L1,14 L13,14|w14 M12,0 L4,0 L4,9 A7,14,5,6,235,520|w14 A7,14,5,6,0,360 M10,0 L3,11|w14 M2,0 L12,0 L5,20|w14 A7,5,4,5,0,360 A7,15,5,5,0,360|w14 A7,6,5,6,0,360 M4,20 L11,9|w6 D3,8 D3,20|w6 D3,8 M3,19 L2,23|w14 M12,6 L2,12 L12,18|w14 M2,10 L12,10 M2,15 L12,15|w14 M2,6 L12,12 L2,18|w14 A7,5,5,5,190,450 L7,14 D7,20|w19 A9,12,3,4,0,360 M12,8 L12,14 A14,14,2,2,180,0 A9,11,7,9,0,-300|w16 M2,20 L8,0 L14,20 M4,13 L12,13|w15 M2,0 L2,20 M2,0 L8,0 A8,5,4,5,270,450 L2,10 M2,10 L9,10 A9,15,4,5,270,450 L2,20|w17 A9,10,7,10,45,315|w16 M2,0 L2,20 M2,0 L6,0 A6,10,8,10,270,450 L2,20|w14 M12,0 L2,0 L2,20 L12,20 M2,10 L10,10|w13 M12,0 L2,0 L2,20 M2,10 L10,10|w18 A9,10,7,10,-45,-360 M11,10 L16,10|w16 M2,0 L2,20 M14,0 L14,20 M2,10 L14,10|w6 M3,0 L3,20|w13 M10,0 L10,14 A6,14,4,6,0,180|w15 M2,0 L2,20 M13,0 L2,12 M6,8 L14,20|w13 M2,0 L2,20 L12,20|w20 M2,20 L2,0 L10,14 L18,0 L18,20|w16 M2,20 L2,0 L14,20 L14,0|w20 A10,10,8,10,0,360|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10|w20 A10,10,8,10,0,360 M12,14 L18,21|w15 M2,20 L2,0 L8,0 A8,5,5,5,270,450 L2,10 M8,10 L14,20|w16 A8,5,5,5,-30,-270 A8,15,5,5,270,510|w16 M1,0 L15,0 M8,0 L8,20|w16 M2,0 L2,13 A8,13,6,7,180,0 L14,0|w16 M1,0 L8,20 L15,0|w22 M1,0 L6,20 L11,0 L16,20 L21,0|w16 M2,0 L14,20 M14,0 L2,20|w16 M1,0 L8,10 L15,0 M8,10 L8,20|w16 M2,0 L14,0 L2,20 L14,20|w9 M7,-1 L3,-1 L3,21 L7,21|w12 M2,0 L10,20|w9 M2,-1 L6,-1 L6,21 L2,21|w12 M2,8 L6,1 L10,8|w14 M1,23 L13,23|w7 M2,0 L4,4|w15 A7,14,5,6,0,360 M12,8 L12,20|w15 M2,0 L2,20 A7,14,5,6,0,360|w13 A7,14,5,6,40,320|w15 A7,14,5,6,0,360 M12,0 L12,20|w14 M2,14 L12,14 A7,14,5,6,0,-320|w11 M5,20 L5,4 A9,4,4,4,180,300 M2,8 L10,8|w15 A7,14,5,6,0,360 M12,8 L12,22 A7,22,5,5,0,150|w15 M2,0 L2,20 A7,13,5,5,180,360 L12,20|w6 M3,8 L3,20 D3,3|w7 M4,8 L4,22 A0,22,4,5,0,120 D4,3|w13 M2,0 L2,20 M11,8 L2,15 M5,13 L12,20|w6 M3,0 L3,20|w21 M2,8 L2,20 A6,12,4,4,180,360 L10,20 A14,12,4,4,180,360 L18,20|w15 M2,8 L2,20 A7,13,5,5,180,360 L12,20|w14 A7,14,5,6,0,360|w15 M2,8 L2,27 A7,14,5,6,0,360|w15 A7,14,5,6,0,360 M12,8 L12,27|w10 M2,8 L2,20 A7,13,5,5,180,290|w14 A7,11,4,3,-30,-270 A7,17,4,3,270,510|w11 M5,2 L5,17 A8,17,3,3,180,40 M2,8 L10,8|w15 M2,8 L2,15 A7,15,5,5,180,0 M12,8 L12,20|w14 M2,8 L7,20 L12,8|w20 M2,8 L6,20 L10,8 L14,20 L18,8|w14 M2,8 L12,20 M12,8 L2,20|w14 M2,8 L7,20 M12,8 L4,27|w14 M2,8 L12,8 L2,20 L12,20|w10 M8,-1 L6,0 L6,8 L4,10 L6,12 L6,20 L8,21|w6 M3,-1 L3,23|w10 M2,-1 L4,0 L4,8 L6,10 L4,12 L4,20 L2,21|w14 M2,13 L5,11 L9,14 L12,12|" +text Afsines "0 286 572 857 1143 1428 1713 1997 2280 2563 2845 3126 3406 3686 3964 4240 4516 4790 5063 5334 5604 5872 6138 6402 6664 6924 7182 7438 7692 7943 8192 8438 8682 8923 9162 9397 9630 9860 10087 10311 10531 10749 10963 11174 11381 11585 11786 11982 12176 12365 12551 12733 12911 13085 13255 13421 13583 13741 13894 14044 14189 14330 14466 14598 14726 14849 14968 15082 15191 15296 15396 15491 15582 15668 15749 15826 15897 15964 16026 16083 16135 16182 16225 16262 16294 16322 16344 16362 16374 16382 16384 " diff --git a/native/omega/allen/font.om b/native/omega/allen/font.om new file mode 100644 index 00000000..642915d9 --- /dev/null +++ b/native/omega/allen/font.om @@ -0,0 +1,326 @@ +note Handwritten bounded Allen stroke rasterizer. Legacy C is an external oracle only. +global Af ulong 6 +global Ab long 4 +global Ag long 640 +global Alpha uchar 65536 +global Asin long 91 +global Afpos ulong 2 +global Apen long 2 +global Arc long 6 +fn afsqrt value ulong to ulong +r = ulong 0 +bit = shl ulong 1 62 +while gt bit value +bit = shr bit 2 +end +while ne bit 0 +if ge value add r bit +value = sub value add r bit +r = add shr r 1 bit +else +r = shr r 1 +end +bit = shr bit 2 +end +ret r +end +fn afsin deg long to long +a = rem deg 360 +if lt a 0 +a = add a 360 +end +if le a 90 +ret get Asin ulong a +end +if le a 180 +ret get Asin ulong sub long 180 a +end +if le a 270 +ret neg get Asin ulong sub a 180 +end +ret neg get Asin ulong sub long 360 a +end +fn afcos deg long to long +ret afsin add rem deg 360 90 +end +fn afinit cap ulong wt ulong to bool +if or eq cap 0 gt cap 64 +ret false +end +if or eq wt 0 gt wt 2500 +ret false +end +for i ulong 6 +put Af i 0 +end +put Af 0 div mul cap 256 20 +put Af 1 div mul wt get Af 0 1000 +v = long 0 +slot = ulong 0 +for i ulong len Afsines +c = get Afsines i +if eq c 32 +put Asin slot v +slot = add slot 1 +v = 0 +else +v = add mul v 10 sub long c 48 +end +end +ret eq slot 91 +end +fn afpick c uchar to bool +if or lt c 32 gt c 126 +c = 63 +end +wanted = sub ulong c 32 +slot = ulong 0 +startat = ulong 0 +for i ulong len Afdata +if eq get Afdata i 124 +if eq slot wanted +put Afpos 0 startat +put Afpos 1 i +ret true +end +slot = add slot 1 +startat = add i 1 +end +end +ret false +end +fn afnum to long +p = get Afpos 0 +minus = false +if eq get Afdata p 45 +minus = true +p = add p 1 +end +v = long 0 +go = true +while and lt p get Afpos 1 go +c = get Afdata p +if and ge c 48 le c 57 +v = add mul v 10 sub long c 48 +p = add p 1 +else +go = false +end +end +if lt p get Afpos 1 +if eq get Afdata p 44 +p = add p 1 +end +end +put Afpos 0 p +if minus +ret neg v +end +ret v +end +fn afseg nx long ny long to bool +n = get Af 2 +if ge n 160 +ret false +end +at = mul n 4 +put Ag at get Apen 0 +put Ag add at 1 get Apen 1 +put Ag add at 2 nx +put Ag add at 3 ny +put Apen 0 nx +put Apen 1 ny +put Af 2 add n 1 +ret true +end +fn afpoint a long first bool to bool +s = long get Af 0 +x = mul get Arc 0 s +x = add x div mul mul get Arc 2 s afcos a 16384 +y = mul sub get Arc 1 20 s +y = add y div mul mul get Arc 3 s afsin a 16384 +if first +put Apen 0 x +put Apen 1 y +ret true +end +ret afseg x y +end +fn afarc to bool +for i ulong 6 +put Arc i afnum +end +span = sub get Arc 5 get Arc 4 +if lt span 0 +span = neg span +end +steps = div span 9 +if lt steps 2 +steps = 2 +end +for k ulong ulong add steps 1 +a = sub get Arc 5 get Arc 4 +a = add get Arc 4 div mul a long k steps +if not afpoint a eq k 0 +ret false +end +end +ret true +end +fn afcmd cmd uchar to bool +if eq cmd 32 +ret true +end +if eq cmd 119 +put Af 5 mul ulong afnum get Af 0 +ret true +end +if eq cmd 65 +ret afarc +end +x = mul afnum long get Af 0 +y = mul sub afnum 20 long get Af 0 +if or eq cmd 77 eq cmd 68 +put Apen 0 x +put Apen 1 y +end +if eq cmd 77 +ret true +end +if or eq cmd 76 eq cmd 68 +ret afseg x y +end +ret false +end +fn affloor value long to long +if ge value 0 +ret div value 256 +end +ret neg div add neg value 255 256 +end +fn afbound x long y long to void +if lt x get Ab 0 +put Ab 0 x +end +if lt y get Ab 1 +put Ab 1 y +end +if gt x get Ab 2 +put Ab 2 x +end +if gt y get Ab 3 +put Ab 3 y +end +end +fn afbox to bool +put Ab 0 get Ag 0 +put Ab 2 get Ag 0 +put Ab 1 get Ag 1 +put Ab 3 get Ag 1 +for i ulong get Af 2 +at = mul i 4 +afbound get Ag at get Ag add at 1 +afbound get Ag add at 2 get Ag add at 3 +end +pad = add long get Af 1 256 +x0 = affloor sub get Ab 0 pad +y0 = affloor sub get Ab 1 pad +x1 = add affloor add get Ab 2 pad 1 +y1 = add affloor add get Ab 3 pad 1 +put Ab 0 x0 +put Ab 1 y0 +put Af 3 ulong sub x1 x0 +put Af 4 ulong sub y1 y0 +ret le mul get Af 3 get Af 4 len Alpha +end +fn afproj qx long qy long dx long dy long to ulong +len2 = add mul dx dx mul dy dy +ex = qx +ey = qy +if ne len2 0 +t = add mul qx dx mul qy dy +if gt t 0 +if ge t len2 +ex = sub qx dx +ey = sub qy dy +else +ex = sub qx div mul dx t len2 +ey = sub qy div mul dy t len2 +end +end +end +ret ulong add mul ex ex mul ey ey +end +fn afdist slot ulong px long py long to ulong +at = mul slot 4 +dx = sub get Ag add at 2 get Ag at +dy = sub get Ag add at 3 get Ag add at 1 +qx = sub px get Ag at +qy = sub py get Ag add at 1 +ret afproj qx qy dx dy +end +fn afalpha px long py long to uchar +best = ulong 18446744073709551615 +for i ulong get Af 2 +d2 = afdist i px py +if lt d2 best +best = d2 +end +end +d = long afsqrt best +cov = sub add long get Af 1 128 d +if le cov 0 +ret 0 +end +if ge cov 256 +ret 255 +end +ret uchar div mul cov 255 256 +end +fn afrow y ulong to void +py = add mul add get Ab 1 long y 256 128 +for x ulong get Af 3 +px = add mul add get Ab 0 long x 256 128 +at = add mul y get Af 3 x +put Alpha at afalpha px py +end +end +fn afpaint to void +for y ulong get Af 4 +afrow y +end +end +fn afglyph c uchar to bool +if eq get Af 0 0 +ret false +end +if not afpick c +ret false +end +for i ulong 65536 +put Alpha i 0 +end +put Af 2 0 +put Af 3 0 +put Af 4 1 +put Af 5 0 +put Ab 0 0 +put Ab 1 0 +put Apen 0 0 +put Apen 1 0 +while lt get Afpos 0 get Afpos 1 +cmd = get Afdata get Afpos 0 +put Afpos 0 add get Afpos 0 1 +if not afcmd cmd +ret false +end +end +if eq get Af 2 0 +ret true +end +if not afbox +ret false +end +afpaint +ret true +end diff --git a/native/omega/allen/gate.sh b/native/omega/allen/gate.sh new file mode 100755 index 00000000..3ea70dc4 --- /dev/null +++ b/native/omega/allen/gate.sh @@ -0,0 +1,164 @@ +#!/bin/sh +# External build/output comparison only. All behavioral tests execute Omega ELFs. +set -eu +root=$(CDPATH= cd -- "$(dirname "$0")/../../.." && pwd) +cd "$root" +out=$1 +mkdir -p "$out" +[ -z "$(ls -A "$out")" ] || { echo 'gate requires fresh output directory' >&2; exit 73; } +compiler=${OMEGA_COMPILER:-"$root/build/allen-toolchain/seed/out/omc"} +sh native/omega/allen/test-build.sh "$compiler" "$out/build-checks" +core="$out/core.om" +cat native/omega/allen/base.om native/omega/allen/vendor/sha256-core.om \ + native/omega/allen/runtime.om native/omega/allen/code.om \ + native/omega/allen/courier.om native/omega/allen/scheduler.om native/omega/allen/memory.om \ + native/omega/allen/intent.om native/omega/allen/reply.om \ + native/omega/allen/view.om native/omega/allen/scene.om native/omega/allen/paint.om native/omega/allen/application.om native/omega/allen/scene-input.om native/omega/allen/context.om native/omega/allen/font-data.om native/omega/allen/font.om native/omega/allen/look-paint.om native/omega/allen/surface.om native/omega/allen/presentation.om native/omega/allen/provider-core.om > "$core" +for name in runtime code courier scheduler application provider-core presentation font surface memory context intent reply view scene scene-input paint edges fixture golden render font-output font-render surface-render; do + cat "$core" > "$out/$name.om" + case "$name" in golden|render|font-output|font-render|surface-render) ;; *) cat native/omega/allen/tests/check.om >> "$out/$name.om" ;; esac + cat "native/omega/allen/tests/$name.om" >> "$out/$name.om" + native/omega/allen/build-one.sh "$out/$name.om" "$out/$name" + case "$name" in + fixture) + "$out/$name" < evidence/allen-omega-L694/short.wire > "$out/short.log" + "$out/$name" < evidence/allen-omega-L694/long.wire > "$out/long.log" + ;; + golden) "$out/$name" > "$out/memory-native.bin" ;; + render) "$out/$name" > "$out/mind-component.ppm" ;; + font-output) "$out/$name" > "$out/font.bin" ;; + font-render) "$out/$name" > "$out/font-specimen.ppm" ;; + surface-render) "$out/$name" > "$out/provider-surface.ppm" ;; + *) "$out/$name" > "$out/$name.log" ;; + esac + printf '%s compile=0 native-exit=0\n' "$name" +done +cmp "$out/font.bin" evidence/allen-omega-L694/L758/legacy-font.bin +printf 'font native masks match frozen external legacy oracle\n' +native/omega/allen/golden.sh "$out/reference" +cmp "$out/memory-native.bin" "$out/reference/memory-golden.bin" +cat "$core" native/omega/allen/main.om > "$out/allen.om" +native/omega/allen/build-one.sh "$out/allen.om" "$out/allen" +"$out/allen" < evidence/allen-omega-L694/stdio-input.txt > "$out/stdio-job.txt" 2> "$out/stdio-display.txt" +cmp "$out/stdio-job.txt" evidence/allen-omega-L694/stdio-job.txt +cmp "$out/stdio-display.txt" evidence/allen-omega-L694/stdio-display.txt +printf 'stdio native-exit=0 golden-cmp=0\n' +# The fixture generator is Omega too. Refuse the oversized operation and +# never execute the valid ASK following it (L719/L722 regression). +native/omega/allen/build-one.sh native/omega/allen/tests/stdio-overflow.om "$out/stdio-overflow-input" +"$out/stdio-overflow-input" > "$out/stdio-overflow.input" +set +e +"$out/allen" < "$out/stdio-overflow.input" > "$out/stdio-overflow.stdout" 2> "$out/stdio-overflow.stderr" +rc=$? +set -e +[ "$rc" = 65 ] || { echo "stdio overflow was not refused: exit=$rc" >&2; exit 1; } +[ ! -s "$out/stdio-overflow.stdout" ] || { echo 'stdio overflow executed a later job' >&2; exit 1; } +[ ! -s "$out/stdio-overflow.stderr" ] || { echo 'stdio overflow displayed a later answer' >&2; exit 1; } +printf 'stdio overflow native-exit=65 no-later-command=PASS\n' +# Real native provider entry, independent native input/output fixtures. +cat "$core" native/omega/allen/provider.om > "$out/provider.om" +native/omega/allen/build-one.sh "$out/provider.om" "$out/provider" +for name in provider-input provider-output provider-process; do + cat "$core" native/omega/allen/tests/check.om "native/omega/allen/tests/$name.om" > "$out/$name.om" + native/omega/allen/build-one.sh "$out/$name.om" "$out/$name" +done +printf 0 | "$out/provider-input" > "$out/provider.input" +"$out/provider" < "$out/provider.input" > "$out/provider.output" 2> "$out/provider.stderr" +{ printf '7\n0\n'; stat -c %s "$out/provider.output" "$out/provider.stderr"; cat "$out/provider.output" "$out/provider.stderr"; } > "$out/provider-process.receipt" +"$out/provider-process" < "$out/provider-process.receipt" > "$out/provider-process.log" +"$out/provider-output" < "$out/provider.output" > "$out/provider-stream.log" +# Byte-at-a-time native producer through a real pipe; collect both exits explicitly. +printf 7 > "$out/provider.mode" +mkfifo "$out/provider.pipe" +"$out/provider-input" < "$out/provider.mode" > "$out/provider.pipe" 2> "$out/provider-producer.stderr" & +producer=$! +set +e +"$out/provider" < "$out/provider.pipe" > "$out/provider-fragment.output" 2> "$out/provider-fragment.stderr" +consumer_rc=$? +wait "$producer" +producer_rc=$? +set -e +{ printf '7\n%s\n' "$consumer_rc"; stat -c %s "$out/provider-fragment.output" "$out/provider-fragment.stderr"; cat "$out/provider-fragment.output" "$out/provider-fragment.stderr"; } > "$out/provider-consumer.receipt" +"$out/provider-process" < "$out/provider-consumer.receipt" > "$out/provider-consumer.log" +{ printf '7\n%s\n0\n' "$producer_rc"; stat -c %s "$out/provider-producer.stderr"; cat "$out/provider-producer.stderr"; } > "$out/provider-producer.receipt" +"$out/provider-process" < "$out/provider-producer.receipt" > "$out/provider-producer.log" +cmp "$out/provider.output" "$out/provider-fragment.output" +"$out/provider-output" < "$out/provider-fragment.output" > "$out/provider-fragment.log" +printf 8 | "$out/provider-input" > "$out/provider-boot.expected" +for mode in 1 2 3 4 5 6; do + printf '%s' "$mode" | "$out/provider-input" > "$out/provider-bad-$mode.input" + set +e + "$out/provider" < "$out/provider-bad-$mode.input" > "$out/provider-bad-$mode.output" 2> "$out/provider-bad-$mode.stderr" + rc=$? + set -e + { printf '%s\n%s\n' "$mode" "$rc"; stat -c %s "$out/provider-bad-$mode.output" "$out/provider-bad-$mode.stderr"; cat "$out/provider-bad-$mode.output" "$out/provider-bad-$mode.stderr"; } > "$out/provider-bad-$mode.receipt" + "$out/provider-process" < "$out/provider-bad-$mode.receipt" > "$out/provider-bad-$mode.log" + printf 'provider malformed mode=%s exit=65 no-later-command=PASS\n' "$mode" +done +printf 'provider native-exit=0 fragmented-pipe=0 output-verifier=0\n' +# Compiled behavioral mutants must be valid ELFs and fail the original gates. +sed 's/if or eq get R 1 0 ne seq get R 0/if eq get R 1 0/' "$core" > "$out/stale-mutant.om" +cat native/omega/allen/tests/check.om native/omega/allen/tests/runtime.om >> "$out/stale-mutant.om" +sed 's/if ne ulong codecrc get C 3/if false/' "$core" > "$out/crc-mutant.om" +cat native/omega/allen/tests/check.om native/omega/allen/tests/code.om >> "$out/crc-mutant.om" +sed 's/ret eq d 0/ret true/' "$core" > "$out/hash-mutant.om" +cat native/omega/allen/tests/check.om native/omega/allen/tests/memory.om >> "$out/hash-mutant.om" +sed 's/if ne d 0/if false/' "$core" > "$out/readback-mutant.om" +cat native/omega/allen/tests/check.om native/omega/allen/tests/memory.om >> "$out/readback-mutant.om" +sed 's/if ne run get Q 0/if false/' "$core" > "$out/session-mutant.om" +cat native/omega/allen/tests/check.om native/omega/allen/tests/courier.om >> "$out/session-mutant.om" +sed 's/delay = ulong 10000/delay = ulong 2000/' "$core" > "$out/keepalive-mutant.om" +cat native/omega/allen/tests/check.om native/omega/allen/tests/scheduler.om >> "$out/keepalive-mutant.om" +sed 's/put T 6 1/put T 6 0/' "$core" > "$out/ackstop-mutant.om" +cat native/omega/allen/tests/check.om native/omega/allen/tests/scheduler.om >> "$out/ackstop-mutant.om" +sed 's/put Outb i get Appwire i/put Outb i get Outb i/' "$core" > "$out/pendingwire-mutant.om" +cat native/omega/allen/tests/check.om native/omega/allen/tests/application.om >> "$out/pendingwire-mutant.om" +sed 's/if or le get R 2 1 ne get C 0 get R 0/if false/' "$core" > "$out/appcode-mutant.om" +cat native/omega/allen/tests/check.om native/omega/allen/tests/application.om >> "$out/appcode-mutant.om" +sed 's/if hide/if false/' "$core" > "$out/thinking-mutant.om" +cat native/omega/allen/tests/check.om native/omega/allen/tests/scene-input.om >> "$out/thinking-mutant.om" +sed 's/if lt get Nm 8 12/if true/' "$core" > "$out/scenecap-mutant.om" +cat native/omega/allen/tests/check.om native/omega/allen/tests/scene-input.om >> "$out/scenecap-mutant.om" +sed 's/if and eq get Ctxgone index 0 lt given limit/if lt given limit/' "$core" > "$out/contextnote-mutant.om" +cat native/omega/allen/tests/check.om native/omega/allen/tests/context.om >> "$out/contextnote-mutant.om" +sed 's/if not ctxappend/if false/' "$core" > "$out/contextjob-mutant.om" +cat native/omega/allen/tests/check.om native/omega/allen/tests/context.om >> "$out/contextjob-mutant.om" +native/omega/allen/build-one.sh native/omega/allen/tests/provider-mutants.om "$out/provider-mutants" +{ printf 0; cat "$core"; } | "$out/provider-mutants" > "$out/autosent-mutant.om" +cat native/omega/allen/tests/check.om native/omega/allen/tests/provider-core.om >> "$out/autosent-mutant.om" +{ printf 1; cat "$core"; } | "$out/provider-mutants" > "$out/framecheck-mutant.om" +cat native/omega/allen/tests/check.om native/omega/allen/tests/provider-core.om >> "$out/framecheck-mutant.om" +native/omega/allen/build-one.sh native/omega/allen/tests/presentation-mutants.om "$out/presentation-mutants" +{ printf 0; cat "$core"; } | "$out/presentation-mutants" > "$out/staleview-mutant.om" +cat native/omega/allen/tests/check.om native/omega/allen/tests/presentation.om >> "$out/staleview-mutant.om" +{ printf 1; cat "$core"; } | "$out/presentation-mutants" > "$out/inputtail-mutant.om" +cat native/omega/allen/tests/check.om native/omega/allen/tests/presentation.om >> "$out/inputtail-mutant.om" +native/omega/allen/build-one.sh native/omega/allen/tests/font-mutants.om "$out/font-mutants" +{ printf 0; cat "$core"; } | "$out/font-mutants" > "$out/fontroot-mutant.om" +cat native/omega/allen/tests/check.om native/omega/allen/tests/font.om >> "$out/fontroot-mutant.om" +{ printf 1; cat "$core"; } | "$out/font-mutants" > "$out/fontalpha-mutant.om" +cat native/omega/allen/tests/check.om native/omega/allen/tests/font.om >> "$out/fontalpha-mutant.om" +native/omega/allen/build-one.sh native/omega/allen/tests/provider-display-mutants.om "$out/provider-display-mutants" +{ printf 0; cat "$core"; } | "$out/provider-display-mutants" > "$out/rawask-mutant.om" +cat native/omega/allen/tests/check.om native/omega/allen/tests/provider-core.om >> "$out/rawask-mutant.om" +{ printf 1; cat "$core"; } | "$out/provider-display-mutants" > "$out/rawrecv-mutant.om" +cat native/omega/allen/tests/check.om native/omega/allen/tests/provider-core.om >> "$out/rawrecv-mutant.om" +{ printf 2; cat "$core"; } | "$out/provider-display-mutants" > "$out/rawreset-mutant.om" +cat native/omega/allen/tests/check.om native/omega/allen/tests/provider-core.om >> "$out/rawreset-mutant.om" +native/omega/allen/build-one.sh native/omega/allen/tests/surface-mutants.om "$out/surface-mutants" +{ printf 0; cat "$core"; } | "$out/surface-mutants" > "$out/clipright-mutant.om" +cat native/omega/allen/tests/check.om native/omega/allen/tests/surface.om >> "$out/clipright-mutant.om" +{ printf 1; cat "$core"; } | "$out/surface-mutants" > "$out/blendbg-mutant.om" +cat native/omega/allen/tests/check.om native/omega/allen/tests/surface.om >> "$out/blendbg-mutant.om" +for name in stale crc hash readback session keepalive ackstop pendingwire appcode thinking scenecap contextnote contextjob autosent framecheck staleview inputtail fontroot fontalpha rawask rawrecv rawreset clipright blendbg; do + native/omega/allen/build-one.sh "$out/$name-mutant.om" "$out/$name-mutant" + set +e + "$out/$name-mutant" > "$out/$name-mutant.log" + rc=$? + set -e + if [ "$rc" -le 0 ] || [ "$rc" -ge 100 ]; then echo "mutant did not fail behaviorally: $name exit=$rc" >&2; exit 1; fi + printf '%s mutant compile=0 rejected-exit=%s\n' "$name" "$rc" +done +find native/omega/allen -type f -print0 | sort -z | xargs -0 sha256sum > "$out/source.sha256" +find "$out" -maxdepth 1 -type f -perm -100 -exec sha256sum {} + > "$out/binaries.sha256" +printf 'ALLEN_OMEGA_HOST: PASS; target=NOT_RUN; live=NOT_RUN\n' diff --git a/native/omega/allen/github.om b/native/omega/allen/github.om new file mode 100644 index 00000000..4240f6f0 --- /dev/null +++ b/native/omega/allen/github.om @@ -0,0 +1,1250 @@ +note SPDX-License-Identifier: AGPL-3.0-only +note Strict JSON copied unchanged from omega-mv native/hermes/src/json.om. +note Source revision b8e57bc6be5e40efc1d0d1ce01afdc58e814b449; single pinned parser. +note SPDX-License-Identifier: AGPL-3.0-only +note Bounded strict JSON. Tokens are valid only when jparse returns zero. +note Types object1 array2 string3 number4 true5 false6 null7. +note Raw token spans include string quotes; parent4096 denotes root. +global jin uchar 65536 +global jerr ulong 1 +global jcnt ulong 1 +global jbeg ulong 4096 +global jend ulong 4096 +global jtyp ulong 4096 +global jpar ulong 4096 +global jpos ulong 1 +global jlen ulong 1 +fn jfail to void +put jerr 0 1 +end +fn jpeek to ulong +p = get jpos 0 +if ge p get jlen 0 +ret 256 +end +ret ulong get jin p +end +fn jtake to ulong +c = jpeek +if eq c 256 +jfail +else +put jpos 0 add get jpos 0 1 +end +ret c +end +fn jspace to void +c = jpeek +while or or eq c 32 eq c 9 or eq c 10 eq c 13 +c = jtake +c = jpeek +end +end +fn jexpect want ulong to void +if ne jtake want +jfail +end +end +fn jhex to ulong +v = ulong 0 +for i ulong 4 +c = jtake +d = ulong 16 +if and ge c 48 le c 57 +d = sub c 48 +end +if and ge c 65 le c 70 +d = sub c 55 +end +if and ge c 97 le c 102 +d = sub c 87 +end +if eq d 16 +jfail +ret 0 +end +v = add mul v 16 d +end +ret v +end +fn jutf c ulong to void +n = ulong 0 +lo = ulong 128 +hi = ulong 191 +if and ge c 194 le c 223 +n = 1 +end +if and ge c 224 le c 239 +n = 2 +if eq c 224 +lo = 160 +end +if eq c 237 +hi = 159 +end +end +if and ge c 240 le c 244 +n = 3 +if eq c 240 +lo = 144 +end +if eq c 244 +hi = 143 +end +end +if eq n 0 +jfail +ret +end +for i ulong n +d = jtake +if or lt d lo gt d hi +jfail +ret +end +lo = 128 +hi = 191 +end +end +fn jstring to void +jexpect 34 +while eq get jerr 0 0 +c = jtake +if eq c 34 +ret +end +if or lt c 32 eq c 256 +jfail +ret +end +if eq c 92 +c = jtake +if eq c 117 +u = jhex +if and ge u 55296 le u 56319 +jexpect 92 +jexpect 117 +v = jhex +if or lt v 56320 gt v 57343 +jfail +end +else +if and ge u 56320 le u 57343 +jfail +end +end +else +ok = or or eq c 34 eq c 92 eq c 47 +ok = or ok or eq c 98 eq c 102 +ok = or ok or eq c 110 eq c 114 +ok = or ok eq c 116 +if not ok +jfail +end +end +else +if ge c 128 +jutf c +end +end +end +end +fn jdigit c ulong to bool +ret and ge c 48 le c 57 +end +fn jdigits to void +if not jdigit jpeek +jfail +ret +end +while jdigit jpeek +c = jtake +end +end +fn jnumber to void +if eq jpeek 45 +c = jtake +end +if eq jpeek 48 +c = jtake +else +jdigits +end +if eq jpeek 46 +c = jtake +jdigits +end +if or eq jpeek 101 eq jpeek 69 +c = jtake +if or eq jpeek 43 eq jpeek 45 +c = jtake +end +jdigits +end +end +fn jtoken typ ulong par ulong to ulong +n = get jcnt 0 +if ge n 4096 +jfail +ret 4096 +end +put jcnt 0 add n 1 +put jbeg n get jpos 0 +put jtyp n typ +put jpar n par +ret n +end +fn jvalue par ulong depth ulong to void +jspace +c = jpeek +t = ulong 0 +if eq c 123 +t = 1 +end +if eq c 91 +t = 2 +end +if eq c 34 +t = 3 +end +if or eq c 45 jdigit c +t = 4 +end +if eq c 116 +t = 5 +end +if eq c 102 +t = 6 +end +if eq c 110 +t = 7 +end +if eq t 0 +jfail +ret +end +id = jtoken t par +if ne get jerr 0 0 +ret +end +if le t 2 +if ge depth 32 +jfail +ret +end +c = jtake +closing = ulong 93 +if eq t 1 +closing = 125 +end +jspace +if ne jpeek closing +more = true +while and more eq get jerr 0 0 +if eq t 1 +if ne jpeek 34 +jfail +ret +end +key = jtoken 3 id +if ne get jerr 0 0 +ret +end +jstring +put jend key get jpos 0 +jspace +jexpect 58 +end +if eq get jerr 0 0 +jvalue id add depth 1 +end +jspace +if eq jpeek 44 +c = jtake +jspace +else +more = false +end +end +end +jexpect closing +else +if eq t 3 +jstring +end +if eq t 4 +jnumber +end +if eq t 5 +jexpect 116 +jexpect 114 +jexpect 117 +jexpect 101 +end +if eq t 6 +jexpect 102 +jexpect 97 +jexpect 108 +jexpect 115 +jexpect 101 +end +if eq t 7 +jexpect 110 +jexpect 117 +jexpect 108 +jexpect 108 +end +end +put jend id get jpos 0 +end +fn jparse n ulong to ulong +put jerr 0 0 +put jcnt 0 0 +put jpos 0 0 +put jlen 0 n +if or eq n 0 gt n len jin +jfail +ret 1 +end +jvalue 4096 0 +jspace +if ne get jpos 0 n +jfail +end +if ne get jerr 0 0 +put jcnt 0 0 +end +ret get jerr 0 +end + +note Network provider owns transport and writes only complete authenticated HTTPS bodies. +note Host api.github.com; no redirects or credentials. Ghreq path is not a URL. +note Ghreq kind,pathlen,unique generation,accept raw1/json0,maxbody,reserved3. +note ghreply must echo kind AND generation. Timeout/network failure uses status0. +global Ghbody uchar 262144 +global Ghpath uchar 1024 +global Ghreq ulong 8 +note Gh state0 idle1 loading2 ready3 error4 unsupported; generation; error; HTTP; +note view0 README1 files2 details; scroll; selected; read bytes; file count; +note pool bytes; directory bytes; clock; last accepted generation; readme absent. +global Gh ulong 16 +global Ghat ulong 4 +global Ghmeta uchar 1024 +note Metadata offsets name0/64, branch64/256, description320/512, sha832/64,date896/64. +global Ghlen ulong 8 +global Ghread uchar 262144 +global Ghdir uchar 512 +global Ghpool uchar 65536 +note Five words per directory entry: path offset,length,type(file1 dir2 other3),bytes,sha offset. +global Ghfiles ulong 1280 +global Ghdec uchar 4096 +global Ghdn ulong 1 +global Ghbad ulong 1 +global Ghword uchar 160 +note Repository identity is DISCOVERED from a live listing and validated, never fixed. +note Ghmeta 720/64 holds the selected full_name; 784/48 holds its created_at. +global Ghbase uchar 128 +global Ghslen ulong 1 +text Ghext "/repos/" +text Ghghu "https://github.com/" +text Ghown "aien-dev/" +text Ghlst "/orgs/aien-dev/repos?sort=created&direction=desc&per_page=1" +text Ghkeys "full_name\ndefault_branch\ndescription\nprivate\nhtml_url\nsha\ncommit\ncommitter\ndate\npath\ntype\nsize\ncreated_at\n" +text Ghsuf "/commits//readme?ref=/contents" +text Ghhex "0123456789ABCDEF" +text Ghvoc "repo\nrepository\nrepositories\ngit\ngithub\nfind\nshow\nopen\nbrowse\nwhere\nwhat\ncurrent\nyour\nallen\nsource\ncode\ncreate\ndelete\npush\nother\n" +note Select the first repository in the live listing, then prove its identity before use. +note Ordering is the server's (sort=created, direction=desc); we do not re-sort, we verify. +note The listing is a JSON array; token 0 is the array and token 1 its first object. +fn ghdiscover to bool +if or lt get jcnt 0 2 ne get jtyp 0 2 +ret false +end +if or ne get jtyp 1 1 ne get jpar 1 0 +ret false +end +if not ghcopy ghfield 1 1 720 64 5 +ret false +end +n = get Ghlen 5 +if le n len Ghown +ret false +end +for i ulong len Ghown +if ne get Ghmeta add 720 i get Ghown i +ret false +end +end +first = add 720 len Ghown +last = add 719 n +if or eq get Ghmeta first 46 eq get Ghmeta first 45 +ret false +end +if or eq get Ghmeta last 46 eq get Ghmeta last 45 +ret false +end +for i ulong sub n len Ghown +c = get Ghmeta add first i +ok = and ge c 48 le c 57 +ok = or ok and ge c 65 le c 90 +ok = or ok and ge c 97 le c 122 +ok = or ok or eq c 46 eq c 95 +ok = or ok eq c 45 +if not ok +ret false +end +end +if not ghcopy ghfield 1 13 784 48 6 +ret false +end +if ne get Ghlen 6 20 +ret false +end +for i ulong 20 +c = get Ghmeta add 784 i +want = uchar 0 +if or eq i 4 eq i 7 +want = 45 +end +if eq i 10 +want = 84 +end +if or eq i 13 eq i 16 +want = 58 +end +if eq i 19 +want = 90 +end +if ne want 0 +if ne c want +ret false +end +else +if or lt c 48 gt c 57 +ret false +end +end +end +ret eq get Ghbad 0 0 +end +fn gherror code ulong to void +put Gh 0 3 +put Gh 2 code +put Ghreq 0 0 +note Existing bytes are never drawn as current after an error. +end +fn ghtime epoch ulong to void +put Gh 11 epoch +end +fn ghinit to void +for i ulong 16 +put Gh i 0 +end +for i ulong 8 +put Ghreq i 0 +put Ghlen i 0 +end +for i ulong 4 +put Ghat i 0 +end +end +fn ghreset to void +for i ulong 8 +put Ghlen i 0 +end +for i ulong 4 +put Ghat i 0 +end +put Gh 2 0 +put Gh 3 0 +put Gh 4 0 +put Gh 5 0 +put Gh 6 0 +put Gh 7 0 +put Gh 8 0 +put Gh 9 0 +put Gh 10 0 +put Gh 12 0 +put Gh 13 0 +end +fn ghbyte c uchar to void +n = get Ghreq 1 +if ge n len Ghpath +put Ghbad 0 1 +ret +end +put Ghpath n c +put Ghreq 1 add n 1 +end +fn ghenc c uchar to void +ok = or and ge c 65 le c 90 and ge c 97 le c 122 +ok = or ok and ge c 48 le c 57 +ok = or ok or eq c 45 eq c 95 +ok = or ok or eq c 46 eq c 126 +if ok +ghbyte c +else +ghbyte 37 +ghbyte get Ghhex div ulong c 16 +ghbyte get Ghhex rem ulong c 16 +end +end +fn ghbasebuf to bool +note Ghbase = "/repos/" + the validated full_name held at Ghmeta 720. +n = get Ghlen 5 +if or eq n 0 gt n 64 +ret false +end +put Ghslen 0 0 +for i ulong len Ghext +put Ghbase i get Ghext i +put Ghslen 0 add i 1 +end +for i ulong n +put Ghbase add len Ghext i get Ghmeta add 720 i +end +put Ghslen 0 add len Ghext n +ret true +end +fn ghissue kind ulong to void +if eq get Gh 1 18446744073709551615 +gherror 8 +ret +end +put Gh 1 add get Gh 1 1 +put Ghreq 0 kind +put Ghreq 1 0 +put Ghreq 2 get Gh 1 +put Ghreq 3 0 +put Ghreq 4 65536 +put Ghbad 0 0 +note Clock is per response, never inherited as a fresh retrieval timestamp. +put Gh 11 0 +if eq kind 5 +for i ulong len Ghlst +ghbyte get Ghlst i +end +else +if not ghbasebuf +gherror 3 +ret +end +for i ulong get Ghslen 0 +ghbyte get Ghbase i +end +end +if eq kind 2 +for i ulong 9 +ghbyte get Ghsuf i +end +for i ulong get Ghlen 1 +ghenc get Ghmeta add 64 i +end +end +if eq kind 3 +put Ghreq 3 1 +put Ghreq 4 len Ghbody +for i ulong 12 +ghbyte get Ghsuf add 9 i +end +end +if eq kind 4 +for i ulong 9 +ghbyte get Ghsuf add 21 i +end +if gt get Gh 10 0 +ghbyte 47 +for i ulong get Gh 10 +c = get Ghdir i +if eq c 47 +ghbyte c +else +ghenc c +end +end +end +ghbyte 63 +ghbyte 114 +ghbyte 101 +ghbyte 102 +ghbyte 61 +end +if or eq kind 3 eq kind 4 +for i ulong get Ghlen 3 +ghbyte get Ghmeta add 832 i +end +end +if ne get Ghbad 0 0 +gherror 8 +ret +end +put Gh 0 1 +end +fn ghrefresh to void +ghreset +ghissue 5 +end +note Intent is bounded word classification, not a canned prompt equality. +fn ghvocab n ulong to ulong +word = ulong 1 +at = ulong 0 +same = true +for i ulong len Ghvoc +c = get Ghvoc i +if eq c 10 +if and same eq at n +ret word +end +word = add word 1 +at = 0 +same = true +else +if ge at n +same = false +else +if ne c get Ghword at +same = false +end +end +at = add at 1 +end +end +ret 0 +end +fn ghask to bool +ghreset +put Ghreq 0 0 +put Gh 0 4 +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +bits = ulong 0 +at = ulong 0 +for i ulong add n 1 +c = uchar 32 +if lt i n +c = get In i +end +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if and ge c 97 le c 122 +put Ghword at c +at = add at 1 +else +if or eq c 47 eq c 58 +ret false +end +if gt at 0 +w = ghvocab at +if and ge w 1 le w 5 +bits = or bits 1 +end +if and ge w 6 le w 16 +bits = or bits 2 +end +if ge w 17 +ret false +end +at = 0 +end +end +end +if ne bits 3 +ret false +end +ghissue 5 +ret true +end +note Decode only validated JSON strings, preserving UTF8. No renderer executes text. +fn ghdbyte c ulong to void +n = get Ghdn 0 +if ge n len Ghdec +put Ghbad 0 1 +ret +end +put Ghdec n uchar c +put Ghdn 0 add n 1 +end +fn ghutf cp ulong to void +if lt cp 128 +ghdbyte cp +else +if lt cp 2048 +ghdbyte add 192 shr cp 6 +ghdbyte add 128 and cp 63 +else +if lt cp 65536 +ghdbyte add 224 shr cp 12 +ghdbyte add 128 and shr cp 6 63 +ghdbyte add 128 and cp 63 +else +ghdbyte add 240 shr cp 18 +ghdbyte add 128 and shr cp 12 63 +ghdbyte add 128 and shr cp 6 63 +ghdbyte add 128 and cp 63 +end +end +end +end +fn ghdecode id ulong to bool +put Ghdn 0 0 +if ge id get jcnt 0 +ret false +end +if ne get jtyp id 3 +ret false +end +put jpos 0 add get jbeg id 1 +stop = sub get jend id 1 +while lt get jpos 0 stop +c = jtake +if eq c 92 +c = jtake +if eq c 117 +c = jhex +if and ge c 55296 le c 56319 +put jpos 0 add get jpos 0 2 +v = jhex +c = add 65536 add mul sub c 55296 1024 sub v 56320 +end +ghutf c +else +if eq c 98 +c = 8 +end +if eq c 102 +c = 12 +end +if eq c 110 +c = 10 +end +if eq c 114 +c = 13 +end +if eq c 116 +c = 9 +end +ghdbyte c +end +else +ghdbyte c +end +if ne get Ghbad 0 0 +ret false +end +end +ret true +end +fn ghwhich id ulong to ulong +if not ghdecode id +ret 0 +end +word = ulong 1 +at = ulong 0 +same = true +for i ulong len Ghkeys +c = get Ghkeys i +if eq c 10 +if and same eq at get Ghdn 0 +ret word +end +word = add word 1 +at = 0 +same = true +else +if ge at get Ghdn 0 +same = false +else +if ne c get Ghdec at +same = false +end +end +at = add at 1 +end +end +ret 0 +end +fn ghnext id ulong to ulong +stop = get jend id +i = add id 1 +while lt i get jcnt 0 +if ge get jbeg i stop +ret i +end +i = add i 1 +end +ret i +end +note Lookup validates object and rejects duplicate decoded keys for each consumed field. +fn ghfield obj ulong key ulong to ulong +if ge obj get jcnt 0 +put Ghbad 0 1 +ret 4096 +end +if ne get jtyp obj 1 +put Ghbad 0 1 +ret 4096 +end +found = ulong 4096 +i = add obj 1 +while lt i get jcnt 0 +if ge get jbeg i get jend obj +ret found +end +if eq ghwhich i key +if ne found 4096 +put Ghbad 0 1 +end +found = add i 1 +end +i = ghnext add i 1 +end +ret found +end +fn ghcopy id ulong off ulong cap ulong slot ulong to bool +if not ghdecode id +ret false +end +n = get Ghdn 0 +if gt n cap +ret false +end +for i ulong n +c = get Ghdec i +if lt c 32 +ret false +end +put Ghmeta add off i c +end +put Ghlen slot n +ret true +end +fn ghbranch to bool +n = get Ghlen 1 +if eq n 0 +ret false +end +for i ulong n +c = get Ghmeta add 64 i +if or lt c 33 eq c 127 +ret false +end +end +ret true +end +fn ghmetadata to bool +if not ghcopy ghfield 0 1 0 64 0 +ret false +end +if eq get Ghlen 5 0 +ret false +end +if ne get Ghlen 0 get Ghlen 5 +ret false +end +for i ulong get Ghlen 5 +if ne get Ghmeta i get Ghmeta add 720 i +ret false +end +end +id = ghfield 0 4 +if eq id 4096 +ret false +end +if ne get jtyp id 6 +ret false +end +if not ghdecode ghfield 0 5 +ret false +end +if ne get Ghdn 0 add len Ghghu get Ghlen 5 +ret false +end +for i ulong len Ghghu +if ne get Ghdec i get Ghghu i +ret false +end +end +for i ulong get Ghlen 5 +if ne get Ghdec add len Ghghu i get Ghmeta add 720 i +ret false +end +end +if not ghcopy ghfield 0 2 64 256 1 +ret false +end +if not ghbranch +ret false +end +id = ghfield 0 3 +if eq id 4096 +ret false +end +if ne get jtyp id 7 +if not ghcopy id 320 512 2 +ret false +end +end +ret eq get Ghbad 0 0 +end +fn ghsha to bool +if ne get Ghdn 0 40 +ret false +end +for i ulong 40 +c = get Ghdec i +ok = or and ge c 48 le c 57 and ge c 97 le c 102 +if not ok +ret false +end +end +ret true +end +fn ghcommit to bool +if not ghdecode ghfield 0 6 +ret false +end +if not ghsha +ret false +end +for i ulong 40 +put Ghmeta add 832 i get Ghdec i +end +put Ghlen 3 40 +id = ghfield 0 7 +id = ghfield id 8 +id = ghfield id 9 +if not ghcopy id 896 64 4 +ret false +end +if ne get Ghlen 4 20 +ret false +end +for i ulong 20 +c = get Ghmeta add 896 i +want = uchar 0 +if or eq i 4 eq i 7 +want = 45 +end +if eq i 10 +want = 84 +end +if or eq i 13 eq i 16 +want = 58 +end +if eq i 19 +want = 90 +end +if ne want 0 +if ne c want +ret false +end +else +if or lt c 48 gt c 57 +ret false +end +end +end +ret eq get Ghbad 0 0 +end +note Paths must be relative immediate children of the requested directory. +note No dot components, controls, backslash, URL metacharacters or percent escapes. +fn ghpathok to bool +n = get Ghdn 0 +base = get Gh 10 +if or eq n 0 gt n 511 +ret false +end +at = ulong 0 +if gt base 0 +if le n add base 1 +ret false +end +for i ulong base +if ne get Ghdec i get Ghdir i +ret false +end +end +if ne get Ghdec base 47 +ret false +end +at = add base 1 +end +size = sub n at +if eq get Ghdec at 46 +if eq size 1 +ret false +end +if eq size 2 +if eq get Ghdec add at 1 46 +ret false +end +end +end +while lt at n +c = get Ghdec at +if or lt c 32 eq c 127 +ret false +end +if or or eq c 47 eq c 92 or eq c 58 eq c 37 +ret false +end +if or eq c 63 eq c 35 +ret false +end +at = add at 1 +end +ret true +end +fn ghuint id ulong to ulong +if ge id get jcnt 0 +put Ghbad 0 1 +ret 0 +end +if ne get jtyp id 4 +put Ghbad 0 1 +ret 0 +end +v = ulong 0 +p = get jbeg id +while lt p get jend id +c = get jin p +if or lt c 48 gt c 57 +put Ghbad 0 1 +ret 0 +end +if gt v 1844674407370955161 +put Ghbad 0 1 +ret 0 +end +if eq v 1844674407370955161 +if gt c 53 +put Ghbad 0 1 +ret 0 +end +end +v = add mul v 10 sub ulong c 48 +p = add p 1 +end +ret v +end +fn ghentry obj ulong to bool +if ge get Gh 8 256 +ret false +end +if not ghdecode ghfield obj 10 +ret false +end +if not ghpathok +ret false +end +n = get Ghdn 0 +p = get Gh 9 +if gt add add p n 40 len Ghpool +ret false +end +slot = mul get Gh 8 5 +put Ghfiles slot p +put Ghfiles add slot 1 n +for i ulong n +put Ghpool add p i get Ghdec i +end +p = add p n +put Ghfiles add slot 4 p +if not ghdecode ghfield obj 6 +ret false +end +if not ghsha +ret false +end +for i ulong 40 +put Ghpool add p i get Ghdec i +end +put Gh 9 add p 40 +put Ghfiles add slot 3 ghuint ghfield obj 12 +if not ghdecode ghfield obj 11 +ret false +end +typ = ulong 3 +if eq get Ghdn 0 4 +if and eq get Ghdec 0 102 eq get Ghdec 1 105 +if and eq get Ghdec 2 108 eq get Ghdec 3 101 +typ = 1 +end +end +end +if eq get Ghdn 0 3 +if and eq get Ghdec 0 100 eq get Ghdec 1 105 +if eq get Ghdec 2 114 +typ = 2 +end +end +end +put Ghfiles add slot 2 typ +put Gh 8 add get Gh 8 1 +ret eq get Ghbad 0 0 +end +fn ghlisting to bool +if ne get jtyp 0 2 +ret false +end +put Gh 8 0 +put Gh 9 0 +i = ulong 1 +while lt i get jcnt 0 +if not ghentry i +ret false +end +i = ghnext i +end +ret eq get Ghbad 0 0 +end +fn ghrawutf p ulong n ulong to ulong +c = ulong get Ghbody p +p = add p 1 +if lt c 128 +if lt c 32 +if not or or eq c 9 eq c 10 eq c 13 +ret 262145 +end +end +if eq c 127 +ret 262145 +end +ret p +end +k = ulong 0 +lo = ulong 128 +hi = ulong 191 +if and ge c 194 le c 223 +k = 1 +end +if and ge c 224 le c 239 +k = 2 +if eq c 224 +lo = 160 +end +if eq c 237 +hi = 159 +end +end +if and ge c 240 le c 244 +k = 3 +if eq c 240 +lo = 144 +end +if eq c 244 +hi = 143 +end +end +if eq k 0 +ret 262145 +end +if gt add p k n +ret 262145 +end +for i ulong k +c = ulong get Ghbody p +if or lt c lo gt c hi +ret 262145 +end +p = add p 1 +lo = 128 +hi = 191 +end +ret p +end +fn ghreadme n ulong to bool +note Validate plain UTF8 and reject binary controls; tabs/newlines are text. +p = ulong 0 +while lt p n +p = ghrawutf p n +if gt p n +ret false +end +end +for i ulong n +put Ghread i get Ghbody i +end +put Gh 7 n +ret true +end +fn ghreply kind ulong status ulong size ulong gen ulong to bool +if or eq kind 0 ne kind get Ghreq 0 +ret false +end +if ne gen get Ghreq 2 +ret false +end +put Gh 3 status +if gt size get Ghreq 4 +gherror 2 +ret true +end +if and eq kind 3 eq status 404 +put Gh 13 1 +put Gh 7 0 +put Ghat 2 get Gh 11 +ghissue 4 +ret true +end +if ne status 200 +if or eq status 403 eq status 429 +gherror 4 +else +gherror 1 +end +ret true +end +put Ghbad 0 0 +ok = false +if eq kind 3 +ok = ghreadme size +else +for i ulong size +put jin i get Ghbody i +end +if ne jparse size 0 +gherror 3 +ret true +end +if eq kind 1 +ok = ghmetadata +end +if eq kind 2 +ok = ghcommit +end +if eq kind 4 +ok = ghlisting +end +if eq kind 5 +ok = ghdiscover +end +end +if not ok +if eq kind 5 +note A rejected listing leaves no repository name behind for the header to draw. +put Ghlen 5 0 +put Ghlen 6 0 +end +gherror 3 +ret true +end +put Gh 12 gen +if eq kind 5 +ghissue 1 +ret true +end +put Ghat sub kind 1 get Gh 11 +if lt kind 4 +ghissue add kind 1 +else +put Ghreq 0 0 +put Gh 0 2 +put Gh 5 0 +put Gh 6 0 +end +ret true +end diff --git a/native/omega/allen/golden.sh b/native/omega/allen/golden.sh new file mode 100755 index 00000000..71a38e2b --- /dev/null +++ b/native/omega/allen/golden.sh @@ -0,0 +1,14 @@ +#!/bin/sh +# External development fixture construction from frozen legacy byte layout. +set -eu +out=$1 +mkdir -p "$out" +dd if=/dev/zero of="$out/memory-golden.bin" bs=4096 count=1 status=none +printf 'AIENALM1\004\000\000\000\114\000\000\000\001\000\000\000\000\000\000\000' | dd of="$out/memory-golden.bin" conv=notrunc status=none +printf '\003' | dd of="$out/memory-golden.bin" bs=1 seek=64 conv=notrunc status=none +printf 'Allen' | dd of="$out/memory-golden.bin" bs=1 seek=104 conv=notrunc status=none +{ + dd if="$out/memory-golden.bin" bs=1 count=32 status=none + dd if="$out/memory-golden.bin" bs=1 skip=64 count=76 status=none +} > "$out/hash-input.bin" +sha256sum "$out/hash-input.bin" | cut -d' ' -f1 | xxd -r -p | dd of="$out/memory-golden.bin" bs=1 seek=32 conv=notrunc status=none diff --git a/native/omega/allen/http.om b/native/omega/allen/http.om new file mode 100644 index 00000000..12ffb4ff --- /dev/null +++ b/native/omega/allen/http.om @@ -0,0 +1,495 @@ +note SPDX-License-Identifier: MIT +note HTTP/1.1 framing for one authenticated api.github.com connection, RFC 9110/9112. +note Only TLS-authenticated plaintext enters Hchunk. No redirects, compression or pipelining. +global Httpreq uchar 8192 +global Httpreqn ulong 1 +global Hchunk uchar 16384 +global Hstate ulong 8 +global Hline uchar 8192 +global Hp ulong 16 +text Hget "GET " +text Htail " HTTP/1.1\nHost: api.github.com\nUser-Agent: Allen-Omega/1.0\nAccept-Encoding: identity\nX-GitHub-Api-Version: 2022-11-28\nConnection: close\nAccept: " +text Hjson "application/vnd.github+json" +text Hraw "application/vnd.github.raw+json" +text Hver "HTTP/1.1 " +text Hcl "content-length" +text Hte "transfer-encoding" +text Hce "content-encoding" +text Hckword "chunked" +text Hident "identity" +text Htokens "!#$%&'*+-.^_`|~" +note Hstate: state(0idle,1reading,2done,3error),status,body bytes,generation,kind,error. +note Hp: phase,line bytes,CR pending,header bytes,CL present,CL,TE,remaining,maxbody,interim. +fn hplower c uchar to uchar +if and ge c 65 le c 90 +ret uchar add ulong c 32 +end +ret c +end +fn hpkw kind ulong at ulong to uchar +if eq kind 0 +ret get Hcl at +end +if eq kind 1 +ret get Hte at +end +if eq kind 2 +ret get Hce at +end +if eq kind 3 +ret get Hckword at +end +ret get Hident at +end +fn hpeq at ulong n ulong kind ulong size ulong to bool +if ne n size +ret false +end +for i ulong size +if ne hplower get Hline add at i hpkw kind i +ret false +end +end +ret true +end +fn hpfail code ulong to void +put Hstate 0 3 +put Hstate 5 code +put Hstate 2 0 +put Httpreqn 0 0 +put Hp 0 10 +end +fn hpemit c uchar to void +n = get Httpreqn 0 +if ge n len Httpreq +hpfail 1 +ret +end +put Httpreq n c +put Httpreqn 0 add n 1 +end +fn hpcrlf to void +hpemit 13 +hpemit 10 +end +fn httpstart kind ulong gen ulong mode ulong maxbody ulong pathlen ulong to bool +for i ulong 16 +put Hp i 0 +end +for i ulong 8 +put Hstate i 0 +end +put Httpreqn 0 0 +if or or eq pathlen 0 ge pathlen len Ghpath gt maxbody len Ghbody +hpfail 2 +ret false +end +if or gt mode 1 ne get Ghpath 0 47 +hpfail 2 +ret false +end +for i ulong pathlen +c = get Ghpath i +if or or le c 32 ge c 127 eq c 35 +hpfail 2 +ret false +end +end +for i ulong len Hget +hpemit get Hget i +end +for i ulong pathlen +hpemit get Ghpath i +end +for i ulong len Htail +c = get Htail i +if eq c 10 +hpcrlf +else +hpemit c +end +end +if eq mode 0 +for i ulong len Hjson +hpemit get Hjson i +end +else +for i ulong len Hraw +hpemit get Hraw i +end +end +hpcrlf +hpcrlf +if eq get Hstate 0 3 +ret false +end +put Hstate 0 1 +put Hstate 3 gen +put Hstate 4 kind +put Hp 8 maxbody +ret true +end +fn hptoken c uchar to bool +if or or and ge c 65 le c 90 and ge c 97 le c 122 and ge c 48 le c 57 +ret true +end +for i ulong len Htokens +if eq c get Htokens i +ret true +end +end +ret false +end +fn hpfinish to void +put Hp 0 9 +put Hstate 0 2 +end +fn hpstatus to void +n = get Hp 1 +if lt n 12 +hpfail 3 +ret +end +for i ulong len Hver +if ne get Hline i get Hver i +hpfail 3 +ret +end +end +s = ulong 0 +for i ulong 3 +c = get Hline add i 9 +if or lt c 48 gt c 57 +hpfail 3 +ret +end +s = add mul s 10 sub ulong c 48 +end +if or lt s 100 gt s 599 +hpfail 3 +ret +end +if gt n 12 +if ne get Hline 12 32 +hpfail 3 +ret +end +end +put Hstate 1 s +put Hp 0 1 +end +fn hpheadersend to void +s = get Hstate 1 +if lt s 200 +if or or eq s 101 gt get Hp 9 2 ne get Hp 6 0 +hpfail 4 +ret +end +if and ne get Hp 4 0 ne get Hp 5 0 +hpfail 4 +ret +end +put Hp 9 add get Hp 9 1 +put Hp 0 0 +put Hp 4 0 +put Hp 5 0 +put Hp 6 0 +ret +end +if and ne get Hp 4 0 ne get Hp 6 0 +hpfail 5 +ret +end +if or eq s 204 eq s 304 +if or ne get Hp 6 0 and ne get Hp 4 0 ne get Hp 5 0 +hpfail 5 +else +hpfinish +end +ret +end +if ne get Hp 6 0 +put Hp 0 3 +ret +end +if ne get Hp 4 0 +put Hp 7 get Hp 5 +if eq get Hp 7 0 +hpfinish +else +put Hp 0 2 +end +ret +end +note Close-delimited bodies complete only after authenticated TLS close_notify via httpend. +put Hp 0 8 +end +fn hpdecimal at ulong stop ulong to bool +v = ulong 0 +for i ulong sub stop at +c = get Hline add at i +if or lt c 48 gt c 57 +ret false +end +d = sub ulong c 48 +if gt v div get Hp 8 10 +ret false +end +v = add mul v 10 d +if gt v get Hp 8 +ret false +end +end +put Hp 5 v +ret true +end +fn hpheader trailer bool to void +n = get Hp 1 +if eq n 0 +if trailer +hpfinish +else +hpheadersend +end +ret +end +p = ulong 0 +while lt p n +if eq get Hline p 58 +break +end +if not hptoken get Hline p +hpfail 6 +ret +end +p = add p 1 +end +if or eq p 0 eq p n +hpfail 6 +ret +end +beg = add p 1 +stop = n +while lt beg stop +c = get Hline beg +if and ne c 32 ne c 9 +break +end +beg = add beg 1 +end +while gt stop beg +c = get Hline sub stop 1 +if and ne c 32 ne c 9 +break +end +stop = sub stop 1 +end +cl = hpeq 0 p 0 14 +te = hpeq 0 p 1 17 +ce = hpeq 0 p 2 16 +if trailer +if or or cl te ce +hpfail 7 +end +ret +end +if cl +if or ne get Hp 4 0 eq beg stop +hpfail 5 +ret +end +if not hpdecimal beg stop +hpfail 8 +ret +end +put Hp 4 1 +end +if te +if or ne get Hp 6 0 not hpeq beg sub stop beg 3 7 +hpfail 5 +ret +end +put Hp 6 1 +end +if ce +if not hpeq beg sub stop beg 4 8 +hpfail 9 +end +end +end +fn hphex c uchar to ulong +if and ge c 48 le c 57 +ret sub ulong c 48 +end +x = hplower c +if and ge x 97 le x 102 +ret sub ulong x 87 +end +ret 16 +end +fn hpchunkline to void +n = get Hp 1 +v = ulong 0 +p = ulong 0 +while lt p n +c = get Hline p +if eq c 59 +break +end +d = hphex c +if or ge d 16 gt v div get Hp 8 16 +hpfail 10 +ret +end +v = add mul v 16 d +if gt v sub get Hp 8 get Hstate 2 +hpfail 8 +ret +end +p = add p 1 +end +if eq p 0 +hpfail 10 +ret +end +if and lt p n eq add p 1 n +hpfail 10 +ret +end +put Hp 7 v +if eq v 0 +put Hp 0 7 +else +put Hp 0 4 +end +end +fn hplineend to void +p = get Hp 0 +if eq p 0 +hpstatus +else +if eq p 1 +hpheader false +else +if eq p 3 +hpchunkline +else +if eq p 7 +hpheader true +else +hpfail 11 +end +end +end +end +put Hp 1 0 +put Hp 2 0 +end +fn hplinebyte c uchar to void +put Hp 3 add get Hp 3 1 +if gt get Hp 3 65536 +hpfail 12 +ret +end +if ne get Hp 2 0 +if ne c 10 +hpfail 6 +else +hplineend +end +ret +end +if eq c 13 +put Hp 2 1 +ret +end +if or or eq c 10 and lt c 32 ne c 9 eq c 127 +hpfail 6 +ret +end +n = get Hp 1 +if ge n len Hline +hpfail 12 +ret +end +put Hline n c +put Hp 1 add n 1 +end +fn hpbody c uchar to void +n = get Hstate 2 +if ge n get Hp 8 +hpfail 8 +ret +end +put Ghbody n c +put Hstate 2 add n 1 +phase = get Hp 0 +if or eq phase 2 eq phase 4 +left = sub get Hp 7 1 +put Hp 7 left +if eq left 0 +if eq phase 2 +hpfinish +else +put Hp 0 5 +end +end +end +end +fn httpfeed n ulong to bool +if or gt n len Hchunk and eq get Hstate 0 2 ne n 0 +hpfail 13 +ret false +end +if ne get Hstate 0 1 +ret false +end +for i ulong n +c = get Hchunk i +phase = get Hp 0 +if or or eq phase 0 eq phase 1 or eq phase 3 eq phase 7 +hplinebyte c +else +if or or eq phase 2 eq phase 4 eq phase 8 +hpbody c +else +if eq phase 5 +if eq c 13 +put Hp 0 6 +else +hpfail 10 +end +else +if eq phase 6 +if eq c 10 +put Hp 0 3 +else +hpfail 10 +end +else +hpfail 13 +end +end +end +end +if eq get Hstate 0 3 +ret false +end +end +ret true +end +fn httpend auth bool to bool +if not auth +hpfail 14 +ret false +end +if eq get Hstate 0 2 +ret true +end +if and eq get Hstate 0 1 eq get Hp 0 8 +hpfinish +ret true +end +hpfail 14 +ret false +end diff --git a/native/omega/allen/intent.om b/native/omega/allen/intent.om new file mode 100644 index 00000000..c4cd75a5 --- /dev/null +++ b/native/omega/allen/intent.om @@ -0,0 +1,292 @@ +note Intent vocabulary frozen from svc/allen_intent.c. It selects jobs, never answers. +global Fold uchar 160 +global Fn ulong 2 +text Lists "please|can you|could you|would you|will you|i d like you to|i want you to|i need you to|allen|hey allen|ok|okay\nwrite|make|build|create|code|program|generate|implement|develop|give me a|i need a|i want a\ncode|program|programs|script|scripts|function|functions|app|apps|application|game|games|website|web page|webpage|calculator|converter|parser|compiler|interpreter|algorithm|class|api|server|bot|regex|unit test|unit tests|cli|command line tool|snake|tetris|pong|todo app|to do app|to do list app|timer app|stopwatch|python|javascript|typescript|rust|golang|java|kotlin|swift|ruby|php|html|css|sql|bash|shell script|c program|c code|in c|c plus plus|cpp|mojo|zig|haskell|lua|perl\npoem|poems|haiku|story|stories|song|songs|letter|email|essay|joke|jokes|limerick|speech\ncode|program|script\nnow|add|also|and|change|make it|make the|rename|remove|delete|replace|use|fix|put|give it|let it|instead|then|next|can it|could it|it should|the|move|turn|show|split|convert it|rewrite|port it|translate it|explain it\nwrite|make|build|create|code|program|draft|compose|generate|design|implement|invent|name|give me a|i need a|i want a\na poem|a haiku|a story|a song|a script|a function|a program|a list of|some code|a letter|an email|a plan for|a name for\nexplain|what is|what are|whats|what s|why|how does|how do|how is|how are|describe|tell me about|what does|who was|who is|define|when was|when did|where is|is it true\ndifference between|mean|means\ndo|run|fix|find|search|look up|check|open|send|start|stop|install|set up|plan|schedule|calculate|work out|convert|translate|summarize|summarise|list|sort|count|compare|turn|go\n" +fn foldin to void +n = ulong 0 +space = false +for i ulong get Inlen 0 +c = get In i +if and ge c 65 le c 90 +c = add sub c 65 97 +end +if or and ge c 97 le c 122 isdigit c +if and space gt n 0 +put Fold n uchar 32 +n = add n 1 +end +put Fold n c +n = add n 1 +space = false +else +space = true +end +end +put Fn 0 n +put Fn 1 0 +end +fn phrase at ulong off ulong size ulong to bool +if gt add at size get Fn 0 +ret false +end +for i ulong size +if ne get Fold add at i get Lists add off i +ret false +end +end +if lt add at size get Fn 0 +if ne get Fold add at size 32 +ret false +end +end +ret true +end +fn inphrase off ulong size ulong anypos bool to bool +if not anypos +ret phrase get Fn 1 off size +end +count = sub get Fn 0 get Fn 1 +for i ulong count +at = add i get Fn 1 +ok = eq at get Fn 1 +if gt at 0 +ok = or ok eq get Fold sub at 1 32 +end +if ok +if phrase at off size +ret true +end +end +end +ret false +end +fn listed group ulong anypos bool to ulong +g = ulong 0 +s = ulong 0 +for p ulong len Lists +c = get Lists p +if or eq c 124 eq c 10 +if eq g group +if inphrase s sub p s anypos +ret sub p s +end +end +s = add p 1 +if eq c 10 +g = add g 1 +end +end +end +ret 0 +end +fn classify to ulong +if not textok +ret 0 +end +foldin +skip = listed 0 false +while gt skip 0 +if ge add get Fn 1 skip get Fn 0 +skip = 0 +else +put Fn 1 add add get Fn 1 skip 1 +skip = listed 0 false +end +end +if and ne get R 6 0 gt listed 5 false 0 +ret 3 +end +plain = listed 4 false +if or eq plain 4 eq plain 7 +ret 2 +end +if and gt listed 3 true 0 eq listed 4 true 0 +ret 1 +end +if and gt listed 1 false 0 gt listed 2 true 0 +ret 2 +end +ret 1 +end +note Ordinary want enum0chat,1make,2explain,3do. +fn jobwant to ulong +if gt listed 8 false 0 +ret 2 +end +if or gt listed 6 false 0 gt listed 7 true 0 +ret 1 +end +if gt listed 10 false 0 +ret 3 +end +if gt listed 9 true 0 +ret 2 +end +ret 0 +end +text Job "JOB " +text Codeask " asked " +text Forcode " for code.\t" +text Formore " to change the code just shown.\t" +text Wantstr "chatmakeexplaindo" +text Intro "You are the far hands of " +text Home ", a quiet presence living in AIENOS on " +text Comp "'s computer. You answer as " +text Sees "; " +text Words " sees only your words, as if " +text Said " said them. Plain English, short sentences, no headings, no lists, no greetings, no apologies. Plain letters and punctuation only: no dashes, no curly quotes, no symbols. Never mention a model, a prompt or instructions. " +text Make " asked for something to be made. Make it whole and correct. Begin with one short sentence saying what you made, then the work itself." +text Explain " asked to understand something. Explain it in three plain sentences at most, the heart of it first, no more than is needed." +text Doing " asked for something to be done. " +text Cannot " cannot yet act outside this computer, so say in two or three short sentences what you would do, in order, and what you would need." +text Chat " said something in passing. Answer in one or two warm, plain sentences." +text Allen "Allen" +text Person "the person" +fn selfemit to void +off = add 40 mul mem32 32 113 +if eq get Mem off 0 +for i ulong len Allen +emitb get Allen i +end +else +for i ulong 24 +c = get Mem add off i +if eq c 0 +ret +end +emitb c +end +end +end +fn whoemit to void +if eq get Mem 8 0 +for i ulong len Person +emitb get Person i +end +else +for i ulong 24 +c = get Mem add i 8 +if eq c 0 +ret +end +emitb c +end +end +end +fn jobbuild kind ulong seq ulong to bool +if or lt kind 1 gt kind 3 +ret false +end +if or eq seq 0 gt seq 4294967295 +ret false +end +if not textok +ret false +end +outreset +for i ulong len Job +emitb get Job i +end +emitn seq +emitb 32 +if gt kind 1 +emitb 99 +emitb 111 +emitb 100 +emitb 101 +if eq kind 3 +emitb 45 +emitb 109 +emitb 111 +emitb 114 +emitb 101 +end +emitb 32 +whoemit +for i ulong len Codeask +emitb get Codeask i +end +selfemit +if eq kind 3 +for i ulong len Formore +emitb get Formore i +end +else +for i ulong len Forcode +emitb get Forcode i +end +end +else +w = jobwant +off = ulong 0 +size = ulong 4 +if eq w 1 +off = 4 +end +if eq w 2 +off = 8 +size = 7 +end +if eq w 3 +off = 15 +size = 2 +end +for i ulong size +emitb get Wantstr add off i +end +emitb 32 +for i ulong len Intro +emitb get Intro i +end +selfemit +for i ulong len Home +emitb get Home i +end +whoemit +for i ulong len Comp +emitb get Comp i +end +selfemit +for i ulong len Sees +emitb get Sees i +end +whoemit +for i ulong len Words +emitb get Words i +end +selfemit +for i ulong len Said +emitb get Said i +end +whoemit +if eq w 0 +for i ulong len Chat +emitb get Chat i +end +end +if eq w 1 +for i ulong len Make +emitb get Make i +end +end +if eq w 2 +for i ulong len Explain +emitb get Explain i +end +end +if eq w 3 +for i ulong len Doing +emitb get Doing i +end +selfemit +for i ulong len Cannot +emitb get Cannot i +end +end +emitb 9 +end +for i ulong get Inlen 0 +emitb get In i +end +ret le get Outlen 0 4096 +end diff --git a/native/omega/allen/look-chat.om b/native/omega/allen/look-chat.om new file mode 100644 index 00000000..0b781eef --- /dev/null +++ b/native/omega/allen/look-chat.om @@ -0,0 +1,142 @@ +note SPDX-License-Identifier: MIT +note COURIER lane: Allen's courier to the Spark relay over UDP 47033, the Omega +note build's x86/courier_udp_x86.c. application.om (appinit, appask, apppoll, +note appsent, appreceive) already speaks the courier wire; this module binds its +note datagrams to net.om's netudpsend/Chrx hooks and the typed line to appask. +note Needs base, runtime, code, courier, scheduler, memory, intent, reply, +note context, application (gate.sh core list) and net.om before it in the unit. +note Ch: 0 initialized, 1 last event, 2 datagrams out, 3 datagrams in, +note 4 refused sends, 5 answers taken, 6 run id, 7 dropped-at-receive seen. +note Chevent after chstep: 0 nothing, 1 answer visible in Chsay, 2 asked AGAIN, +note 3 gave up, 4 refused, 5 slow notice, 6 silence (application.om A2). +global Ch ulong 8 +global Chsay uchar 320 +global Chsayn ulong 1 +global Chevent ulong 1 +note Run id like the C kernel: the clock at start mixed with the MAC, never 0. +fn chrun now ulong to ulong +run = now +for i ulong 6 +run = xor run shl ulong get Nmac i mul 8 add i 2 +end +if eq run 0 +run = 1 +end +ret run +end +note Refused (false, nothing touched) while application.om is still active. +fn chinit now ulong run ulong to bool +if eq run 0 +run = chrun now +end +if not appinit run now +ret false +end +for i ulong 8 +put Ch i 0 +end +put Chsayn 0 0 +put Chevent 0 0 +put Chrxn 0 0 +put Chdrop 0 0 +put Ch 0 1 +put Ch 6 run +ret true +end +note The typed request is platform.om's Dprm[0..Dprmn); appask copies and +note validates it (1..159 printable bytes). Dprmn is left for the caller. +fn chask now ulong to bool +if eq get Ch 0 0 +ret false +end +n = get Dprmn 0 +if gt n len Dprm +ret false +end +for i ulong n +put In i get Dprm i +end +put Inlen 0 n +ret appask now +end +fn chbusy to bool +if eq get Ch 0 0 +ret false +end +ret or ne get R 1 0 ne get A 1 0 +end +fn chcancel to void +if eq get Ch 0 0 +ret +end +appcancel +put Chevent 0 0 +end +fn chsay to void +n = get R 8 +if gt n len Chsay +n = len Chsay +end +for i ulong n +put Chsay i get Answer i +end +put Chsayn 0 n +put Ch 5 add get Ch 5 1 +end +fn chevent to void +e = get A 2 +if eq e 0 +ret +end +put Chevent 0 e +put Ch 1 e +if eq e 1 +chsay +end +end +fn chtake now ulong to void +n = get Chrxn 0 +put Chrxn 0 0 +put Ch 3 add get Ch 3 1 +put Ch 7 get Chdrop 0 +for i ulong n +put In i get Chrx i +end +put Inlen 0 n +if appreceive now +chevent +end +end +fn chsend now ulong to void +n = get Outlen 0 +ok = false +if and ne n 0 le n len Chtx +for i ulong n +put Chtx i get Outb i +end +ok = netudpsend n +end +if ok +put Ch 2 add get Ch 2 1 +else +put Ch 4 add get Ch 4 1 +end +ok = appsent now ok +end +note One step of the courier, like the C pump: take the datagram waiting in +note Chrx, then let the scheduler offer HELLO/JOB/GOT and send it. up is the +note firmware's network-up flag (Es 6). Chevent reports this step's event. +fn chstep now ulong up bool to void +put Chevent 0 0 +if eq get Ch 0 0 +ret +end +if ne get Chrxn 0 0 +chtake now +end +off = apppoll now up +chevent +if off +chsend now +end +end diff --git a/native/omega/allen/look-home.om b/native/omega/allen/look-home.om new file mode 100644 index 00000000..48fa6a60 --- /dev/null +++ b/native/omega/allen/look-home.om @@ -0,0 +1,1006 @@ +note look-home.om: Allen's home (allen_ui.c at aienux 4b24df65): the timeline, the merger flash, his words, the bar. +note Frame order (the integrator): ntat t; hmstep t; mdat t; then ntbase/ntlights, hmflash, mddraw, hmtext per band. +note hminit after pkinit, ntinit, mdinit (reads Lg 0..4). Keys: hmkey c (byte, 8 backspace, 13 enter -> Hmline/Hmlinen/Hmask). +note hmthink 1 when the request went out; hmsaid once the answer is in Hmsay/Hmsayn. Not ported: canvas, map, panel, +note code view, guest, notes, choices, dusk/exit, chirp, flow, working. hmdirty: union of what moved, in Hmdirty. +note Hm: 0 on 1 wake_t 2 quiet_t 3 key_t 4 input_moved 5 speak_t 6 thinking 7 word_t 8 bar_a 9 bar_was 10 last +note 11 frames 12 t 13 next_len 14 input_len 15 input_gen 16 seen_input 17 said_gen 18 seen_said 19 has_line 20 think +note 21 said_input_gen 22 hint_len 23 face 24..27 bar 28..31 bar_box 32..35 words_was 36..39 flash_was +note 40..42 s256 per face 43..45 cap 46..48 weight 49 alpha 50 add 51 text source 52..55 band 56 speaking 57 last space +note 58..61 words box. Hmw: 0 len 1 from 2 fade 3 done 4 lines 5..9 line starts 10..14 line lengths 15..19 line x +global Hm long 64 +global Hmin uchar 160 +global Hminn ulong 1 +global Hmline uchar 160 +global Hmlinen ulong 1 +global Hmask ulong 1 +global Hmsay uchar 320 +global Hmsayn ulong 1 +global Hmnow uchar 160 +global Hmnext uchar 160 +global Hmw long 20 +global Hmdirty long 4 +global Hmhint uchar 32 +global Hmfoot uchar 64 +global Hmfootn ulong 1 +global Hmadv long 95 +global Hmgm long 1425 +global Hmgp uchar 1572864 +global Hmgn ulong 1 +fn hmrgb r ulong g ulong b ulong to ulong +ret or or shl r 16 shl g 8 b +end +fn hms v long to long +ret div add mul v get Lg 2 128 256 +end +fn hmmark x long y long w long h long to void +if le w 0 +ret +end +if le h 0 +ret +end +if eq get Hmdirty 2 0 +put Hmdirty 0 x +put Hmdirty 1 y +put Hmdirty 2 w +put Hmdirty 3 h +ret +end +x0 = pkmin x get Hmdirty 0 +y0 = pkmin y get Hmdirty 1 +x1 = pkmax add x w add get Hmdirty 0 get Hmdirty 2 +y1 = pkmax add y h add get Hmdirty 1 get Hmdirty 3 +put Hmdirty 0 x0 +put Hmdirty 1 y0 +put Hmdirty 2 sub x1 x0 +put Hmdirty 3 sub y1 y0 +end +note x y w h meets the band Hm 52..55 (ck_meets) +note marks the rect kept at Hm b..b+3 +fn hmmarkat b ulong to void +hmmark get Hm b get Hm add b 1 get Hm add b 2 get Hm add b 3 +end +fn hmmeets x long y long w long h long to bool +if le w 0 +ret false +end +if ge x add get Hm 52 get Hm 54 +ret false +end +if ge y add get Hm 53 get Hm 55 +ret false +end +if le add x w get Hm 52 +ret false +end +ret gt add y h get Hm 53 +end +note clips x y w h against the band and the screen into Lg 5..8; false when empty +fn hmcut x long y long w long h long to bool +x0 = pkmax pkmax x get Hm 52 0 +y0 = pkmax pkmax y get Hm 53 0 +x1 = pkmin pkmin add x w add get Hm 52 get Hm 54 get Lg 0 +y1 = pkmin pkmin add y h add get Hm 53 get Hm 55 get Lg 1 +pkclip x0 y0 sub x1 x0 sub y1 y0 +if le x1 x0 +ret false +end +ret gt y1 y0 +end +fn hmtoward v long want long dt long full long to long +step = div mul 256 dt full +if eq step 0 +if ne dt 0 +step = 1 +end +end +if lt v want +ret pkmin add v step want +end +ret pkmax sub v step want +end +note ---- letters: font.om masks cached once per face (Hm 23) and glyph ---- +fn hmch i ulong to uchar +s = get Hm 51 +if eq s 0 +ret get Hmhint i +end +if eq s 1 +ret get Hmin i +end +if eq s 2 +ret get Hmnow i +end +ret get Hmfoot i +end +fn hmadv c uchar to ulong +if lt c 32 +c = 63 +end +if gt c 126 +c = 63 +end +g = sub ulong c 32 +if lt get Hmadv g 0 +ok = afpick c +put Afpos 0 add get Afpos 0 1 +put Hmadv g afnum +end +ret mul ulong get Hmadv g ulong get Hm add 40 ulong get Hm 23 +end +fn hmmeas from ulong n ulong to long +w = ulong 0 +for i ulong n +w = add w hmadv hmch add from i +end +ret long div add w 255 256 +end +fn hmglyph c uchar to ulong +if lt c 32 +c = 63 +end +if gt c 126 +c = 63 +end +m = mul add mul ulong get Hm 23 95 sub ulong c 32 5 +if ge get Hmgm add m 4 0 +ret m +end +f = ulong get Hm 23 +ok = afinit ulong get Hm add 43 f ulong get Hm add 46 f +ok = afglyph c +n = mul get Af 3 get Af 4 +put Hmgm m long get Af 3 +put Hmgm add m 1 long get Af 4 +put Hmgm add m 2 get Ab 0 +put Hmgm add m 3 get Ab 1 +put Hmgm add m 4 long get Hmgn 0 +if gt add get Hmgn 0 n len Hmgp +put Hmgm m 0 +ret m +end +for i ulong n +put Hmgp add get Hmgn 0 i get Alpha i +end +put Hmgn 0 add get Hmgn 0 n +ret m +end +note one glyph row: n mask bytes from off onto Nfrm from at; color Hm 63, alpha Hm 49, add Hm 50 +fn hmrow at ulong off ulong n ulong to void +for i ulong n +cov = ulong get Hmgp add off i +if ne cov 0 +cov = add cov shr cov 7 +cov = shr mul cov ulong get Hm 49 8 +if eq get Hm 50 0 +cov = pkmix ulong get Nfrm at ulong get Hm 63 cov +else +cov = pkadd ulong get Nfrm at ulong get Hm 63 cov +end +put Nfrm at uint cov +end +at = add at 1 +end +end +note draws cached glyph m with its top-left at gx gy, clipped to Lg 5..8 (color Hm 63) +fn hmglyphat m ulong gx long gy long to void +x0 = pkmax gx get Lg 5 +y0 = pkmax gy get Lg 6 +x1 = add gx get Hmgm m +x1 = pkmin x1 add get Lg 5 get Lg 7 +y1 = add gy get Hmgm add m 1 +y1 = pkmin y1 add get Lg 6 get Lg 8 +if ge x0 x1 +ret +end +gx = sub x0 gx +x1 = sub x1 x0 +gy = sub y0 gy +while lt y0 y1 +o = mul ulong gy ulong get Hmgm m +o = add o ulong gx +o = add o ulong get Hmgm add m 4 +at = mul ulong y0 ulong get Lg 0 +at = add at ulong x0 +hmrow at o ulong x1 +y0 = add y0 1 +gy = add gy 1 +end +end +fn hmblit pen ulong y long c uchar color ulong to ulong +if eq get Hm 49 0 +ret add pen hmadv c +end +m = hmglyph c +if eq get Hmgm m 0 +ret add pen hmadv c +end +put Hm 63 long color +gx = add long div add pen 128 256 get Hmgm add m 2 +gy = add y get Hmgm add m 3 +hmglyphat m gx gy +ret add pen hmadv c +end +note text() of the C: source Hm 51, face Hm 23, alpha Hm 49, clip Lg 5..8; returns the pen end in pixels +fn hmwrite from ulong n ulong x long y long color ulong to long +pen = mul ulong x 256 +for i ulong n +pen = hmblit pen y hmch add from i color +end +ret long div add pen 255 256 +end +note ---- init ---- +fn hminit to void +for i ulong 64 +put Hm i 0 +end +for i ulong 1425 +put Hmgm i 0 +end +for i ulong 285 +put Hmgm add mul i 5 4 neg 1 +end +for i ulong 95 +put Hmadv i neg 1 +end +put Hmgn 0 0 +for i ulong 20 +put Hmw i 0 +end +put Hminn 0 0 +put Hmlinen 0 0 +put Hmask 0 0 +put Hmsayn 0 0 +put Hmfootn 0 0 +note caps: CAP_VOICE/BODY/SMALL * k / 256 (truncating, not S()) +put Hm 43 div mul 19 get Lg 2 256 +put Hm 44 div mul 15 get Lg 2 256 +put Hm 45 div mul 11 get Lg 2 256 +put Hm 46 1000 +put Hm 47 1150 +put Hm 48 1250 +for i ulong 3 +put Hm add 40 i div mul get Hm add 43 i 256 20 +end +put Hmhint 0 83 +put Hmhint 1 112 +put Hmhint 2 101 +put Hmhint 3 97 +put Hmhint 4 107 +put Hmhint 5 32 +put Hmhint 6 116 +put Hmhint 7 111 +put Hmhint 8 32 +put Hmhint 9 65 +put Hmhint 10 108 +put Hmhint 11 108 +put Hmhint 12 101 +put Hmhint 13 110 +put Hm 22 14 +bw = hms 720 +bh = hms 54 +put Hm 24 div sub get Lg 0 bw 2 +put Hm 25 sub get Lg 1 hms 150 +put Hm 26 bw +put Hm 27 bh +put Hm 28 pkmin sub get Hm 24 hms 20 sub div get Lg 0 2 hms 360 +put Hm 29 sub get Hm 25 hms 20 +put Hm 30 pkmax add bw hms 40 hms 720 +put Hm 31 add bh hms 80 +note woken at once (ck_allen_ui_wake before the first frame); quiet_t is set by the first frame (hmstep) +put Hm 0 1 +put Hmdirty 2 0 +end +note ---- the keyboard side ---- +fn hmkey key ulong to void +if eq key 13 +if gt get Hminn 0 0 +for i ulong get Hminn 0 +put Hmline i get Hmin i +end +put Hmlinen 0 get Hminn 0 +put Hmask 0 1 +put Hminn 0 0 +put Hm 15 add get Hm 15 1 +end +ret +end +if eq key 8 +if gt get Hminn 0 0 +put Hminn 0 sub get Hminn 0 1 +put Hm 15 add get Hm 15 1 +end +ret +end +if lt key 32 +ret +end +if gt key 126 +ret +end +if lt get Hminn 0 159 +put Hmin get Hminn 0 uchar key +put Hminn 0 add get Hminn 0 1 +put Hm 15 add get Hm 15 1 +end +end +fn hmthink on long to void +if eq on 0 +ret +end +put Hm 19 1 +put Hm 20 1 +put Hm 21 get Hm 15 +put Hm 17 add get Hm 17 1 +end +fn hmsaid to void +put Hm 19 0 +if eq get Hmask 0 1 +put Hm 19 1 +put Hmask 0 0 +end +put Hm 20 0 +put Hm 21 get Hm 15 +put Hm 17 add get Hm 17 1 +end +note ---- the frame ---- +fn hmnotes t long to void +if ne get Hm 15 get Hm 16 +put Hm 16 get Hm 15 +if gt get Hminn 0 ulong get Hm 14 +mdkey t +end +put Hm 14 long get Hminn 0 +put Hm 3 t +put Hm 2 t +put Hm 4 1 +end +if eq get Hm 17 get Hm 18 +ret +end +put Hm 18 get Hm 17 +if ne get Hmw 0 0 +if eq get Hmw 2 0 +put Hmw 2 t +end +end +put Hm 13 0 +if ne get Hm 20 0 +put Hm 5 0 +put Hm 6 1 +else +n = pkmin long get Hmsayn 0 159 +for i ulong ulong n +put Hmnext i get Hmsay i +end +put Hm 13 n +think = long 500 +if ne get Hm 6 0 +think = 400 +else +if ne get Hm 19 0 +think = add 900 pkmin mul n 6 700 +end +end +put Hm 5 pkmax add t think 15600 +put Hm 6 0 +end +put Hm 14 0 +if ne get Hm 15 get Hm 21 +put Hm 14 long get Hminn 0 +end +put Hm 4 1 +put Hm 2 t +mdmode 2 t +end +note the flash radius (16ths) and alpha at t (0: none) +fn hmfrad t long to long +tm = sub t 12000 +ret mul add hms 40 shr mul hms 220 long pkeaseout pkprog ulong tm 0 1200 8 16 +end +fn hmfa t long to long +if lt t 12000 +ret 0 +end +if ge t 13600 +ret 0 +end +tm = sub t 12000 +rise = long pksmooth pkprog ulong tm 0 120 +e = long 0 +if gt tm 120 +e = div mul sub tm 120 256 450 +end +ret shr mul mul rise shr long pkexpneg ulong e 8 230 16 +end +note one wrapped line of Hmnow from start: returns its end (face Hm 23 = 0) +fn hmwline from0 long n long to long +j = from0 +w = long 0 +go = true +put Hm 57 0 +while go +if lt j n +aw = long div add hmadv get Hmnow j 255 256 +take = true +if gt add w aw hms 900 +if gt j from0 +take = false +end +end +if take +if eq get Hmnow j 32 +put Hm 57 j +end +w = add w aw +j = add j 1 +else +go = false +end +else +go = false +end +end +if lt j n +if gt get Hm 57 from0 +j = get Hm 57 +end +end +ret j +end +fn hmwrap to void +n = get Hmw 0 +lines = long 0 +i = long 0 +put Hm 23 0 +put Hm 51 2 +while lt i n +if ge lines 5 +i = n +else +while lt i n +if eq get Hmnow i 32 +i = add i 1 +else +n = i +end +end +n = get Hmw 0 +j = hmwline i n +put Hmw add 5 lines i +put Hmw add 10 lines sub j i +lines = add lines 1 +i = j +end +end +put Hmw 4 lines +end +note one line's x (centred), updating the box edges Hm 58 (min x) and Hm 62 (max x1) +fn hmlinex li ulong to void +lw = hmmeas ulong get Hmw add 5 li ulong get Hmw add 10 li +x = div sub get Lg 0 lw 2 +put Hmw add 15 li x +put Hm 58 pkmin get Hm 58 x +put Hm 62 pkmax get Hm 62 add x lw +end +fn hmlayout to void +hmwrap +put Hm 58 get Lg 0 +put Hm 62 0 +for li ulong ulong get Hmw 4 +hmlinex li +end +x0 = get Hm 58 +x1 = get Hm 62 +lines = get Hmw 4 +if eq lines 0 +put Hm 58 0 +put Hm 59 0 +put Hm 60 0 +put Hm 61 0 +put Hmw 3 add get Hmw 1 700 +ret +end +put Hm 58 sub x0 hms 8 +put Hm 59 sub add get Lg 4 hms 250 hms 34 +put Hm 60 add sub x1 x0 hms 16 +put Hm 61 add mul lines hms 40 hms 30 +last = add get Hmw add 4 lines get Hmw add 9 lines +put Hmw 3 add add get Hmw 1 mul last 35 700 +end +fn hmwalpha t long to long +if eq get Hmw 0 0 +ret 0 +end +out = get Hmw 2 +if eq out 0 +out = add add get Hmw 3 6000 mul get Hmw 0 70 +end +ret sub 256 long pksmooth pkprog ulong t ulong out ulong add out 450 +end +fn hmspeak t long to void +if eq get Hm 5 0 +ret +end +if lt t get Hm 5 +ret +end +for i ulong ulong get Hm 13 +put Hmnow i get Hmnext i +end +put Hmw 0 get Hm 13 +put Hmw 1 get Hm 5 +put Hmw 2 0 +hmlayout +put Hm 5 0 +mdmode 3 t +end +fn hmpulse t long prev long to void +n = get Hmw 0 +if eq n 0 +ret +end +if lt t get Hmw 1 +ret +end +if ge prev get Hmw 3 +ret +end +for i ulong ulong n +at = add get Hmw 1 mul long i 35 +if gt at prev +if le at t +if ne get Hmnow i 32 +first = eq i 0 +if not first +first = eq get Hmnow sub i 1 32 +end +if first +mdword t +put Hm 7 t +end +end +end +end +end +end +note the mind's mode from the words' state (speaking in Hm 56) +fn hmwmode t long to void +n = get Hmw 0 +mode = get Mdv 9 +if eq get Hm 56 0 +if eq get Hm 5 0 +if ne n 0 +if ge t get Hmw 1 +if or eq mode 3 eq mode 2 +mdmode 0 t +put Hm 2 t +mode = 0 +end +end +end +end +end +if ne mode 2 +if ne mode 3 +lis = long 0 +if ne get Hm 14 0 +if lt sub t get Hm 3 4000 +lis = 1 +end +end +mdmode lis t +end +end +end +note marks the words box when it changes, remembers it in Hm 32..35, forgets faded words +fn hmwbox t long prev long to void +n = get Hmw 0 +if ne n 0 +if lt t add get Hmw 3 40 +hmmarkat 58 +else +if ne hmwalpha t hmwalpha prev +hmmarkat 58 +end +end +end +if ne get Hm 34 0 +moved = ne get Hm 32 get Hm 58 +if ne get Hm 34 get Hm 60 +moved = true +end +if ne get Hm 35 get Hm 61 +moved = true +end +if moved +hmmarkat 32 +end +end +for i ulong 4 +put Hm add 32 i get Hm add 58 i +end +if ne n 0 +if eq hmwalpha t 0 +if gt t get Hmw 1 +for i ulong 20 +put Hmw i 0 +end +for i ulong 4 +put Hm add 58 i 0 +end +end +end +end +end +fn hmwords t long prev long to void +hmspeak t +hmpulse t prev +n = get Hmw 0 +speaking = false +if ne n 0 +if ge t get Hmw 1 +speaking = lt t add add get Hmw 1 mul n 35 300 +end +end +put Hm 56 0 +if speaking +put Hm 56 1 +mdvoice shr long pkexpneg ulong div mul sub t get Hm 7 256 200 8 +else +mdvoice 0 +end +hmwmode t +hmwbox t prev +end +fn hmbarstep t long dt long to void +want = false +if ne get Hm 0 0 +if ge t 15300 +want = ne get Hm 14 0 +if lt sub t get Hm 2 9000 +want = true +end +if ne get Hm 56 0 +want = true +end +if ne get Hm 5 0 +want = true +end +end +end +full = long 1400 +goal = long 0 +if want +goal = 256 +full = 900 +if lt sub t get Hm 3 300 +full = 250 +end +end +put Hm 8 hmtoward get Hm 8 goal dt full +mark = ne get Hm 8 0 +if ne get Hm 9 0 +mark = true +end +if ne get Hm 4 0 +mark = true +end +if mark +hmmarkat 28 +end +put Hm 9 get Hm 8 +put Hm 4 0 +end +fn hmstep t long to void +if ne get Hm 11 0 +if lt sub t get Hm 10 16 +ret +end +else +note the first frame takes the setup panel (seen_panel = panel_gen - 1 in start): quiet_t = t, after the wake's FORMED_MS +put Hm 2 t +end +put Hm 11 1 +put Hm 12 t +prev = get Hm 10 +dt = sub t prev +hmnotes t +if gt dt 100 +dt = 100 +end +put Hmdirty 2 0 +hmmarkat 36 +put Hm 38 0 +if ne hmfa t 0 +r = add shr hmfrad t 4 2 +put Hm 36 sub get Lg 3 r +put Hm 37 sub get Lg 4 r +put Hm 38 add mul 2 r 1 +put Hm 39 add mul 2 r 1 +hmmarkat 36 +end +hmwords t prev +hmbarstep t dt +put Hm 10 t +end +note ---- drawing: hmflash before the mind, hmtext after it, both inside band x y w h ---- +note one pixel of the shadow taking its black back (unflash in the C): hole 0, keep 0..256 +fn hmunpx x long y long keep long to void +dx = sub add mul x 16 8 get Nthole 0 +dy = sub add mul y 16 8 get Nthole 1 +dx = long pkisqrt ulong add mul dx dx mul dy dy +dy = sub get Nthole 3 dx +if le dy 0 +ret +end +if ge dy 16 +dy = 256 +else +dy = mul dy 16 +end +dy = sub 256 shr mul dy sub 256 keep 8 +at = add mul ulong y ulong get Lg 0 ulong x +put Nfrm at uint pkscale ulong get Nfrm at ulong dy +end +fn hmunrow y long keep long to void +for i ulong ulong get Lg 7 +hmunpx add get Lg 5 long i y keep +end +end +note clips hole 0's box; false when nothing to do +fn hmunbox to bool +rs = get Nthole 3 +if le rs 16 +ret false +end +bx = shr sub get Nthole 0 rs 4 +by = shr sub get Nthole 1 rs 4 +bw = add shr mul 2 rs 4 2 +ret hmcut bx by bw bw +end +fn hmunflash t long to void +tm = sub t 12000 +if ne get Nthol 0 1 +ret +end +if lt tm 100 +ret +end +keep = sub 256 long pksmooth pkprog ulong tm 100 400 +if not hmunbox +ret +end +for j ulong ulong get Lg 8 +hmunrow add get Lg 6 long j keep +end +end +fn hmflash x long y long w long h long to void +put Hm 52 x +put Hm 53 y +put Hm 54 w +put Hm 55 h +t = get Hm 12 +a = hmfa t +if eq a 0 +ret +end +if not hmcut x y w h +ret +end +rad = hmfrad t +cx = add mul get Lg 3 16 8 +cy = add mul get Lg 4 16 8 +pkglow cx cy rad hmrgb 200 210 255 ulong div a 3 +pkglow cx cy div rad 3 hmrgb 255 240 224 ulong a +hmunflash t +end +note one of Allen's letters (Hmnow i) age ms after its moment: alpha, colour and rise as draw_words in the C +fn hmwletter pen ulong y long i long age long all long to ulong +put Hm 49 shr mul long pksmooth pkprog ulong age 0 260 all 8 +c = pkmix hmrgb 255 212 150 hmrgb 234 238 252 pksmooth pkprog ulong age 0 900 +rise = shr mul hms 6 sub 256 long pkeaseout pkprog ulong age 0 360 8 +ret hmblit pen add y rise get Hmnow ulong i c +end +fn hmwline2 li ulong t long all long to void +pen = mul ulong get Hmw add 15 li 256 +y = add add get Lg 4 hms 250 mul long li hms 40 +j = get Hmw add 5 li +e = add j get Hmw add 10 li +while lt j e +at = add get Hmw 1 mul j 35 +if le t at +j = e +else +pen = hmwletter pen y j sub t at all +j = add j 1 +end +end +end +fn hmwdraw t long to void +all = hmwalpha t +if eq all 0 +ret +end +if not hmmeets get Hm 58 get Hm 59 get Hm 60 get Hm 61 +ret +end +if not hmcut get Hm 52 get Hm 53 get Hm 54 get Hm 55 +ret +end +put Hm 23 0 +put Hm 51 2 +put Hm 50 0 +for li ulong ulong get Hmw 4 +hmwline2 li t all +end +end +note the bar's rim and, while typing, the soft blue glow round it (draw_bar in the C) +fn hmbaredge px ulong sd long a ulong to ulong +edge = pkabs add sd 8 +if lt edge 16 +e = ulong mul sub 16 edge 3 +if ne get Hm 14 0 +e = ulong mul sub 16 edge 4 +end +px = pkadd px hmrgb 255 255 255 shr mul e a 8 +end +if ne get Hm 14 0 +if gt sd 0 +if lt sd mul hms 14 16 +g = ulong sub 256 div mul sd 256 mul hms 14 16 +g = shr mul g g 8 +g = shr mul g 34 8 +px = pkadd px hmrgb 110 130 255 shr mul g a 8 +end +end +end +ret px +end +fn hmbarpx x long y long sd long to void +a = ulong get Hm 8 +at = add mul ulong y ulong get Lg 0 ulong x +px = ulong get Nfrm at +in = pkcover sd +if ne in 0 +px = pkmix px hmrgb 6 8 18 shr mul shr mul in 150 8 a 8 +end +put Nfrm at uint hmbaredge px sd a +end +fn hmbarsd x long y long to long +ret pksdrrect x y get Hm 24 get Hm 25 get Hm 26 get Hm 27 +end +fn hmbarrow y long to void +for i ulong ulong get Lg 7 +x = add get Lg 5 long i +hmbarpx x y hmbarsd x y +end +end +fn hmbarbody to void +g = hms 14 +x = sub get Hm 24 g +y = sub get Hm 25 g +w = add get Hm 26 mul 2 g +h = add get Hm 27 mul 2 g +if not hmcut x y w h +ret +end +put Lg 9 div get Hm 27 2 +for j ulong ulong get Lg 8 +hmbarrow add get Lg 6 long j +end +end +note the caret's light at t: it breathes (ck_sin over 1100 ms) rather than blinks +fn hmcaretlvl t long to long +d = and mul and sub t get Hm 3 4294967295 65536 4294967295 +ca = shr mul add 16384 pksin ulong add div d 1100 16384 200 15 +if lt sub t get Hm 3 500 +ca = 200 +end +ret shr mul add 40 ca get Hm 8 8 +end +fn hmcaretrow y long a long to void +at = add mul ulong y ulong get Lg 0 ulong get Lg 5 +for i ulong ulong get Lg 7 +put Nfrm at uint pkadd ulong get Nfrm at hmrgb 150 170 255 ulong a +at = add at 1 +end +end +fn hmcaret x long t long to void +a = hmcaretlvl t +cy = sub add get Hm 25 div get Hm 27 2 hms 12 +if not hmcut add x hms 3 cy pkmax hms 2 2 hms 24 +ret +end +for j ulong ulong get Lg 8 +hmcaretrow add get Lg 6 long j a +end +end +note the first typed letter that fits in avail px (the line scrolls from the left) +fn hmbarfrom avail long to long +n = get Hm 14 +from = long 0 +while lt from n +if gt hmmeas ulong from ulong sub n from avail +from = add from 1 +else +n = from +end +end +ret from +end +note the typed line in the bar: returns the pen end in px (Hm 51 = 1, face Hm 23 = 1) +fn hmbartyped x long base long tcw bool to long +put Hm 51 1 +avail = sub sub get Hm 26 mul 2 hms 30 hms 12 +from = hmbarfrom avail +n = sub get Hm 14 from +if tcw +put Hm 49 get Hm 8 +ret hmwrite ulong from ulong n x base hmrgb 236 240 252 +end +ret add x hmmeas ulong from ulong n +end +fn hmbarline t long to void +pad = hms 30 +base = add add get Hm 25 div get Hm 27 2 hms 7 +x = add get Hm 24 pad +pad = sub get Hm 26 mul 2 pad +tcw = hmcut x get Hm 25 pad get Hm 27 +put Hm 23 1 +put Hm 50 0 +if eq get Hm 14 0 +if tcw +put Hm 51 0 +put Hm 49 shr mul 192 get Hm 8 8 +dd = hmwrite 0 ulong get Hm 22 x base hmrgb 150 160 196 +end +else +x = hmbartyped x base tcw +end +hmcaret x t +end +fn hmfooter to void +if eq get Hmfootn 0 0 +ret +end +if ne get Hm 14 0 +ret +end +if not hmcut get Hm 52 get Hm 53 get Hm 54 get Hm 55 +ret +end +put Hm 23 2 +put Hm 51 3 +put Hm 50 0 +put Hm 49 shr mul 222 get Hm 8 8 +n = get Hmfootn 0 +fw = hmmeas 0 n +fw = div sub get Lg 0 fw 2 +fy = add add get Hm 25 get Hm 27 hms 34 +dd = hmwrite 0 n fw fy hmrgb 130 140 176 +end +fn hmbar t long to void +if eq get Hm 8 0 +ret +end +if not hmmeets get Hm 28 get Hm 29 get Hm 30 get Hm 31 +ret +end +hmbarbody +hmbarline t +hmfooter +end +fn hmtext x long y long w long h long to void +put Hm 52 x +put Hm 53 y +put Hm 54 w +put Hm 55 h +hmwdraw get Hm 12 +hmbar get Hm 12 +end +fn hmdraw x long y long w long h long to void +hmflash x y w h +hmtext x y w h +end diff --git a/native/omega/allen/look-install.om b/native/omega/allen/look-install.om new file mode 100644 index 00000000..717da193 --- /dev/null +++ b/native/omega/allen/look-install.om @@ -0,0 +1,158 @@ +note SPDX-License-Identifier: MIT +note Install: the typed line `install allen on this computer` copies the running firmware image +note from the stick's volume to the one other volume that already holds \EFI\BOOT\BOOTX64.EFI +note (the internal EFI System Partition the C kernel made), through the compiler's file word +note (efi 11: sub 0 counts volumes and finds the boot one, 1 reads that file, 2 writes it). +note Nothing happens at boot; only the typed line installs. Needs look-home.om (Hmsay, hmsaid) +note and base.om (In, Inlen) before it in the unit; look-show.om calls inmatch and ininstall. +note Ins: 0 last attempt (ms), 1 bytes written, 2 failing step (0 none), 3 status low 16 bits. +global Inimg uchar 4194304 +global Ins ulong 4 +text Incmd "install allen on this computer" +text Inok "Installed on this computer: " +text Inok2 " bytes. Shut down, take the stick out, start me again." +text Inno "Not installed: " +text Inno2 " status " +text Insteps "count|boot volume|no other volume holds Allen|more than one volume holds Allen|read|write|size" +fn inmatch to bool +note The typed line, letters in either case, equals the command. +n = get Inlen 0 +if ne n len Incmd +ret false +end +for i ulong n +c = get In i +if and ge c 65 le c 90 +c = add c 32 +end +if ne c get Incmd i +ret false +end +end +ret true +end +fn inchar at ulong c uchar to ulong +if lt at len Hmsay +put Hmsay at c +end +ret add at 1 +end +fn innum at ulong v ulong to ulong +note Decimal digits of v at position at; returns the position after them. +d = ulong 1 +t = v +while ge t 10 +t = div t 10 +d = add d 1 +end +e = add at d +p = e +for i ulong d +p = sub p 1 +q = inchar p uchar add 48 rem v 10 +v = div v 10 +end +ret e +end +fn instep at ulong k ulong to ulong +note Field k of Insteps (fields separated by |) at position at. +f = ulong 0 +for i ulong len Insteps +c = get Insteps i +if eq c 124 +f = add f 1 +else +if eq f k +at = inchar at c +end +end +end +ret at +end +fn infail step ulong st ulong to void +put Ins 2 add step 1 +put Ins 3 and st 65535 +at = ulong 0 +for i ulong len Inno +at = inchar at get Inno i +end +at = instep at step +for i ulong len Inno2 +at = inchar at get Inno2 i +end +at = innum at and st 65535 +at = inchar at 46 +put Hmsayn 0 at +hmsaid +end +fn insaid bytes ulong to void +put Ins 1 bytes +put Ins 2 0 +put Ins 3 0 +at = ulong 0 +for i ulong len Inok +at = inchar at get Inok i +end +at = innum at bytes +for i ulong len Inok2 +at = inchar at get Inok2 i +end +put Hmsayn 0 at +hmsaid +end +fn inholds k ulong to bool +note True when volume k holds \EFI\BOOT\BOOTX64.EFI: a read succeeds, or fails only +note because the file is larger than Inimg (file word code 24). +rd = efi 11 or 1 shl k 8 Inimg 0 len Inimg +if eq shr rd 63 0 +ret true +end +ret eq and rd 255 24 +end +fn ininstall now ulong to void +put Ins 0 now +r = efi 11 0 Inimg 0 0 +if eq shr r 63 1 +infail 0 r +ret +end +n = and r 255 +boot = and shr r 8 255 +if eq boot 255 +infail 1 n +ret +end +found = ulong 0 +tgt = ulong 0 +for k ulong n +if ne k boot +if inholds k +found = add found 1 +tgt = k +end +end +end +if eq found 0 +infail 2 n +ret +end +if gt found 1 +infail 3 found +ret +end +rd = efi 11 or 1 shl boot 8 Inimg 0 len Inimg +if eq shr rd 63 1 +infail 4 rd +ret +end +wr = efi 11 or 2 shl tgt 8 Inimg 0 rd +if eq shr wr 63 1 +infail 5 wr +ret +end +if ne wr rd +infail 6 wr +ret +end +insaid wr +end diff --git a/native/omega/allen/look-mind.om b/native/omega/allen/look-mind.om new file mode 100644 index 00000000..e17e7ee5 --- /dev/null +++ b/native/omega/allen/look-mind.om @@ -0,0 +1,1088 @@ +note SPDX-License-Identifier: MIT +note Allen's look, part 4: Allen's presence, the mind of light. Handwritten Omega port of +note native/kernel/ui/mind.h and mind.c (aienux 4b24df65), integer for integer: about a hundred +note sharp points on and inside a sphere joined by fine threads, turning round a compact heart, +note with sparks running along the threads. mdat moves it to a time; mddraw only reads. +note Needs look-paint.om (pkmin pkmax pkabs pkclamp pksin pkcos pkisqrt pkhash pkexpneg pkprog +note pkeaseout pksmooth pkcover pkmix, Lg, Nfrm). The mind's own thread and point mix coverage +note (never add light), so they are private here (mdthread, mdpoint), as in mind.c. +note Statements are short on purpose: every literal and operator of a statement holds one of the +note function's 16 value slots until the statement ends. +note Mdv state slots: 0 cx 1 cy 2 R (px) 3 k 4 ne 5 born 6 t 7 rng (32-bit xorshift) 8 spawn +note 9 mode (0 idle 1 listen 2 think 3 speak) 10 angle (32-bit wrap, 1/256 of a 65536th) +note 11 spin 12 squeeze 13 heart 14 voice 15 nspark 16 alpha 17 hx 18 hy 19 hr (16ths) +note 20 form (0..256 this frame) 21 ca 22 sa 23 ct 24 st 25 scale 26 R16 27 x0 28 x1 29 y0 30 y1 +note (the frame's bounding box in 16ths) 31 ta (thread alpha this draw). +note Mdhome: home[i][c] at 3*i+c (unit sphere, Q14). Mdea/Mdeb: the edges. Mdact: how lit each +note point is. Sparks as parallel arrays Mdse (edge) Mdsdur (ms) Mdsback (runs eb to ea) Mdst0. +note Mdpx Mdpy (16ths) Mdlum Mdnear: the frame for mddraw. Mdwords/Mdkeys: when the last four +note pulses began (ms, 0 none). Mdnow/Mdwas: the box now and the frame before; mddirty writes +note their union to Mdbox. Mdclip: the draw rect. Mdp: draw scratch. Mdtab: the mode tables +note (0..3 spins, 4..7 squeezes, 8..11 hearts, 12..15 spark rates, by mode). +global Mdv long 32 +global Mdhome long 360 +global Mdea long 300 +global Mdeb long 300 +global Mdact long 120 +global Mdse long 64 +global Mdsdur long 64 +global Mdsback long 64 +global Mdst0 long 64 +global Mdpx long 120 +global Mdpy long 120 +global Mdlum long 120 +global Mdnear long 120 +global Mdwords long 4 +global Mdkeys long 4 +global Mdnow long 4 +global Mdwas long 4 +global Mdbox long 4 +global Mdclip long 4 +global Mdp long 16 +global Mdtab long 16 +fn mdrnd to long +r = get Mdv 7 +s = shl r 13 +s = and s 4294967295 +r = xor r s +s = shr r 17 +r = xor r s +s = shl r 5 +s = and s 4294967295 +r = xor r s +put Mdv 7 r +ret r +end +fn mdhome i long c long to long +j = mul i 3 +j = add j c +ret get Mdhome j +end +fn mddist2 i long j long to long +dx = sub mdhome i 0 mdhome j 0 +dy = sub mdhome i 1 mdhome j 1 +dz = sub mdhome i 2 mdhome j 2 +dx = mul dx dx +dy = mul dy dy +dz = mul dz dz +ret add add dx dy dz +end +fn mdhasedge a long b long to bool +nedge = get Mdv 4 +for i ulong ulong nedge +ea = get Mdea i +eb = get Mdeb i +if eq ea a +if eq eb b +ret true +end +end +if eq ea b +if eq eb a +ret true +end +end +end +ret false +end +fn mdput i long c long v long to void +j = mul i 3 +j = add j c +put Mdhome j v +end +note one home point: the first 96 on a Fibonacci lattice over the sphere, the last 24 inside +fn mdnode i long to void +y = long 0 +th = ulong 0 +ln = long 0 +if lt i 96 +y = mul 2 i +y = add y 1 +y = mul y 16384 +y = div y 96 +y = sub 16384 y +th = mul ulong i 25033 +ln = long rem pkhash i 1 31 5900 +ln = add ln 13434 +else +h1 = pkhash i 2 31 +th = pkhash i 3 31 +y = long rem h1 32768 +y = sub 16384 y +ln = long rem pkhash i 4 31 5734 +ln = add ln 4915 +end +rr = mul y y +rr = sub 268435456 rr +rr = long pkisqrt ulong rr +x = mul rr pkcos th +x = shr x 14 +z = mul rr pksin th +z = shr z 14 +x = mul x ln +mdput i 0 shr x 14 +y = mul y ln +mdput i 1 shr y 14 +z = mul z ln +mdput i 2 shr z 14 +end +note the nearest point to i not yet joined to it, or -1 +fn mdnearest i long to long +best = long -1 +bd = long 0 +for j ulong 120 +jj = long j +if ne jj i +if not mdhasedge i jj +d = mddist2 i jj +if lt best 0 +best = jj +bd = d +else +if lt d bd +best = jj +bd = d +end +end +end +end +end +ret best +end +fn mdedges to void +for i ulong 120 +ii = long i +want = long 3 +if lt ii 96 +want = 2 +end +for w ulong ulong want +best = mdnearest ii +if ge best 0 +nedge = get Mdv 4 +if lt nedge 300 +put Mdea nedge ii +put Mdeb nedge best +put Mdv 4 add nedge 1 +end +end +end +end +end +fn mdtables to void +put Mdtab 0 349 +put Mdtab 1 520 +put Mdtab 2 1400 +put Mdtab 3 600 +put Mdtab 4 0 +put Mdtab 5 4 +put Mdtab 6 16 +put Mdtab 7 0 +put Mdtab 8 50 +put Mdtab 9 70 +put Mdtab 10 120 +put Mdtab 11 80 +put Mdtab 12 2 +put Mdtab 13 6 +put Mdtab 14 25 +put Mdtab 15 12 +end +note (cx, cy) its centre and k the scale from Lg; born the time it starts to gather (ms) +fn mdinit born long to void +for i ulong 32 +put Mdv i 0 +end +for i ulong 120 +put Mdact i 0 +end +for i ulong 4 +put Mdwords i 0 +put Mdkeys i 0 +put Mdnow i 0 +put Mdwas i 0 +put Mdbox i 0 +end +k = get Lg 2 +put Mdv 0 get Lg 3 +put Mdv 1 get Lg 4 +r = mul 118 k +r = add r 128 +put Mdv 2 div r 256 +put Mdv 3 k +put Mdv 5 born +put Mdv 7 2654435769 +put Mdv 11 349 +mdtables +for i ulong 120 +mdnode long i +end +mdedges +end +fn mdmode m long t long to void +put Mdv 9 m +end +fn mdword t long to void +put Mdwords 3 get Mdwords 2 +put Mdwords 2 get Mdwords 1 +put Mdwords 1 get Mdwords 0 +if eq t 0 +put Mdwords 0 1 +else +put Mdwords 0 t +end +end +fn mdkey t long to void +put Mdkeys 3 get Mdkeys 2 +put Mdkeys 2 get Mdkeys 1 +put Mdkeys 1 get Mdkeys 0 +if eq t 0 +put Mdkeys 0 1 +else +put Mdkeys 0 t +end +end +fn mdvoice lvl long to void +if gt lvl 256 +lvl = 256 +end +put Mdv 14 lvl +end +note the thread leaving from that the spark takes: e or the next one round that touches from +fn mdsedge e long from long to long +nedge = get Mdv 4 +tries = long 0 +note at most ne + 1 passes: tries reaches ne or an edge of from is found +while true bound 400 +if eq get Mdea e from +break +end +if eq get Mdeb e from +break +end +if ge tries nedge +break +end +tries = add tries 1 +e = add e 1 +e = rem e nedge +end +ret e +end +note a spark on a thread leaving from, or on any thread when from is out of range +fn mdspark from long to void +ns = get Mdv 15 +nedge = get Mdv 4 +if ge ns 64 +ret +end +if eq nedge 0 +ret +end +e = rem mdrnd nedge +back = long 0 +if lt from 120 +e = mdsedge e from +if eq get Mdeb e from +back = 1 +end +else +back = and mdrnd 1 +end +put Mdse ns e +put Mdsback ns back +put Mdst0 ns get Mdv 6 +if eq get Mdv 9 2 +e = rem mdrnd 260 +put Mdsdur ns add e 240 +else +e = rem mdrnd 480 +put Mdsdur ns add e 420 +end +put Mdv 15 add ns 1 +end +fn mdtoward cur long want long dt long ms long to long +d = sub want cur +step = pkmin dt ms +step = mul d step +step = div step ms +if eq step 0 +if ne d 0 +if ne dt 0 +step = 1 +if lt d 0 +step = -1 +end +end +end +end +ret add cur step +end +note (1 - (off/width)^2)^2, 0..256 +fn mdpulse off long width long to long +if le off neg width +ret 0 +end +if ge off width +ret 0 +end +q = mul off off +q = mul q 256 +w2 = mul width width +q = div q w2 +q = sub 256 q +q = mul q q +ret shr q 8 +end +note ulong (t * 65536 as uint32) / period +fn mdphase t long period long to ulong +p = mul t 65536 +p = and p 4294967295 +ret ulong div p period +end +note spin, squeeze and heart eased toward the mode's +fn mdease md long dt long t long to void +put Mdv 11 mdtoward get Mdv 11 get Mdtab md dt 700 +w = add md 4 +put Mdv 12 mdtoward get Mdv 12 get Mdtab w dt 500 +w = add md 8 +wh = get Mdtab w +ms = long 400 +if eq md 3 +w = mul get Mdv 14 120 +w = div w 256 +wh = add wh w +ms = 80 +end +if eq md 2 +w = pksin mdphase t 900 +w = add w 16384 +w = mul w 30 +w = shr w 15 +wh = add wh w +end +put Mdv 13 mdtoward get Mdv 13 wh dt ms +end +note copy spark slot a over slot b +fn mdscopy a long b long to void +put Mdse b get Mdse a +put Mdsdur b get Mdsdur a +put Mdsback b get Mdsback a +put Mdst0 b get Mdst0 a +end +note spark i arrives: its point lights, and the spark may go on +fn mdarrived md long i long to void +e = get Mdse i +dest = get Mdeb e +if ne get Mdsback i 0 +dest = get Mdea e +end +put Mdact dest 256 +ns = sub get Mdv 15 1 +put Mdv 15 ns +mdscopy ns i +r = rem mdrnd 100 +go = false +if eq md 2 +if lt r 70 +go = true +end +else +if lt r 18 +go = true +end +end +if go +mdspark dest +end +end +fn mdarrive md long t long to void +i = long 0 +note each pass moves i on or removes one of the at most 64 sparks that were there +while lt i get Mdv 15 bound 200 +age = sub t get Mdst0 i +if lt age get Mdsdur i +i = add i 1 +else +mdarrived md i +end +end +end +fn mddecay dt long to void +f = mul dt 256 +f = div f 260 +f = long pkexpneg ulong f +for i ulong 120 +a = mul get Mdact i f +put Mdact i shr a 16 +end +end +note the shape this frame: breathing, drawn in while thinking, gathered in while being born +fn mdshape t long form long to void +b = pksin mdphase t 5500 +b = mul b 1966 +b = shr b 14 +sq = mul get Mdv 12 65536 +sq = div sq 256 +scale = add 65536 b +scale = sub scale sq +gather = long pkeaseout form +gather = sub 256 gather +b = mul gather 560 +b = div b 256 +b = add b 256 +scale = mul scale b +put Mdv 25 shr scale 8 +sw = mul gather gather +sw = shr sw 8 +sw = mul sw 256 +b = shr get Mdv 10 8 +b = add b sw +b = and b 4294967295 +put Mdv 16 long pksmooth mul form 3 +put Mdv 21 pkcos ulong b +put Mdv 22 pksin ulong b +put Mdv 23 pkcos 3641 +put Mdv 24 pksin 3641 +put Mdv 26 mul get Mdv 2 16 +put Mdv 27 mul get Mdv 0 16 +put Mdv 28 get Mdv 27 +put Mdv 29 mul get Mdv 1 16 +put Mdv 30 get Mdv 29 +end +note turn about the upright axis: rz +fn mdrz i long to long +x = mul mdhome i 0 get Mdv 22 +z = mul mdhome i 2 get Mdv 21 +x = add x z +ret shr x 14 +end +fn mdrx i long to long +x = mul mdhome i 0 get Mdv 21 +z = mul mdhome i 2 get Mdv 22 +x = sub x z +ret shr x 14 +end +note c*16 + 8 + (v * persp >> 14) * R16 / 16384 * scale / 65536 +fn mdscreen c long v long persp long to long +v = mul v persp +v = shr v 14 +v = mul v get Mdv 26 +v = div v 16384 +v = mul v get Mdv 25 +v = div v 65536 +c = mul c 16 +c = add c 8 +ret add c v +end +note (uint32_t) of the nearness then capped at 256: a negative value wraps past 256 +fn mdnear32 v long to long +if lt v 0 +ret 256 +end +if gt v 256 +ret 256 +end +ret v +end +fn mdproj i long to void +rz = mdrz i +y = mdhome i 1 +ry = mul y get Mdv 23 +fz = mul rz get Mdv 24 +ry = sub ry fz +ry = shr ry 14 +fz = mul y get Mdv 24 +y = mul rz get Mdv 23 +fz = add fz y +fz = shr fz 14 +persp = mul fz 3 +persp = div persp 16 +persp = add persp 16384 +put Mdpx i mdscreen get Mdv 0 mdrx i persp +put Mdpy i mdscreen get Mdv 1 ry persp +fz = add fz 16384 +fz = mul fz 256 +put Mdnear i mdnear32 div fz 32768 +end +fn mdrad i long to long +x = mdhome i 0 +x = mul x x +y = mdhome i 1 +y = mul y y +z = mdhome i 2 +z = mul z z +x = add add x y z +x = long pkisqrt ulong x +x = mul x 256 +ret div x 16384 +end +note the light a word pulse of this age gives a point at rad +fn mdwpulse rad long age long to long +o = mul age 300 +o = div o 600 +o = sub rad o +p = mdpulse o 70 +o = sub 900 age +p = mul p o +p = div p 900 +p = mul p 150 +ret shr p 8 +end +note the light a key pulse of this age gives a point at ny +fn mdkpulse ny long age long to long +o = mul age 600 +o = div o 500 +o = sub 300 o +o = sub ny o +p = mdpulse o 60 +o = sub 600 age +p = mul p o +p = div p 600 +p = mul p 90 +ret shr p 8 +end +note light from the pulses: words outward from the heart, keys upward from below +fn mdpulses rad long ny long t long to long +extra = long 0 +for w ulong 4 +wt = get Mdwords w +if ne wt 0 +if le wt t +age = sub t wt +if lt age 900 +extra = add extra mdwpulse rad age +end +end +end +wt = get Mdkeys w +if ne wt 0 +if le wt t +age = sub t wt +if lt age 600 +extra = add extra mdkpulse ny age +end +end +end +end +ret extra +end +fn mdlight i long t long to void +rad = mdrad i +ny = mdhome i 1 +ny = mul ny 256 +ny = div ny 16384 +l = mdpulses rad ny t +nr = get Mdnear i +nr = mul nr nr +nr = div nr 256 +nr = mul nr 180 +nr = div nr 256 +l = add l nr +l = add l 34 +nr = mul get Mdact i 120 +nr = div nr 256 +l = add l nr +if gt l 256 +l = 256 +end +put Mdlum i l +end +fn mdgrow i long to void +put Mdv 27 pkmin get Mdv 27 get Mdpx i +put Mdv 28 pkmax get Mdv 28 get Mdpx i +put Mdv 29 pkmin get Mdv 29 get Mdpy i +put Mdv 30 pkmax get Mdv 30 get Mdpy i +end +note the native-pixel heart and the box round everything +fn mdboxup to void +hx = mul get Mdv 0 16 +hx = add hx 8 +hy = mul get Mdv 1 16 +hy = add hy 8 +put Mdv 17 hx +put Mdv 18 hy +put Mdv 19 24 +x0 = sub get Mdv 27 48 +x0 = pkmin x0 sub hx 40 +x1 = add get Mdv 28 48 +x1 = pkmax x1 add hx 40 +y0 = sub get Mdv 29 48 +y0 = pkmin y0 sub hy 40 +y1 = add get Mdv 30 48 +y1 = pkmax y1 add hy 40 +put Mdnow 0 sub shr x0 4 1 +put Mdnow 1 sub shr y0 4 1 +x1 = sub x1 x0 +x1 = shr x1 4 +put Mdnow 2 add x1 3 +y1 = sub y1 y0 +y1 = shr y1 4 +put Mdnow 3 add y1 3 +end +note sparks are born at the mode's rate +fn mdspawn md long dt long to void +w = add md 12 +w = mul get Mdtab w dt +spawn = add get Mdv 8 w +note spawn grows by at most 25*250 per frame +while ge spawn 1000 bound 999999 +spawn = sub spawn 1000 +mdspark 120 +end +put Mdv 8 spawn +end +fn mdat t long to void +dt = long 0 +if gt t get Mdv 6 +dt = sub t get Mdv 6 +end +if gt dt 250 +dt = 250 +end +put Mdv 6 t +for i ulong 4 +put Mdwas i get Mdnow i +end +if lt t get Mdv 5 +put Mdv 16 0 +for i ulong 4 +put Mdnow i 0 +end +ret +end +md = and get Mdv 9 3 +mdease md dt t +dt2 = mul get Mdv 11 dt +dt2 = add dt2 get Mdv 10 +put Mdv 10 and dt2 4294967295 +born = get Mdv 5 +dt2 = add born 3000 +form = pkprog ulong t ulong born ulong dt2 +put Mdv 20 form +if ge form 192 +mdspawn md dt +end +mdarrive md t +mddecay dt +mdshape t form +for i ulong 120 +mdproj long i +mdlight long i t +mdgrow long i +end +mdboxup +end +fn mdcopy4 which long to void +for i ulong 4 +if eq which 0 +put Mdbox i get Mdnow i +else +put Mdbox i get Mdwas i +end +end +end +note what needs redrawing: the union of where it was and where it is, into Mdbox +fn mddirty to void +if le get Mdwas 2 0 +mdcopy4 0 +ret +end +if le get Mdwas 3 0 +mdcopy4 0 +ret +end +if le get Mdnow 2 0 +mdcopy4 1 +ret +end +if le get Mdnow 3 0 +mdcopy4 1 +ret +end +x0 = pkmin get Mdwas 0 get Mdnow 0 +y0 = pkmin get Mdwas 1 get Mdnow 1 +put Mdbox 0 x0 +put Mdbox 1 y0 +x1 = add get Mdwas 0 get Mdwas 2 +x1 = pkmax x1 add get Mdnow 0 get Mdnow 2 +put Mdbox 2 sub x1 x0 +x1 = add get Mdwas 1 get Mdwas 3 +x1 = pkmax x1 add get Mdnow 1 get Mdnow 3 +put Mdbox 3 sub x1 y0 +end +note ---- drawing: coverage-mixed points and threads inside Mdclip and the screen ---- +note Mdp 1 cx 2 cy 3 radius 4 color 5 alpha 6 inner2 7 outer2 9 x0 10 y0 11 x1 12 y1 (the pixel box) +fn mdpbox bx long by long bw long bh long to bool +x0 = pkmax bx get Mdclip 0 +x0 = pkmax x0 0 +y0 = pkmax by get Mdclip 1 +y0 = pkmax y0 0 +x1 = add get Mdclip 0 get Mdclip 2 +x1 = pkmin x1 add bx bw +x1 = pkmin x1 get Lg 0 +y1 = add get Mdclip 1 get Mdclip 3 +y1 = pkmin y1 add by bh +y1 = pkmin y1 get Lg 1 +if le x1 x0 +ret false +end +if le y1 y0 +ret false +end +put Mdp 9 x0 +put Mdp 10 y0 +put Mdp 11 x1 +put Mdp 12 y1 +ret true +end +note mix the point's colour into frame word idx with this coverage +fn mdpmix idx ulong cov ulong to void +a = mul cov ulong get Mdp 5 +a = shr a 8 +put Nfrm idx uint pkmix ulong get Nfrm idx ulong get Mdp 4 a +end +fn mdprow y long to void +dy = mul y 16 +dy = add dy 8 +dy = sub dy get Mdp 2 +dy = mul dy dy +x = get Mdp 9 +xe = get Mdp 11 +idx = mul ulong y ulong get Lg 0 +idx = add idx ulong x +note xe - x pixels, at most the screen width +while lt x xe bound 4096 +dx = mul x 16 +dx = add dx 8 +dx = sub dx get Mdp 1 +dx = mul dx dx +dx = add dx dy +if lt dx get Mdp 7 +cov = ulong 256 +full = false +if ge get Mdp 3 8 +if le dx get Mdp 6 +full = true +end +end +if not full +dx = long pkisqrt ulong dx +cov = pkcover sub dx get Mdp 3 +end +if ne cov 0 +mdpmix idx cov +end +end +x = add x 1 +idx = add idx 1 +end +end +note a filled geometric point: constant light inside, one-pixel coverage at its boundary +fn mdpoint cx long cy long radius long color long alpha long to void +if le radius 0 +ret +end +if eq alpha 0 +ret +end +bx = sub cx radius +bx = sub bx 8 +bx = shr bx 4 +by = sub cy radius +by = sub by 8 +by = shr by 4 +bw = add cx radius +bw = add bw 8 +bw = shr bw 4 +bw = sub bw bx +bw = add bw 1 +bh = add cy radius +bh = add bh 8 +bh = shr bh 4 +bh = sub bh by +bh = add bh 1 +if not mdpbox bx by bw bh +ret +end +put Mdp 1 cx +put Mdp 2 cy +put Mdp 3 radius +put Mdp 4 color +put Mdp 5 alpha +bx = sub radius 8 +bx = pkmax bx 0 +put Mdp 6 mul bx bx +bx = add radius 8 +put Mdp 7 mul bx bx +by = get Mdp 10 +note at most the screen height rows +while lt by get Mdp 12 bound 4096 +mdprow by +by = add by 1 +end +end +note Mdp 0 width 1 x0 2 y0 3 len 4 grad 5 radius 6 a0 7 a1 8 steep (after the swaps) +fn mdtin x long y long to bool +if lt x get Mdclip 0 +ret false +end +if lt y get Mdclip 1 +ret false +end +if ge x add get Mdclip 0 get Mdclip 2 +ret false +end +if ge y add get Mdclip 1 get Mdclip 3 +ret false +end +if lt x 0 +ret false +end +if lt y 0 +ret false +end +if ge x get Lg 0 +ret false +end +if ge y get Lg 1 +ret false +end +ret true +end +fn mdtpx X long Y long yc long a long to void +x = X +y = Y +if ne get Mdp 8 0 +x = Y +y = X +end +if not mdtin x y +ret +end +yc = mul Y 16 +yc = add yc 8 +yc = sub yc get Mdp 2 +yc = pkabs yc +yc = sub yc get Mdp 5 +a = mul a long pkcover yc +a = shr a 8 +x = add mul y get Lg 0 x +put Nfrm x uint pkmix ulong get Nfrm x 7900415 ulong a +end +fn mdtcol X long to void +along = mul X 16 +along = add along 8 +along = sub along get Mdp 1 +yc = mul along get Mdp 4 +yc = shr yc 16 +yc = add yc get Mdp 2 +a = sub get Mdp 7 get Mdp 6 +a = mul a along +a = div a get Mdp 3 +a = add a get Mdp 6 +y = sub yc get Mdp 5 +y = sub y 8 +y = shr y 4 +ye = add yc get Mdp 5 +ye = add ye 8 +ye = shr ye 4 +put Mdp 2 yc +note radius/8 + 2 rows +while le y ye bound 4096 +mdtpx X y yc a +y = add y 1 +end +put Mdp 2 get Mdp 9 +end +fn mdtrun x0 long y0 long x1 long y1 long a0 long a1 long to void +ln = sub x1 x0 +ln = pkmax ln 1 +grad = sub y1 y0 +grad = mul grad 65536 +grad = div grad ln +put Mdp 1 x0 +put Mdp 2 y0 +put Mdp 9 y0 +put Mdp 3 ln +put Mdp 4 grad +put Mdp 6 a0 +put Mdp 7 a1 +grad = mul grad grad +grad = add grad 4294967296 +grad = long pkisqrt ulong grad +grad = shr grad 8 +grad = mul grad get Mdp 0 +put Mdp 5 shr grad 9 +x0 = add x0 7 +x0 = shr x0 4 +x1 = sub x1 8 +x1 = shr x1 4 +if ne get Mdp 8 0 +x0 = pkmax x0 get Mdclip 1 +ln = add get Mdclip 1 get Mdclip 3 +else +x0 = pkmax x0 get Mdclip 0 +ln = add get Mdclip 0 get Mdclip 2 +end +x1 = pkmin x1 sub ln 1 +note at most the screen's major extent of columns +while le x0 x1 bound 4096 +mdtcol x0 +x0 = add x0 1 +end +end +note a thread whose light runs from a0 to a1, coverage mixed (crossings never add up) +fn mdthread x0 long y0 long x1 long y1 long a0 long a1 long to void +if le get Mdp 0 0 +ret +end +if eq a0 0 +if eq a1 0 +ret +end +end +put Mdp 8 0 +t = pkabs sub y1 y0 +if gt t pkabs sub x1 x0 +put Mdp 8 1 +t = x0 +x0 = y0 +y0 = t +t = x1 +x1 = y1 +y1 = t +end +if gt x0 x1 +t = x0 +x0 = x1 +x1 = t +t = y0 +y0 = y1 +y1 = t +t = a0 +a0 = a1 +a1 = t +end +mdtrun x0 y0 x1 y1 a0 a1 +end +fn mdtalpha n long to long +l = mul get Mdnear n 60 +l = div l 256 +l = add l 16 +l = mul l get Mdlum n +l = shr l 8 +l = mul l get Mdv 31 +ret shr l 8 +end +fn mdthreads to void +put Mdp 0 div get Mdv 3 16 +nedge = get Mdv 4 +for i ulong ulong nedge +a = get Mdea i +b = get Mdeb i +mdthread get Mdpx a get Mdpy a get Mdpx b get Mdpy b mdtalpha a mdtalpha b +end +end +fn mdpoints to void +al = get Mdv 16 +for i ulong 120 +c = long pkmix 2115728 3174592 ulong get Mdact i +a = mul get Mdlum i al +mdpoint get Mdpx i get Mdpy i 16 c shr a 8 +end +end +note the k-th of a spark's three fading points +fn mdsparkpt a long b long g long k long to void +x = sub get Mdpx b get Mdpx a +x = mul x g +x = shr x 8 +x = add x get Mdpx a +y = sub get Mdpy b get Mdpy a +y = mul y g +y = shr y 8 +y = add y get Mdpy a +g = shr 200 k +g = mul g get Mdv 16 +g = shr g 8 +k = mul k 4 +mdpoint x y sub 16 k 3174592 g +end +fn mdsparkdraw i long to void +e = get Mdse i +a = get Mdea e +b = get Mdeb e +if ne get Mdsback i 0 +a = get Mdeb e +b = get Mdea e +end +f = sub get Mdv 6 get Mdst0 i +f = mul f 256 +f = div f get Mdsdur i +for k long 3 +g = mul k 22 +g = sub f g +g = pkclamp g 0 256 +mdsparkpt a b g k +end +end +fn mdheart to void +h = get Mdv 13 +c = long pkmix 2115728 3174592 ulong h +a = add 90 h +a = pkmin a 256 +a = mul a get Mdv 16 +mdpoint get Mdv 17 get Mdv 18 get Mdv 19 c shr a 8 +end +note does the mind's box meet the draw rect +fn mdmeets to bool +x1 = add get Mdnow 0 get Mdnow 2 +x1 = pkmin x1 add get Mdclip 0 get Mdclip 2 +if le x1 pkmax get Mdnow 0 get Mdclip 0 +ret false +end +x1 = add get Mdnow 1 get Mdnow 3 +x1 = pkmin x1 add get Mdclip 1 get Mdclip 3 +if le x1 pkmax get Mdnow 1 get Mdclip 1 +ret false +end +ret true +end +note the figure into the part (x, y, w, h) of the frame, held inside the clip Lg[5..8] +fn mddraw x long y long w long h long to void +if eq get Mdv 16 0 +ret +end +x0 = pkmax x get Lg 5 +y0 = pkmax y get Lg 6 +w = add x w +w = pkmin w add get Lg 5 get Lg 7 +h = add y h +h = pkmin h add get Lg 6 get Lg 8 +if le w x0 +ret +end +if le h y0 +ret +end +put Mdclip 0 x0 +put Mdclip 1 y0 +put Mdclip 2 sub w x0 +put Mdclip 3 sub h y0 +if not mdmeets +ret +end +x0 = sub get Mdv 20 128 +x0 = mul x0 2 +x0 = long pksmooth x0 +x0 = mul x0 get Mdv 16 +put Mdv 31 shr x0 8 +if ne get Mdv 31 0 +mdthreads +end +mdpoints +w = get Mdv 15 +for i ulong ulong w +mdsparkdraw long i +end +mdheart +end diff --git a/native/omega/allen/look-night.om b/native/omega/allen/look-night.om new file mode 100644 index 00000000..86dd342c --- /dev/null +++ b/native/omega/allen/look-night.om @@ -0,0 +1,965 @@ +note look-night.om: the night, ported from native/kernel/ui/night.c at aienux 4b24df65 (integer for integer). +note Needs look-paint.om (pk*, Lg, Nfrm, Nsky, Slin, Ssrgb) and look-sky.om (skmake, sktwink, Sktw*, Skg*) before it; +note pkinit must have run (the integrator does that once; ntinit does not). +note API: ntinit; ntat t; ntbase x y w h; ntlights x y w h shim voice; ntfaded x y l; ntstarbox i (into Pa 0..3); +note ntholes; ntcount. Readable state after ntat: Nthol (count), Nthole (x y e rs per hole, 16ths; hole 0 at 0..3, hole 1 at +note 4..7), Ntlens (x y w h px, w=0 none), Ntrip (0 ripple_r px, 1 ripple_w px (0 none), 2 ripple_c2, 3 ripple_s2 Q14). +note Milliseconds: FADE_END 6800, HOLES 2600, SPIRAL 6000, MERGE 12000, RIPPLE 3600, GONE 15200, ORBIT 5200. +global Ntapp uchar 519901 +global Ntaw long 1 +global Ntt ulong 1 +global Nthol ulong 1 +global Nthole long 8 +global Ntlens long 4 +global Ntrip long 4 +global Ntdisp long 1024 +global Ntlit uchar 1024 +global Ntband uchar 256 +global Ntpow2 ulong 257 +global Ntsep long 1 +global Ntsxy long 2 +global Ntwarp long 3 +global Ntcor long 12 +global Ntwt long 4 +global Ntlr long 8 +global Ntlit0 ulong 257 +global Ntsz long 5 +global Ntcoarse ulong 1 +global Ntdone uint 131072 +global Ntstamp uint 1 +global Ntbw long 1 +global Ntb long 4 +global Ntd long 4 +global Ntg long 5 +note nts: S(v) = (v * k + 128) / 256, the 1920 x 1080 design unit scaled to this screen. +fn nts v long to long +ret div add mul v get Lg 2 128 256 +end +note ntpow2: 2^(x / 65536) in Q16 (night.c pow2_q16). +fn ntpow2 x ulong to ulong +n = shr x 16 +f = and x 65535 +k = shr f 8 +g = and f 255 +m = add get Ntpow2 k shr mul sub get Ntpow2 add k 1 get Ntpow2 k g 8 +ret shl m n +end +note ntgauss: exp(-(v / width)^2) in Q16 (night.c gauss). +fn ntgauss v long width long to ulong +if eq width 0 +width = 1 +end +q = div mul v 256 width +if or gt q 4095 lt q -4095 +ret 0 +end +ret pkexpneg ulong shr mul q q 8 +end +note ntfar: the farthest screen corner from the centre, pixels. +fn ntfar to long +far = long 0 +for i ulong 4 +px = long 0 +if eq and i 1 1 +px = get Lg 0 +end +py = long 0 +if eq shr i 1 1 +py = get Lg 1 +end +dx = sub px get Lg 3 +dy = sub py get Lg 4 +far = pkmax far long pkisqrt ulong add mul dx dx mul dy dy +end +ret far +end +fn ntappx x long y long h long far long to uchar +x = mul x 4 +y = mul y 4 +dx = sub x get Lg 3 +dy = sub y get Lg 4 +dx = long pkisqrt ulong add mul dx dx mul dy dy +dx = div mul dx 255 far +x = div mul x 640 h +y = div mul y 640 h +dy = long shr pkfbm x y 909 4 8 +ret uchar div add mul dy 6 mul dx 4 10 +end +note ntappear: the appearance map, one byte per 4 x 4 cell (night.c appear_map). +fn ntappear to void +aw = ulong get Ntaw 0 +ah = ulong add div get Lg 1 4 1 +h = get Lg 1 +far = ntfar +if eq far 0 +far = 1 +end +for y ulong ah +for x ulong aw +put Ntapp add mul y aw x ntappx long x long y h far +end +end +end +note ntfaded: how far pixel (x, y) with luma l has faded in, 0..256 (ck_night_faded). +fn ntfaded x long y long l ulong to ulong +if ge get Ntt 0 6800 +ret 256 +end +x = pkclamp x 0 sub get Lg 0 1 +y = pkclamp y 0 sub get Lg 1 1 +y = add mul shr y 2 get Ntaw 0 shr x 2 +x = mul long get Ntapp y 12 +x = add add 300 x mul sub 255 long l 8 +dt = sub long get Ntt 0 x +if le dt 0 +ret 0 +end +if ge dt 1365 +ret 256 +end +ret pksmooth shr mul dt 48 8 +end +fn ntfadepx c ulong x long y long to ulong +if eq c 0 +note pkscale 0 f is 0 for every f: one black fades to itself. +ret 0 +end +l = pkmax pkmax long and shr c 16 255 long and shr c 8 255 long and c 255 +f = ntfaded x y ulong l +if ge f 256 +ret c +end +ret pkscale c f +end +note ntfrow / ntcrow: one row of the base, pixels x0..x1-1, fading / plain copy. +fn ntfrow y long x0 long x1 long to void +base = mul y get Lg 0 +for i ulong ulong sub x1 x0 +x = add x0 long i +p = add base x +c = ulong get Nsky p +if ne c 0 +c = ntfadepx c x y +end +put Nfrm p uint c +end +end +fn ntcrow y long x0 long x1 long to void +base = mul y get Lg 0 +for i ulong ulong sub x1 x0 +p = add base add x0 long i +put Nfrm p get Nsky p +end +end +note ntinit: tables, the sky (skmake), the appearance map, state at t = 0 (ck_night_init). +fn ntinit to void +note The ripple's light over one black: pkadd for every light value, computed once (most of +note the sky is one black, so the per-pixel add becomes a table read; same bytes). +for a ulong 257 +put Ntlit0 a pkadd 0 5663920 a +end +put Ntsz 0 mul sub get Lg 0 1 16 +put Ntsz 1 mul sub get Lg 1 1 16 +put Ntsz 2 sub get Lg 0 1 +put Ntsz 3 sub get Lg 1 1 +put Ntsz 4 mul sub get Lg 1 1 get Lg 0 +put Ntcoarse 0 0 +put Ntbw 0 div add get Lg 0 7 8 +put Ntstamp 0 0 +for i ulong 131072 +put Ntdone i 0 +end +for i ulong 256 +c = shr ulong add 16384 pkcos mul i 256 1 +c2 = shr mul c c 14 +c6 = shr mul shr mul c2 c2 14 c2 14 +put Ntband i uchar shr mul c6 255 14 +end +e2 = ulong 1073741824 +for i ulong 256 +put Ntpow2 i shr add e2 8192 14 +e2 = shr mul e2 1076652777 30 +end +put Ntpow2 256 131072 +put Ntaw 0 add div get Lg 0 4 1 +skmake +ntappear +ntat 0 +end +fn ntroot8 l ulong to ulong +for i ulong 3 +l = pkisqrt shl l 30 +end +ret l +end +note ntorbit: the orbit angle (turns / 65536) at t; the separation (16ths) goes to Ntsep (night.c orbit_angle). +fn ntorbit t ulong a0 long to ulong +if lt t 6000 +put Ntsep 0 a0 +ret div mul sub t 2600 65536 5200 +end +left = div shl sub 12000 t 30 6000 +r = ntroot8 left +r2 = shr mul r r 30 +r5 = shr mul shr mul r2 r2 30 r 30 +put Ntsep 0 long shr mul ulong a0 r2 30 +ret add 42850 shr mul 120989 sub 1073741824 r5 30 +end +fn ntat2 t ulong ef long rf long a0 long cx long cy long to void +ang = ntorbit t a0 +v = shr mul ef long pksmooth pkprog t 2600 5200 8 +put Nthole 2 v +put Nthole 6 v +v = shr mul rf long pksmooth pkprog t 4000 6000 8 +put Nthole 3 v +put Nthole 7 v +v = div get Ntsep 0 2 +hx = shr mul v pkcos ang 14 +hy = shr mul v pksin ang 15 +put Nthole 0 add cx hx +put Nthole 1 add cy hy +put Nthole 4 sub cx hx +put Nthole 5 sub cy hy +put Nthol 0 2 +end +fn ntat1 t ulong ef long rf long cx long cy long to void +tm = sub t 12000 +rs0 = div mul rf 323 256 +rs = long pksmooth pkprog tm 0 180 +rs = add rs0 shr mul sub mul rf 2 rs0 rs 8 +wob = long pkexpneg div mul tm 256 260 +wob = shr mul pksin div mul tm 65536 95 wob 16 +wob = div mul mul rs wob 7 100 +rs = add rs shr wob 14 +keep = sub 256 long pksmooth pkprog t 12900 15200 +put Nthole 0 cx +put Nthole 1 cy +ef = div mul ef 362 256 +put Nthole 2 shr mul ef keep 8 +keep = shr mul keep keep 8 +put Nthole 3 shr mul rs keep 8 +put Nthol 0 1 +end +note ntunion: Ntlens = Ntlens U (x y w h), the lens rect in pixels. +fn ntunion x long y long w long h long to void +if or le get Ntlens 2 0 le get Ntlens 3 0 +put Ntlens 0 x +put Ntlens 1 y +put Ntlens 2 w +put Ntlens 3 h +ret +end +x0 = pkmin get Ntlens 0 x +y0 = pkmin get Ntlens 1 y +x1 = pkmax add get Ntlens 0 get Ntlens 2 add x w +y1 = pkmax add get Ntlens 1 get Ntlens 3 add y h +put Ntlens 0 x0 +put Ntlens 1 y0 +put Ntlens 2 sub x1 x0 +put Ntlens 3 sub y1 y0 +end +note ntholebox: hole i's own lens box (x y w h, unclipped) into Pa 0..3; false when it has none. +fn ntholebox i ulong to bool +b = mul i 4 +e = get Nthole add b 2 +rs = get Nthole add b 3 +if and le e 0 le rs 0 +ret false +end +reach = add shr div mul e 44 10 4 2 +rs = add shr div mul rs 16 10 4 2 +reach = pkmax reach rs +put Pa 0 sub shr get Nthole b 4 reach +put Pa 1 sub shr get Nthole add b 1 4 reach +put Pa 2 add mul 2 reach 1 +put Pa 3 add mul 2 reach 1 +ret true +end +fn ntlensbox to void +for i ulong get Nthol 0 +if ntholebox i +x = get Pa 0 +y = get Pa 1 +w = get Pa 2 +ntunion x y w get Pa 3 +end +end +if ne get Ntlens 2 0 +x0 = pkmax get Ntlens 0 0 +y0 = pkmax get Ntlens 1 0 +x1 = pkmin add get Ntlens 0 get Ntlens 2 get Lg 0 +y1 = pkmin add get Ntlens 1 get Ntlens 3 get Lg 1 +if or le x1 x0 le y1 y0 +put Ntlens 0 0 +put Ntlens 1 0 +put Ntlens 2 0 +put Ntlens 3 0 +else +put Ntlens 0 x0 +put Ntlens 1 y0 +put Ntlens 2 sub x1 x0 +put Ntlens 3 sub y1 y0 +end +end +end +note ntriptab: Ntdisp / Ntlit over the ripple width; amp in Ntsxy 0, env in Ntsxy 1. +fn ntriptab reach long w long lambda long to void +n = ulong add mul 2 reach 1 +for i ulong n +o = sub long i reach +s = and div mul o 65536 lambda 65535 +s = shr mul get Ntsxy 0 pksin ulong s 14 +put Ntdisp i shr mul s long ntgauss o w 16 +s = long ntgauss o div mul w 6 10 +s = mul mul s get Ntsxy 1 46 +put Ntlit i uchar shr s 24 +end +end +fn ntripple t ulong last ulong to void +if or lt t 12000 ge t 15600 +ret +end +tr = sub t 12000 +w = pkclamp nts 60 4 200 +reach = div mul w 22 10 +far = add ntfar reach +rr = div mul far long tr 3600 +put Ntrip 0 rr +put Ntrip 1 w +env = sub 256 pksmooth pkprog tr 2160 3600 +env = shr mul pksmooth pkprog tr 0 220 env 8 +amp = sub 256 div mul 150 rr far +amp = shr mul mul nts 6 16 amp 8 +put Ntsxy 0 shr mul amp long env 8 +put Ntsxy 1 long env +ntriptab reach w pkmax nts 110 8 +put Ntrip 2 pkcos mul 2 last +put Ntrip 3 pksin mul 2 last +end +note ntat: the state at t ms (ck_night_at): holes, lens rect, ripple tables. +fn ntat t ulong to void +put Ntt 0 t +put Ntstamp 0 add get Ntstamp 0 1 +put Nthol 0 0 +put Ntlens 0 0 +put Ntlens 1 0 +put Ntlens 2 0 +put Ntlens 3 0 +put Ntrip 0 0 +put Ntrip 1 0 +put Ntrip 2 0 +put Ntrip 3 0 +ef = mul nts 60 16 +rf = mul nts 20 16 +a0 = mul nts 270 16 +cx = add mul get Lg 3 16 8 +cy = add mul get Lg 4 16 8 +last = ntorbit 11999 a0 +if and ge t 2600 lt t 12000 +ntat2 t ef rf a0 cx cy +else +if and ge t 12000 lt t 15200 +ntat1 t ef rf cx cy +end +end +ntlensbox +ntripple t last +end +note ntsample: the sky at (sx, sy) in 16ths, bilinear (night.c sample). The four taps are +note read in place; when they agree (most of the sky is one black) no mix is needed, as pkmix +note itself would answer: it returns d when d equals c. +fn ntsample sx long sy long to ulong +sx = pkclamp sub sx 8 0 mul sub get Lg 0 1 16 +sy = pkclamp sub sy 8 0 mul sub get Lg 1 1 16 +ix = shr sx 4 +iy = mul shr sy 4 get Lg 0 +ix1 = pkmin add ix 1 sub get Lg 0 1 +iy1 = iy +if lt shr sy 4 sub get Lg 1 1 +iy1 = add iy get Lg 0 +end +a = ulong get Nsky add iy ix +b = ulong get Nsky add iy ix1 +c = ulong get Nsky add iy1 ix +d = ulong get Nsky add iy1 ix1 +if and eq a b and eq c d eq a c +ret a +end +fx = mul ulong and sx 15 16 +a = pkmix a b fx +c = pkmix c d fx +ret pkmix a c mul ulong and sy 15 16 +end +fn ntlens1 e long dx long dy long d2 long out long to void +in = div mul mul e e 484 100 +if lt d2 64 +d2 = 64 +end +f = div mul mul e e 65536 d2 +if gt d2 in +w = div mul sub out d2 65536 sub out in +f = shr mul f shr mul w w 16 16 +end +put Ntsxy 0 sub get Ntsxy 0 shr mul dx f 16 +put Ntsxy 1 sub get Ntsxy 1 shr mul dy f 16 +end +fn ntlens0 X long Y long b ulong to void +e = get Nthole add b 2 +if le e 0 +ret +end +dx = sub X get Nthole b +dy = sub Y get Nthole add b 1 +d2 = add mul dx dx mul dy dy +out = div mul mul e e 1936 100 +if lt d2 out +ntlens1 e dx dy d2 out +end +end +fn ntlensat X long Y long to void +for i ulong get Nthol 0 +ntlens0 X Y mul i 4 +end +end +fn ntwrip2 dx long dy long d2 long r16 long i long to void +q = mul sub mul dx dx mul dy dy get Ntrip 2 +q = add q mul mul 2 mul dx dy get Ntrip 3 +q = div q d2 +m = add 5734 shr mul q 10650 14 +m = shr mul get Ntdisp i m 14 +put Ntsxy 0 sub get Ntsxy 0 div mul m dx r16 +put Ntsxy 1 sub get Ntsxy 1 div mul m dy r16 +put Ntwarp 2 long get Ntlit i +end +fn ntwripple X long Y long to void +dx = sub X add mul get Lg 3 16 8 +dy = sub Y add mul get Lg 4 16 8 +d2 = add mul dx dx mul dy dy +r16 = long pkisqrt ulong d2 +reach = div mul get Ntrip 1 22 10 +i = add sub shr r16 4 get Ntrip 0 reach +if gt r16 0 +if and ge i 0 le i mul 2 reach +if lt i 1024 +ntwrip2 dx dy d2 r16 i +end +end +end +end +note ntwarp: where (X, Y) in 16ths samples from: offset in Ntwarp 0 1, ripple light in Ntwarp 2 (night.c warp). +fn ntwarp X long Y long to void +put Ntsxy 0 0 +put Ntsxy 1 0 +put Ntwarp 2 0 +ntlensat X Y +if ne get Ntrip 1 0 +ntwripple X Y +end +put Ntwarp 0 get Ntsxy 0 +put Ntwarp 1 get Ntsxy 1 +end +fn ntfinal c ulong x long y long light ulong to ulong +if lt get Ntt 0 6800 +c = ntfadepx c x y +end +if ne light 0 +if and eq c 0 le light 256 +ret get Ntlit0 light +end +ret pkadd c 5663920 light +end +ret c +end +note ntring: the shadow disc and the ring of a hole of radius rs at distance r (16ths) over c. +fn ntring c ulong r long rs long to ulong +c = pkmix c 0 pkcover sub r rs +ring = pkabs sub r div mul rs 104 100 +a = ulong 0 +if lt ring 22 +a = ulong mul sub 22 ring 6 +end +if gt r rs +if lt r div mul rs 3 2 +ring = sub div mul rs 3 2 r +a = add a ulong div mul ring 46 add div rs 2 1 +end +end +ret pkadd c 16770244 a +end +fn ntshadow c ulong X long Y long b ulong to ulong +rs = get Nthole add b 3 +if le rs 0 +ret c +end +dx = sub X get Nthole b +dy = sub Y get Nthole add b 1 +dx = add mul dx dx mul dy dy +if ge dx div mul mul rs rs 9 4 +ret c +end +ret ntring c long pkisqrt ulong dx rs +end +note ntnearpx: one pixel next to a hole, exact warp plus the shadow disc and ring (night.c near_px). +fn ntnearpx x long y long to ulong +X = add mul x 16 8 +Y = add mul y 16 8 +note ntwarp in place: the lens of every hole, then the ripple, into Ntsxy and Ntwarp 2. +put Ntsxy 0 0 +put Ntsxy 1 0 +put Ntwarp 2 0 +for i ulong get Nthol 0 +ntlens0 X Y mul i 4 +end +if ne get Ntrip 1 0 +ntwripple X Y +end +c = ntsample add X get Ntsxy 0 add Y get Ntsxy 1 +c = ntfinal c x y ulong get Ntwarp 2 +for i ulong get Nthol 0 +c = ntshadow c X Y mul i 4 +end +ret c +end +fn ntnear1 X long Y long b ulong to bool +reach = div mul get Nthole add b 3 3 2 +reach = add pkmax get Nthole add b 2 reach 128 +dx = sub X get Nthole b +dy = sub Y get Nthole add b 1 +ret lt add mul dx dx mul dy dy mul reach reach +end +fn ntnearhole x long y long to bool +x = add mul x 16 8 +y = add mul y 16 8 +for i ulong get Nthol 0 +if ntnear1 x y mul i 4 +ret true +end +end +ret false +end +fn ntinrip bx long by long to bool +if eq get Ntrip 1 0 +ret false +end +reach = add div mul get Ntrip 1 22 10 1 +lo = pkmax 0 sub get Ntrip 0 reach +hi = add get Ntrip 0 reach +cx = get Lg 3 +cy = get Lg 4 +nx = sub pkclamp cx bx add bx 8 cx +ny = sub pkclamp cy by add by 8 cy +if gt add mul nx nx mul ny ny mul hi hi +ret false +end +nx = pkmax pkabs sub bx cx pkabs sub add bx 8 cx +ny = pkmax pkabs sub by cy pkabs sub add by 8 cy +ret ge add mul nx nx mul ny ny mul lo lo +end +note ntmeetl: does the s x s box at (x, y) meet the lens rect. +fn ntmeetl x long y long s long to bool +if ge x add get Ntlens 0 get Ntlens 2 +ret false +end +if ge y add get Ntlens 1 get Ntlens 3 +ret false +end +if le add x s get Ntlens 0 +ret false +end +if le add y s get Ntlens 1 +ret false +end +ret true +end +note ntdrect: Ntd = (x y w h) ∩ clip ∩ screen as x0 y0 x1 y1; false if empty. +fn ntdrect x long y long w long h long to bool +put Ntd 0 pkmax x pkmax 0 get Lg 5 +put Ntd 1 pkmax y pkmax 0 get Lg 6 +x = pkmin get Lg 0 add get Lg 5 get Lg 7 +put Ntd 2 pkmin add x w x +y = pkmin get Lg 1 add get Lg 6 get Lg 8 +put Ntd 3 pkmin add y h y +if le get Ntd 2 get Ntd 0 +ret false +end +if le get Ntd 3 get Ntd 1 +ret false +end +ret true +end +note ntbclip: Ntb = (bx by 8 8) clipped to Ntd, as x0 y0 x1 y1; false if empty. +fn ntbclip bx long by long to bool +put Ntb 0 pkmax bx get Ntd 0 +put Ntb 1 pkmax by get Ntd 1 +put Ntb 2 pkmin add bx 8 get Ntd 2 +put Ntb 3 pkmin add by 8 get Ntd 3 +if le get Ntb 2 get Ntb 0 +ret false +end +if le get Ntb 3 get Ntb 1 +ret false +end +ret true +end +fn ntnearrow y long to void +p = mul y get Lg 0 +n = ulong sub get Ntb 2 get Ntb 0 +for i ulong n +x = add get Ntb 0 long i +put Nfrm add p x uint ntnearpx x y +end +end +fn ntnearblk to void +n = ulong sub get Ntb 3 get Ntb 1 +for j ulong n +ntnearrow add get Ntb 1 long j +end +end +fn ntcorners bx long by long to void +for c ulong 4 +X = mul add bx mul long and c 1 8 16 +Y = mul add by mul long shr c 1 8 16 +ntwarp X Y +put Ntcor c get Ntwarp 0 +put Ntcor add c 4 get Ntwarp 1 +put Ntcor add c 8 get Ntwarp 2 +end +end +note ntmix4: the bilinear mix of four taps at fractions sx, sy (sixteenths), as ntsample. +fn ntmix4 a ulong b ulong c ulong d ulong sx long sy long to ulong +a = pkmix a b mul ulong and sx 15 16 +c = pkmix c d mul ulong and sx 15 16 +ret pkmix a c mul ulong and sy 15 16 +end +note ntgpx: one pixel of a grid block at wx (odd sixteenths across the block): the warp and +note light interpolated between the row's left and right edge values Ntlr (ntgridrow), then the +note sky sample (ntsample in place: clamp, four taps, bilinear only when the taps differ) and +note the fade or the ripple light (ntfinal in place). The edge form equals the four-corner dot +note of night.c exactly: (16-wx)(c0(16-wy) + c2 wy) + wx(c1(16-wy) + c3 wy). +fn ntgpx x long y long wx long to ulong +wi = sub 16 wx +sx = mul get Ntlr 0 wi +sx = add sx mul get Ntlr 3 wx +sy = mul get Ntlr 1 wi +sy = add sy mul get Ntlr 4 wx +sx = add mul x 16 shr sx 8 +sy = add mul y 16 shr sy 8 +if lt sx 0 +sx = 0 +end +if gt sx get Ntsz 0 +sx = get Ntsz 0 +end +if lt sy 0 +sy = 0 +end +if gt sy get Ntsz 1 +sy = get Ntsz 1 +end +ix = shr sx 4 +wi = mul shr sy 4 get Lg 0 +wi = add wi ix +note ix becomes the step to the right tap: 1, or 0 on the last column (pkmin ix+1 w-1). +if lt ix get Ntsz 2 +ix = 1 +else +ix = 0 +end +a = ulong get Nsky wi +b = ulong get Nsky add wi ix +note The row below exists while the tap lies above the last row (pkmin iy+1 h-1). +if lt wi get Ntsz 4 +wi = add wi get Lg 0 +end +c = ulong get Nsky wi +d = ulong get Nsky add wi ix +if ne a b +a = ntmix4 a b c d sx sy +else +if ne c d +a = ntmix4 a b c d sx sy +else +if ne a c +a = ntmix4 a b c d sx sy +end +end +end +if lt get Ntt 0 6800 +a = ntfadepx a x y +end +note The light, interpolated like the warp; sx is free now and holds it. +wi = sub 16 wx +sx = mul get Ntlr 2 wi +sx = add sx mul get Ntlr 5 wx +sx = shr sx 8 +if ne sx 0 +if and eq a 0 le sx 256 +ret get Ntlit0 ulong sx +end +ret pkadd a 5663920 ulong sx +end +ret a +end +fn ntgridrow y long bx long wy long to void +p = mul y get Lg 0 +wi = sub 16 wy +for k ulong 3 +b = mul k 4 +v = mul get Ntcor b wi +v = add v mul get Ntcor add b 2 wy +put Ntlr k v +v = mul get Ntcor add b 1 wi +v = add v mul get Ntcor add b 3 wy +put Ntlr add k 3 v +end +n = ulong sub get Ntb 2 get Ntb 0 +for i ulong n +x = add get Ntb 0 long i +put Nfrm add p x uint ntgpx x y add mul 2 sub x bx 1 +end +end +fn ntgridblk bx long by long to void +n = ulong sub get Ntb 3 get Ntb 1 +for j ulong n +y = add get Ntb 1 long j +ntgridrow y bx add mul 2 sub y by 1 +end +end +note ntcoarse: the ripple's band drawn at 2 x 2 (one sample for four pixels): same warp, same +note light, a quarter of the samples. Ntcoarse 0 keeps every pixel (the C look exactly); +note look-show.om turns it on while the ripple runs on a large screen. +fn ntgridrow2 y long bx long wy long to void +p = mul y get Lg 0 +wi = sub 16 wy +for k ulong 3 +b = mul k 4 +v = mul get Ntcor b wi +v = add v mul get Ntcor add b 2 wy +put Ntlr k v +v = mul get Ntcor add b 1 wi +v = add v mul get Ntcor add b 3 wy +put Ntlr add k 3 v +end +x = get Ntb 0 +while lt x get Ntb 2 bound 8 +c = ntgpx x y add mul 2 sub x bx 1 +put Nfrm add p x uint c +if lt add x 1 get Ntb 2 +put Nfrm add p add x 1 uint c +end +x = add x 2 +end +end +fn ntrowdup y long to void +note Row y of the block's columns copied onto row y + 1. +w = get Lg 0 +p = add mul y w get Ntb 0 +n = ulong sub get Ntb 2 get Ntb 0 +for i ulong n +x = add p long i +put Nfrm add x w get Nfrm x +end +end +fn ntgridblk2 bx long by long to void +y = get Ntb 1 +while lt y get Ntb 3 bound 8 +ntgridrow2 y bx add mul 2 sub y by 1 +if lt add y 1 get Ntb 3 +ntrowdup y +end +y = add y 2 +end +end +note ntblock: one 8 x 8 block of the warped base (night.c ck_night_base block loop). +note ntwhole: is the 8 x 8 block at (bx, by) entirely inside the draw rect Ntd. +fn ntwhole bx long by long to bool +if or lt bx get Ntd 0 lt by get Ntd 1 +ret false +end +ret and le add bx 8 get Ntd 2 le add by 8 get Ntd 3 +end +fn ntblock bx long by long to void +lens = false +if ne get Ntlens 2 0 +lens = ntmeetl bx by 8 +end +if not lens +if not ntinrip bx by +ret +end +end +if not ntbclip bx by +ret +end +note Rectangles composed in one frame overlap (the ripple's bands meet the lens box); a block +note drawn whole earlier this frame is the same block again, so it is left alone. Only whole +note blocks are stamped: a clipped one may be covered further by a later rectangle. +whole = ntwhole bx by +idx = ulong add mul shr by 3 get Ntbw 0 shr bx 3 +if whole +if eq get Ntdone idx get Ntstamp 0 +ret +end +put Ntdone idx get Ntstamp 0 +end +if lens +if ntnearhole add bx 4 add by 4 +ntnearblk +ret +end +end +ntcorners bx by +if and not lens ne get Ntcoarse 0 0 +ntgridblk2 bx by +else +ntgridblk bx by +end +end +fn ntblocks to void +by = sub get Ntd 1 rem get Ntd 1 8 +while lt by get Ntd 3 bound 1024 +bx = sub get Ntd 0 rem get Ntd 0 8 +while lt bx get Ntd 2 bound 1024 +ntblock bx by +bx = add bx 8 +end +by = add by 8 +end +end +note ntbase: Nsky as seen now into Nfrm, inside (x y w h) ∩ clip (ck_night_base). +fn ntbase x long y long w long h long to void +if not ntdrect x y w h +ret +end +fading = lt get Ntt 0 6800 +n = ulong sub get Ntd 3 get Ntd 1 +for i ulong n +y = add get Ntd 1 long i +if fading +ntfrow y get Ntd 0 get Ntd 2 +else +ntcrow y get Ntd 0 get Ntd 2 +end +end +if and eq get Ntlens 2 0 eq get Ntrip 1 0 +ret +end +ntblocks +end +note ntstarbox: the 2 x 2 pixel box of twinkle star i into Pa 0..3 (x y w h) (ck_night_star_box). +fn ntstarbox i ulong to void +put Pa 0 shr sub get Sktw mul i 8 8 4 +put Pa 1 shr sub get Sktw add mul i 8 1 8 4 +put Pa 2 2 +put Pa 3 2 +end +fn ntholes to ulong +ret get Nthol 0 +end +note ntcount: the number of twinkle stars. +fn ntcount to ulong +ret get Sktwn 0 +end +fn ntmeetd x long y long s long to bool +if ge x get Ntd 2 +ret false +end +if ge y get Ntd 3 +ret false +end +if le add x s get Ntd 0 +ret false +end +if le add y s get Ntd 1 +ret false +end +ret true +end +fn nttw1 i ulong to void +ntstarbox i +if not ntmeetd get Pa 0 get Pa 1 2 +ret +end +if ne get Ntlens 2 0 +if ntmeetl get Pa 0 get Pa 1 2 +ret +end +end +b = mul i 8 +per = ulong get Sktw add b 6 +tw = rem add get Ntt 0 ulong get Sktw add b 7 per +tw = shr ulong add 16384 pksin div mul tw 65536 per 7 +a = shr mul shr mul tw tw 8 120 8 +tw = ntfaded shr get Sktw b 4 shr get Sktw add b 1 4 255 +a = shr mul a tw 8 +sktwink i a +end +note ntglpx: one galaxy pixel: Ntg 0 sweep, 1 map base, 2 shimmer, 3 voice, 4 tint. +fn ntglpx x long row long to void +p = add get Ntg 1 x +l = ulong get Skglit p +if eq l 0 +ret +end +a = ulong sub 256 get Ntg 0 +a = and add a ulong get Skgpha p 255 +a = shr mul l ulong get Ntband a 8 +a = shr mul a ulong get Ntg 2 8 +a = add a shr mul shr mul l l 8 ulong get Ntg 3 9 +if ne a 0 +p = add row x +put Nfrm p uint pkadd ulong get Nfrm p ulong get Ntg 4 a +end +end +fn ntgrow g ulong y long x0 long x1 long to void +b = mul g 4 +n = ulong sub y get Skgbox add b 1 +n = mul n ulong get Skgbox add b 2 +put Ntg 1 sub long add get Skgoff g n get Skgbox b +base = mul y get Lg 0 +n = ulong sub x1 x0 +for i ulong n +ntglpx add x0 long i base +end +end +fn ntgset g ulong shim ulong voice ulong to void +per = get Skgper g +put Ntg 0 long div mul rem get Ntt 0 per 256 per +put Ntg 2 long shim +put Ntg 3 long voice +put Ntg 4 long get Skgtint g +end +fn ntgal g ulong shim ulong voice ulong to void +b = mul g 4 +if eq get Skgbox add b 2 0 +ret +end +ntgset g shim voice +x0 = pkmax get Skgbox b get Ntd 0 +y0 = pkmax get Skgbox add b 1 get Ntd 1 +x1 = add get Skgbox b get Skgbox add b 2 +x1 = pkmin x1 get Ntd 2 +y1 = add get Skgbox add b 1 get Skgbox add b 3 +y1 = pkmin y1 get Ntd 3 +if or le x1 x0 le y1 y0 +ret +end +for j ulong ulong sub y1 y0 +ntgrow g add y0 long j x0 x1 +end +end +note ntlights: twinkles and galaxy glow over the base inside (x y w h) ∩ clip (ck_night_lights). +fn ntlights x long y long w long h long shim ulong voice ulong to void +if not ntdrect x y w h +ret +end +for i ulong get Sktwn 0 +nttw1 i +end +if and eq shim 0 eq voice 0 +ret +end +for g ulong 6 +ntgal g shim voice +end +end diff --git a/native/omega/allen/look-paint.om b/native/omega/allen/look-paint.om new file mode 100644 index 00000000..1519f8bb --- /dev/null +++ b/native/omega/allen/look-paint.om @@ -0,0 +1,755 @@ +note SPDX-License-Identifier: MIT +note Allen's look, part 1: the drawing kit. Handwritten Omega port of native/kernel/ui/paint.h and +note paint.c (aienux 4b24df65): integer sine, arctangent, exp(-x), log2, hash noise, light-weighted +note colour blending through the sky's transfer tables, and the glow, thread, rounded-rectangle and +note letter shapes. Every function gives the same integers as the C kit; tests/look-paint.om compares +note them value for value against the C harness. Needs font-data.om and font.om before it (afsqrt, +note afglyph) and pkinit once before any other call. +note Shared memory (declared here, used by every look-* module): +note Lg: 0 screen width, 1 height, 2 k (1/256 px per design px of a 1920x1080 design), 3 sky centre x, +note 4 sky centre y, 5..8 the clip rectangle x,y,w,h every shape is held inside (pkclip sets it), +note 9 the rounded rectangle's radius for pksdrrect, 10..15 PAINT scratch (unused so far). +note Nfrm: the frame being drawn, one packed RGB word (R<<16|G<<8|B) per pixel, rows Lg[0] apart. +note Nsky: the sky as it was made at startup, the same layout. +note Slin: ck_sky_lin, sRGB byte -> linear light Q15. Ssrgb: ck_sky_srgb16, light>>3 -> sRGB x16. +note Both are filled by pkinit from Plin/Psrgb, the exact values of sky_data.c. +note Pa: the argument block for calls with more than six values. pkthread reads Pa[0] = width in +note 16ths of a pixel, Pa[1] = a0, Pa[2] = a1 (its sixth value a01 is ignored; pass 0). pkletter's +note face is the font's own state (afinit before use). Ps is PAINT's private scratch. +note Signatures (same integers as the C): pksin/pkcos a (turns/65536) -> Q14; pkatan2 y x -> 0..65535; +note pkexpneg x -> exp(-x/256)*65536; pklog2q16 v -> log2(v)*65536; pkisqrt v; pkhash x y seed; +note pknoise x256 y256 seed; pkfbm x256 y256 seed octaves; pklenc light; pkscale c f; pkadd d c a; +note pkmix d c a; pksmooth t; pkeaseout t; pkprog now from upto; pkclip x y w h; pkglow cx cy r color a +note (16ths); pkthread x0 y0 x1 y1 color a01 (16ths, Pa as above); pksdrrect x y rx ry rw rh (Lg[9]); +note pkcover d16; pkletter pen y c color a plus -> pen after (pen in 1/256 px, plus true = additive). +const LOOKPX ulong 8294400 +global Lg long 16 +global Nfrm uint LOOKPX +global Nsky uint LOOKPX +global Slin ushort 256 +global Ssrgb ushort 4096 +global Pa long 8 +global Psin long 4097 +global Pexp ulong 4096 +global Plog ulong 257 +global Patan ulong 14 +note Ps: 0 glow cx, 1 cy, 2 r2, 3 inv, 4 color, 5 a, 6 x0, 7 x1-1; 8..18 thread x0 y0 x1 y1 color a0 a1 +note len grad radius steep yc, 27 a; 20..26 letter gx gy color a plus x0 x1; 28..31 pkfit x0 y0 x1 y1 +global Ps long 32 +global Pgc ulong 3 +global Pgt ulong 514 +text Plin "0 10 20 30 40 50 60 70 80 90 99 110 120 132 144 157 170 184 198 213 229 246 263 281 299 319 338 359 381 403 425 449 473 498 524 551 578 606 635 665 695 727 759 792 825 860 895 931 969 1006 1045 1085 1125 1167 1209 1252 1296 1341 1386 1433 1481 1529 1578 1629 1680 1732 1785 1839 1894 1950 2007 2065 2123 2183 2244 2306 2368 2432 2496 2562 2629 2696 2765 2834 2905 2977 3049 3123 3198 3273 3350 3428 3507 3587 3668 3750 3833 3917 4002 4089 4176 4264 4354 4444 4536 4629 4723 4818 4914 5011 5109 5209 5309 5411 5514 5618 5723 5829 5936 6045 6155 6265 6377 6490 6605 6720 6837 6954 7073 7193 7315 7437 7561 7686 7812 7939 8068 8197 8328 8460 8593 8728 8864 9001 9139 9278 9419 9561 9704 9848 9994 10141 10289 10438 10589 10741 10894 11048 11204 11361 11519 11679 11839 12001 12165 12329 12495 12663 12831 13001 13172 13344 13518 13693 13870 14047 14226 14407 14588 14771 14956 15141 15328 15517 15706 15897 16090 16284 16479 16675 16873 17072 17273 17474 17678 17882 18088 18296 18504 18715 18926 19139 19353 19569 19786 20005 20225 20446 20669 20893 21118 21345 21574 21803 22035 22267 22501 22737 22974 23212 23452 23693 23936 24180 24425 24672 24921 25171 25422 25675 25929 26185 26442 26701 26961 27223 27486 27750 28016 28284 28553 28823 29095 29369 29644 29920 30198 30478 30759 31041 31325 31611 31898 32186 32476 32768 " +text Psrgb "0 13 26 39 51 64 77 90 103 116 129 142 154 167 180 191 203 214 224 234 244 254 263 272 281 290 298 307 315 323 331 338 346 353 360 367 374 381 388 395 401 408 414 420 427 433 439 445 451 456 462 468 474 479 485 490 495 501 506 511 516 522 527 532 537 542 546 551 556 561 566 570 575 579 584 589 593 598 602 606 611 615 619 624 628 632 636 640 645 649 653 657 661 665 669 673 677 681 684 688 692 696 700 703 707 711 715 718 722 726 729 733 736 740 744 747 751 754 758 761 764 768 771 775 778 781 785 788 791 795 798 801 805 808 811 814 817 821 824 827 830 833 836 839 843 846 849 852 855 858 861 864 867 870 873 876 879 882 885 887 890 893 896 899 902 905 908 910 913 916 919 922 924 927 930 933 936 938 941 944 946 949 952 955 957 960 963 965 968 971 973 976 978 981 984 986 989 991 994 996 999 1002 1004 1007 1009 1012 1014 1017 1019 1022 1024 1027 1029 1032 1034 1036 1039 1041 1044 1046 1049 1051 1053 1056 1058 1061 1063 1065 1068 1070 1072 1075 1077 1079 1082 1084 1086 1089 1091 1093 1096 1098 1100 1102 1105 1107 1109 1111 1114 1116 1118 1120 1123 1125 1127 1129 1132 1134 1136 1138 1140 1143 1145 1147 1149 1151 1153 1156 1158 1160 1162 1164 1166 1168 1170 1173 1175 1177 1179 1181 1183 1185 1187 1189 1191 1194 1196 1198 1200 1202 1204 1206 1208 1210 1212 1214 1216 1218 1220 1222 1224 1226 1228 1230 1232 1234 1236 1238 1240 1242 1244 1246 1248 1250 1252 1254 1256 1258 1260 1262 1264 1266 1268 1269 1271 1273 1275 1277 1279 1281 1283 1285 1287 1289 1290 1292 1294 1296 1298 1300 1302 1304 1305 1307 1309 1311 1313 1315 1317 1318 1320 1322 1324 1326 1328 1329 1331 1333 1335 1337 1339 1340 1342 1344 1346 1348 1349 1351 1353 1355 1356 1358 1360 1362 1364 1365 1367 1369 1371 1372 1374 1376 1378 1379 1381 1383 1385 1386 1388 1390 1392 1393 1395 1397 1398 1400 1402 1404 1405 1407 1409 1410 1412 1414 1415 1417 1419 1420 1422 1424 1426 1427 1429 1431 1432 1434 1436 1437 1439 1441 1442 1444 1445 1447 1449 1450 1452 1454 1455 1457 1459 1460 1462 1463 1465 1467 1468 1470 1472 1473 1475 1476 1478 1480 1481 1483 1484 1486 1488 1489 1491 1492 1494 1496 1497 1499 1500 1502 1503 1505 1507 1508 1510 1511 1513 1514 1516 1517 1519 1521 1522 1524 1525 1527 1528 1530 1531 1533 1534 1536 1538 1539 1541 1542 1544 1545 1547 1548 1550 1551 1553 1554 1556 1557 1559 1560 1562 1563 1565 1566 1568 1569 1571 1572 1574 1575 1577 1578 1580 1581 1583 1584 1586 1587 1589 1590 1591 1593 1594 1596 1597 1599 1600 1602 1603 1605 1606 1607 1609 1610 1612 1613 1615 1616 1618 1619 1620 1622 1623 1625 1626 1628 1629 1630 1632 1633 1635 1636 1638 1639 1640 1642 1643 1645 1646 1647 1649 1650 1652 1653 1654 1656 1657 1659 1660 1661 1663 1664 1666 1667 1668 1670 1671 1672 1674 1675 1677 1678 1679 1681 1682 1683 1685 1686 1688 1689 1690 1692 1693 1694 1696 1697 1698 1700 1701 1702 1704 1705 1707 1708 1709 1711 1712 1713 1715 1716 1717 1719 1720 1721 1723 1724 1725 1727 1728 1729 1731 1732 1733 1734 1736 1737 1738 1740 1741 1742 1744 1745 1746 1748 1749 1750 1752 1753 1754 1755 1757 1758 1759 1761 1762 1763 1765 1766 1767 1768 1770 1771 1772 1774 1775 1776 1777 1779 1780 1781 1782 1784 1785 1786 1788 1789 1790 1791 1793 1794 1795 1796 1798 1799 1800 1801 1803 1804 1805 1806 1808 1809 1810 1811 1813 1814 1815 1816 1818 1819 1820 1821 1823 1824 1825 1826 1828 1829 1830 1831 1833 1834 1835 1836 1837 1839 1840 1841 1842 1844 1845 1846 1847 1848 1850 1851 1852 1853 1855 1856 1857 1858 1859 1861 1862 1863 1864 1865 1867 1868 1869 1870 1871 1873 1874 1875 1876 1877 1879 1880 1881 1882 1883 1885 1886 1887 1888 1889 1891 1892 1893 1894 1895 1896 1898 1899 1900 1901 1902 1904 1905 1906 1907 1908 1909 1911 1912 1913 1914 1915 1916 1918 1919 1920 1921 1922 1923 1924 1926 1927 1928 1929 1930 1931 1933 1934 1935 1936 1937 1938 1939 1941 1942 1943 1944 1945 1946 1947 1949 1950 1951 1952 1953 1954 1955 1957 1958 1959 1960 1961 1962 1963 1965 1966 1967 1968 1969 1970 1971 1972 1974 1975 1976 1977 1978 1979 1980 1981 1982 1984 1985 1986 1987 1988 1989 1990 1991 1992 1994 1995 1996 1997 1998 1999 2000 2001 2002 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2358 2359 2360 2361 2362 2363 2364 2365 2366 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2375 2376 2377 2378 2379 2380 2381 2382 2382 2383 2384 2385 2386 2387 2388 2389 2390 2390 2391 2392 2393 2394 2395 2396 2397 2397 2398 2399 2400 2401 2402 2403 2404 2404 2405 2406 2407 2408 2409 2410 2411 2411 2412 2413 2414 2415 2416 2417 2417 2418 2419 2420 2421 2422 2423 2424 2424 2425 2426 2427 2428 2429 2430 2430 2431 2432 2433 2434 2435 2436 2436 2437 2438 2439 2440 2441 2442 2442 2443 2444 2445 2446 2447 2448 2448 2449 2450 2451 2452 2453 2454 2454 2455 2456 2457 2458 2459 2460 2460 2461 2462 2463 2464 2465 2465 2466 2467 2468 2469 2470 2471 2471 2472 2473 2474 2475 2476 2476 2477 2478 2479 2480 2481 2481 2482 2483 2484 2485 2486 2486 2487 2488 2489 2490 2491 2492 2492 2493 2494 2495 2496 2497 2497 2498 2499 2500 2501 2501 2502 2503 2504 2505 2506 2506 2507 2508 2509 2510 2511 2511 2512 2513 2514 2515 2516 2516 2517 2518 2519 2520 2520 2521 2522 2523 2524 2525 2525 2526 2527 2528 2529 2530 2530 2531 2532 2533 2534 2534 2535 2536 2537 2538 2539 2539 2540 2541 2542 2543 2543 2544 2545 2546 2547 2547 2548 2549 2550 2551 2551 2552 2553 2554 2555 2556 2556 2557 2558 2559 2560 2560 2561 2562 2563 2564 2564 2565 2566 2567 2568 2568 2569 2570 2571 2572 2572 2573 2574 2575 2576 2576 2577 2578 2579 2580 2580 2581 2582 2583 2584 2584 2585 2586 2587 2588 2588 2589 2590 2591 2592 2592 2593 2594 2595 2596 2596 2597 2598 2599 2599 2600 2601 2602 2603 2603 2604 2605 2606 2607 2607 2608 2609 2610 2611 2611 2612 2613 2614 2614 2615 2616 2617 2618 2618 2619 2620 2621 2621 2622 2623 2624 2625 2625 2626 2627 2628 2629 2629 2630 2631 2632 2632 2633 2634 2635 2636 2636 2637 2638 2639 2639 2640 2641 2642 2642 2643 2644 2645 2646 2646 2647 2648 2649 2649 2650 2651 2652 2653 2653 2654 2655 2656 2656 2657 2658 2659 2659 2660 2661 2662 2662 2663 2664 2665 2666 2666 2667 2668 2669 2669 2670 2671 2672 2672 2673 2674 2675 2675 2676 2677 2678 2679 2679 2680 2681 2682 2682 2683 2684 2685 2685 2686 2687 2688 2688 2689 2690 2691 2691 2692 2693 2694 2694 2695 2696 2697 2697 2698 2699 2700 2700 2701 2702 2703 2703 2704 2705 2706 2706 2707 2708 2709 2709 2710 2711 2712 2712 2713 2714 2715 2715 2716 2717 2718 2718 2719 2720 2721 2721 2722 2723 2724 2724 2725 2726 2727 2727 2728 2729 2730 2730 2731 2732 2733 2733 2734 2735 2736 2736 2737 2738 2738 2739 2740 2741 2741 2742 2743 2744 2744 2745 2746 2747 2747 2748 2749 2750 2750 2751 2752 2752 2753 2754 2755 2755 2756 2757 2758 2758 2759 2760 2761 2761 2762 2763 2763 2764 2765 2766 2766 2767 2768 2769 2769 2770 2771 2771 2772 2773 2774 2774 2775 2776 2777 2777 2778 2779 2779 2780 2781 2782 2782 2783 2784 2785 2785 2786 2787 2787 2788 2789 2790 2790 2791 2792 2792 2793 2794 2795 2795 2796 2797 2797 2798 2799 2800 2800 2801 2802 2803 2803 2804 2805 2805 2806 2807 2808 2808 2809 2810 2810 2811 2812 2813 2813 2814 2815 2815 2816 2817 2818 2818 2819 2820 2820 2821 2822 2823 2823 2824 2825 2825 2826 2827 2827 2828 2829 2830 2830 2831 2832 2832 2833 2834 2835 2835 2836 2837 2837 2838 2839 2839 2840 2841 2842 2842 2843 2844 2844 2845 2846 2847 2847 2848 2849 2849 2850 2851 2851 2852 2853 2854 2854 2855 2856 2856 2857 2858 2858 2859 2860 2861 2861 2862 2863 2863 2864 2865 2865 2866 2867 2868 2868 2869 2870 2870 2871 2872 2872 2873 2874 2874 2875 2876 2877 2877 2878 2879 2879 2880 2881 2881 2882 2883 2883 2884 2885 2886 2886 2887 2888 2888 2889 2890 2890 2891 2892 2892 2893 2894 2894 2895 2896 2897 2897 2898 2899 2899 2900 2901 2901 2902 2903 2903 2904 2905 2905 2906 2907 2908 2908 2909 2910 2910 2911 2912 2912 2913 2914 2914 2915 2916 2916 2917 2918 2918 2919 2920 2920 2921 2922 2922 2923 2924 2925 2925 2926 2927 2927 2928 2929 2929 2930 2931 2931 2932 2933 2933 2934 2935 2935 2936 2937 2937 2938 2939 2939 2940 2941 2941 2942 2943 2943 2944 2945 2945 2946 2947 2947 2948 2949 2949 2950 2951 2952 2952 2953 2954 2954 2955 2956 2956 2957 2958 2958 2959 2960 2960 2961 2962 2962 2963 2964 2964 2965 2966 2966 2967 2968 2968 2969 2970 2970 2971 2972 2972 2973 2974 2974 2975 2976 2976 2977 2978 2978 2979 2979 2980 2981 2981 2982 2983 2983 2984 2985 2985 2986 2987 2987 2988 2989 2989 2990 2991 2991 2992 2993 2993 2994 2995 2995 2996 2997 2997 2998 2999 2999 3000 3001 3001 3002 3003 3003 3004 3005 3005 3006 3006 3007 3008 3008 3009 3010 3010 3011 3012 3012 3013 3014 3014 3015 3016 3016 3017 3018 3018 3019 3020 3020 3021 3021 3022 3023 3023 3024 3025 3025 3026 3027 3027 3028 3029 3029 3030 3031 3031 3032 3033 3033 3034 3034 3035 3036 3036 3037 3038 3038 3039 3040 3040 3041 3042 3042 3043 3043 3044 3045 3045 3046 3047 3047 3048 3049 3049 3050 3051 3051 3052 3052 3053 3054 3054 3055 3056 3056 3057 3058 3058 3059 3060 3060 3061 3061 3062 3063 3063 3064 3065 3065 3066 3067 3067 3068 3068 3069 3070 3070 3071 3072 3072 3073 3074 3074 3075 3075 3076 3077 3077 3078 3079 3079 3080 3081 3081 3082 3082 3083 3084 3084 3085 3086 3086 3087 3088 3088 3089 3089 3090 3091 3091 3092 3093 3093 3094 3094 3095 3096 3096 3097 3098 3098 3099 3099 3100 3101 3101 3102 3103 3103 3104 3105 3105 3106 3106 3107 3108 3108 3109 3110 3110 3111 3111 3112 3113 3113 3114 3115 3115 3116 3116 3117 3118 3118 3119 3120 3120 3121 3121 3122 3123 3123 3124 3125 3125 3126 3126 3127 3128 3128 3129 3129 3130 3131 3131 3132 3133 3133 3134 3134 3135 3136 3136 3137 3138 3138 3139 3139 3140 3141 3141 3142 3143 3143 3144 3144 3145 3146 3146 3147 3147 3148 3149 3149 3150 3151 3151 3152 3152 3153 3154 3154 3155 3155 3156 3157 3157 3158 3159 3159 3160 3160 3161 3162 3162 3163 3163 3164 3165 3165 3166 3166 3167 3168 3168 3169 3170 3170 3171 3171 3172 3173 3173 3174 3174 3175 3176 3176 3177 3177 3178 3179 3179 3180 3181 3181 3182 3182 3183 3184 3184 3185 3185 3186 3187 3187 3188 3188 3189 3190 3190 3191 3191 3192 3193 3193 3194 3194 3195 3196 3196 3197 3197 3198 3199 3199 3200 3200 3201 3202 3202 3203 3204 3204 3205 3205 3206 3207 3207 3208 3208 3209 3210 3210 3211 3211 3212 3213 3213 3214 3214 3215 3216 3216 3217 3217 3218 3219 3219 3220 3220 3221 3222 3222 3223 3223 3224 3224 3225 3226 3226 3227 3227 3228 3229 3229 3230 3230 3231 3232 3232 3233 3233 3234 3235 3235 3236 3236 3237 3238 3238 3239 3239 3240 3241 3241 3242 3242 3243 3244 3244 3245 3245 3246 3246 3247 3248 3248 3249 3249 3250 3251 3251 3252 3252 3253 3254 3254 3255 3255 3256 3257 3257 3258 3258 3259 3259 3260 3261 3261 3262 3262 3263 3264 3264 3265 3265 3266 3267 3267 3268 3268 3269 3269 3270 3271 3271 3272 3272 3273 3274 3274 3275 3275 3276 3277 3277 3278 3278 3279 3279 3280 3281 3281 3282 3282 3283 3284 3284 3285 3285 3286 3286 3287 3288 3288 3289 3289 3290 3291 3291 3292 3292 3293 3293 3294 3295 3295 3296 3296 3297 3297 3298 3299 3299 3300 3300 3301 3302 3302 3303 3303 3304 3304 3305 3306 3306 3307 3307 3308 3308 3309 3310 3310 3311 3311 3312 3313 3313 3314 3314 3315 3315 3316 3317 3317 3318 3318 3319 3319 3320 3321 3321 3322 3322 3323 3323 3324 3325 3325 3326 3326 3327 3327 3328 3329 3329 3330 3330 3331 3331 3332 3333 3333 3334 3334 3335 3335 3336 3337 3337 3338 3338 3339 3339 3340 3341 3341 3342 3342 3343 3343 3344 3345 3345 3346 3346 3347 3347 3348 3349 3349 3350 3350 3351 3351 3352 3353 3353 3354 3354 3355 3355 3356 3357 3357 3358 3358 3359 3359 3360 3360 3361 3362 3362 3363 3363 3364 3364 3365 3366 3366 3367 3367 3368 3368 3369 3370 3370 3371 3371 3372 3372 3373 3373 3374 3375 3375 3376 3376 3377 3377 3378 3379 3379 3380 3380 3381 3381 3382 3382 3383 3384 3384 3385 3385 3386 3386 3387 3387 3388 3389 3389 3390 3390 3391 3391 3392 3393 3393 3394 3394 3395 3395 3396 3396 3397 3398 3398 3399 3399 3400 3400 3401 3401 3402 3403 3403 3404 3404 3405 3405 3406 3406 3407 3408 3408 3409 3409 3410 3410 3411 3411 3412 3413 3413 3414 3414 3415 3415 3416 3416 3417 3418 3418 3419 3419 3420 3420 3421 3421 3422 3423 3423 3424 3424 3425 3425 3426 3426 3427 3428 3428 3429 3429 3430 3430 3431 3431 3432 3432 3433 3434 3434 3435 3435 3436 3436 3437 3437 3438 3439 3439 3440 3440 3441 3441 3442 3442 3443 3443 3444 3445 3445 3446 3446 3447 3447 3448 3448 3449 3449 3450 3451 3451 3452 3452 3453 3453 3454 3454 3455 3455 3456 3457 3457 3458 3458 3459 3459 3460 3460 3461 3461 3462 3463 3463 3464 3464 3465 3465 3466 3466 3467 3467 3468 3469 3469 3470 3470 3471 3471 3472 3472 3473 3473 3474 3474 3475 3476 3476 3477 3477 3478 3478 3479 3479 3480 3480 3481 3482 3482 3483 3483 3484 3484 3485 3485 3486 3486 3487 3487 3488 3489 3489 3490 3490 3491 3491 3492 3492 3493 3493 3494 3494 3495 3496 3496 3497 3497 3498 3498 3499 3499 3500 3500 3501 3501 3502 3503 3503 3504 3504 3505 3505 3506 3506 3507 3507 3508 3508 3509 3509 3510 3511 3511 3512 3512 3513 3513 3514 3514 3515 3515 3516 3516 3517 3517 3518 3519 3519 3520 3520 3521 3521 3522 3522 3523 3523 3524 3524 3525 3525 3526 3527 3527 3528 3528 3529 3529 3530 3530 3531 3531 3532 3532 3533 3533 3534 3534 3535 3536 3536 3537 3537 3538 3538 3539 3539 3540 3540 3541 3541 3542 3542 3543 3543 3544 3545 3545 3546 3546 3547 3547 3548 3548 3549 3549 3550 3550 3551 3551 3552 3552 3553 3553 3554 3555 3555 3556 3556 3557 3557 3558 3558 3559 3559 3560 3560 3561 3561 3562 3562 3563 3563 3564 3564 3565 3566 3566 3567 3567 3568 3568 3569 3569 3570 3570 3571 3571 3572 3572 3573 3573 3574 3574 3575 3575 3576 3576 3577 3578 3578 3579 3579 3580 3580 3581 3581 3582 3582 3583 3583 3584 3584 3585 3585 3586 3586 3587 3587 3588 3588 3589 3589 3590 3591 3591 3592 3592 3593 3593 3594 3594 3595 3595 3596 3596 3597 3597 3598 3598 3599 3599 3600 3600 3601 3601 3602 3602 3603 3603 3604 3604 3605 3606 3606 3607 3607 3608 3608 3609 3609 3610 3610 3611 3611 3612 3612 3613 3613 3614 3614 3615 3615 3616 3616 3617 3617 3618 3618 3619 3619 3620 3620 3621 3621 3622 3622 3623 3624 3624 3625 3625 3626 3626 3627 3627 3628 3628 3629 3629 3630 3630 3631 3631 3632 3632 3633 3633 3634 3634 3635 3635 3636 3636 3637 3637 3638 3638 3639 3639 3640 3640 3641 3641 3642 3642 3643 3643 3644 3644 3645 3645 3646 3646 3647 3647 3648 3649 3649 3650 3650 3651 3651 3652 3652 3653 3653 3654 3654 3655 3655 3656 3656 3657 3657 3658 3658 3659 3659 3660 3660 3661 3661 3662 3662 3663 3663 3664 3664 3665 3665 3666 3666 3667 3667 3668 3668 3669 3669 3670 3670 3671 3671 3672 3672 3673 3673 3674 3674 3675 3675 3676 3676 3677 3677 3678 3678 3679 3679 3680 3680 3681 3681 3682 3682 3683 3683 3684 3684 3685 3685 3686 3686 3687 3687 3688 3688 3689 3689 3690 3690 3691 3691 3692 3692 3693 3693 3694 3694 3695 3695 3696 3696 3697 3697 3698 3698 3699 3699 3700 3700 3701 3701 3702 3702 3703 3703 3704 3704 3705 3705 3706 3706 3707 3707 3708 3708 3709 3709 3710 3710 3711 3711 3712 3712 3713 3713 3714 3714 3715 3715 3716 3716 3717 3717 3718 3718 3719 3719 3720 3720 3721 3721 3722 3722 3723 3723 3724 3724 3725 3725 3726 3726 3727 3727 3728 3728 3729 3729 3730 3730 3731 3731 3732 3732 3733 3733 3734 3734 3735 3735 3735 3736 3736 3737 3737 3738 3738 3739 3739 3740 3740 3741 3741 3742 3742 3743 3743 3744 3744 3745 3745 3746 3746 3747 3747 3748 3748 3749 3749 3750 3750 3751 3751 3752 3752 3753 3753 3754 3754 3755 3755 3756 3756 3757 3757 3758 3758 3759 3759 3760 3760 3760 3761 3761 3762 3762 3763 3763 3764 3764 3765 3765 3766 3766 3767 3767 3768 3768 3769 3769 3770 3770 3771 3771 3772 3772 3773 3773 3774 3774 3775 3775 3776 3776 3777 3777 3778 3778 3778 3779 3779 3780 3780 3781 3781 3782 3782 3783 3783 3784 3784 3785 3785 3786 3786 3787 3787 3788 3788 3789 3789 3790 3790 3791 3791 3792 3792 3793 3793 3793 3794 3794 3795 3795 3796 3796 3797 3797 3798 3798 3799 3799 3800 3800 3801 3801 3802 3802 3803 3803 3804 3804 3805 3805 3806 3806 3806 3807 3807 3808 3808 3809 3809 3810 3810 3811 3811 3812 3812 3813 3813 3814 3814 3815 3815 3816 3816 3817 3817 3817 3818 3818 3819 3819 3820 3820 3821 3821 3822 3822 3823 3823 3824 3824 3825 3825 3826 3826 3827 3827 3828 3828 3828 3829 3829 3830 3830 3831 3831 3832 3832 3833 3833 3834 3834 3835 3835 3836 3836 3837 3837 3838 3838 3838 3839 3839 3840 3840 3841 3841 3842 3842 3843 3843 3844 3844 3845 3845 3846 3846 3847 3847 3847 3848 3848 3849 3849 3850 3850 3851 3851 3852 3852 3853 3853 3854 3854 3855 3855 3856 3856 3856 3857 3857 3858 3858 3859 3859 3860 3860 3861 3861 3862 3862 3863 3863 3864 3864 3864 3865 3865 3866 3866 3867 3867 3868 3868 3869 3869 3870 3870 3871 3871 3872 3872 3872 3873 3873 3874 3874 3875 3875 3876 3876 3877 3877 3878 3878 3879 3879 3879 3880 3880 3881 3881 3882 3882 3883 3883 3884 3884 3885 3885 3886 3886 3886 3887 3887 3888 3888 3889 3889 3890 3890 3891 3891 3892 3892 3893 3893 3893 3894 3894 3895 3895 3896 3896 3897 3897 3898 3898 3899 3899 3900 3900 3900 3901 3901 3902 3902 3903 3903 3904 3904 3905 3905 3906 3906 3907 3907 3907 3908 3908 3909 3909 3910 3910 3911 3911 3912 3912 3913 3913 3913 3914 3914 3915 3915 3916 3916 3917 3917 3918 3918 3919 3919 3919 3920 3920 3921 3921 3922 3922 3923 3923 3924 3924 3925 3925 3925 3926 3926 3927 3927 3928 3928 3929 3929 3930 3930 3931 3931 3931 3932 3932 3933 3933 3934 3934 3935 3935 3936 3936 3937 3937 3937 3938 3938 3939 3939 3940 3940 3941 3941 3942 3942 3942 3943 3943 3944 3944 3945 3945 3946 3946 3947 3947 3948 3948 3948 3949 3949 3950 3950 3951 3951 3952 3952 3953 3953 3953 3954 3954 3955 3955 3956 3956 3957 3957 3958 3958 3958 3959 3959 3960 3960 3961 3961 3962 3962 3963 3963 3963 3964 3964 3965 3965 3966 3966 3967 3967 3968 3968 3968 3969 3969 3970 3970 3971 3971 3972 3972 3973 3973 3973 3974 3974 3975 3975 3976 3976 3977 3977 3978 3978 3978 3979 3979 3980 3980 3981 3981 3982 3982 3983 3983 3983 3984 3984 3985 3985 3986 3986 3987 3987 3988 3988 3988 3989 3989 3990 3990 3991 3991 3992 3992 3992 3993 3993 3994 3994 3995 3995 3996 3996 3997 3997 3997 3998 3998 3999 3999 4000 4000 4001 4001 4001 4002 4002 4003 4003 4004 4004 4005 4005 4006 4006 4006 4007 4007 4008 4008 4009 4009 4010 4010 4010 4011 4011 4012 4012 4013 4013 4014 4014 4014 4015 4015 4016 4016 4017 4017 4018 4018 4019 4019 4019 4020 4020 4021 4021 4022 4022 4023 4023 4023 4024 4024 4025 4025 4026 4026 4027 4027 4027 4028 4028 4029 4029 4030 4030 4031 4031 4031 4032 4032 4033 4033 4034 4034 4035 4035 4035 4036 4036 4037 4037 4038 4038 4039 4039 4039 4040 4040 4041 4041 4042 4042 4043 4043 4043 4044 4044 4045 4045 4046 4046 4047 4047 4047 4048 4048 4049 4049 4050 4050 4051 4051 4051 4052 4052 4053 4053 4054 4054 4054 4055 4055 4056 4056 4057 4057 4058 4058 4058 4059 4059 4060 4060 4061 4061 4062 4062 4062 4063 4063 4064 4064 4065 4065 4066 4066 4066 4067 4067 4068 4068 4069 4069 4069 4070 4070 4071 4071 4072 4072 4073 4073 4073 4074 4074 4075 4075 4076 4076 4076 4077 4077 4078 4078 4079 4079 4080 4080 " +fn pkmin a long b long to long +if lt a b +ret a +end +ret b +end +fn pkmax a long b long to long +if gt a b +ret a +end +ret b +end +fn pkabs a long to long +if lt a 0 +ret neg a +end +ret a +end +fn pkclamp v long lo long hi long to long +if lt v lo +ret lo +end +if gt v hi +ret hi +end +ret v +end +fn pkinitsin to void +note sine: a rotation by a 4096th of a turn, applied over and over (Q30) +c = long 1073741824 +s = long 0 +for k ulong 1025 +v = shr add s 32768 16 +if eq k 1024 +v = 16384 +end +put Psin k v +put Psin sub 2048 k v +put Psin and add 2048 k 4095 neg v +put Psin and sub 4096 k 4095 neg v +nc = shr sub mul c 1073740561 mul s 1647099 30 +ns = shr add mul s 1073740561 mul c 1647099 30 +c = nc +s = ns +end +put Psin 4096 get Psin 0 +end +fn pkinitexp to void +note exp(-k/256): one factor of exp(-1/256) (Q30) per step +e = ulong 1073741824 +for k ulong 4096 +put Pexp k shr add e 8192 14 +e = shr mul e 1069555701 30 +end +end +fn pkinitlog to void +note log2(1 + k/256): square the value 16 times, taking a bit each time it passes 2 +for k ulong 257 +if eq k 256 +put Plog k 65536 +else +y = shl add ulong 256 k 8 +r = ulong 0 +for i ulong 16 +b = sub ulong 15 i +y = shr mul y y 16 +if ge y 131072 +y = shr y 1 +r = or r shl ulong 1 b +end +end +put Plog k r +end +end +end +fn pkinitatan to void +put Patan 0 8192 +put Patan 1 4836 +put Patan 2 2555 +put Patan 3 1297 +put Patan 4 651 +put Patan 5 326 +put Patan 6 163 +put Patan 7 81 +put Patan 8 41 +put Patan 9 20 +put Patan 10 10 +put Patan 11 5 +put Patan 12 3 +put Patan 13 1 +end +fn pkinitlin to void +v = ulong 0 +slot = ulong 0 +for i ulong len Plin +c = get Plin i +if eq c 32 +put Slin slot ushort v +slot = add slot 1 +v = 0 +else +v = add mul v 10 sub ulong c 48 +end +end +end +fn pkinitsrgb to void +v = ulong 0 +slot = ulong 0 +for i ulong len Psrgb +c = get Psrgb i +if eq c 32 +put Ssrgb slot ushort v +slot = add slot 1 +v = 0 +else +v = add mul v 10 sub ulong c 48 +end +end +end +fn pkinit to void +for i ulong 3 +put Pgc i 0 +end +for i ulong 514 +put Pgt i 0 +end +pkinitsin +pkinitexp +pkinitlog +pkinitatan +pkinitlin +pkinitsrgb +end +fn pksin a ulong to long +a = and a 65535 +i = shr a 4 +f = long and a 15 +s0 = get Psin i +ret add s0 shr mul sub get Psin add i 1 s0 f 4 +end +fn pkcos a ulong to long +ret pksin add a 16384 +end +fn pkatan2 y long x long to ulong +if and eq x 0 eq y 0 +ret 0 +end +xx = x +yy = y +ang = ulong 0 +if lt xx 0 +xx = neg xx +yy = neg yy +ang = 32768 +end +m = pkmax xx pkabs yy +while lt m 1048576 +xx = mul xx 2 +yy = mul yy 2 +m = mul m 2 +end +while ge m 4194304 +xx = shr xx 1 +yy = shr yy 1 +m = shr m 1 +end +z = long 0 +for i ulong 14 +st = long get Patan i +nx = xx +if gt yy 0 +nx = add xx shr yy i +yy = sub yy shr xx i +z = add z st +else +nx = sub xx shr yy i +yy = add yy shr xx i +z = sub z st +end +xx = nx +end +ret and add ang bitcast ulong z 65535 +end +fn pkexpneg x ulong to ulong +if lt x 4096 +ret get Pexp x +end +ret 0 +end +fn pklog2q16 v ulong to ulong +if eq v 0 +ret 0 +end +n = ulong 0 +t = v +while ge t 2 bound 64 +t = shr t 1 +n = add n 1 +end +m = v +if ge n 16 +m = shr v sub n 16 +else +m = shl v sub 16 n +end +k = and shr m 8 255 +f = and m 255 +lk = get Plog k +ret add add mul n 65536 lk shr mul sub get Plog add k 1 lk f 8 +end +fn pkisqrt v ulong to ulong +ret afsqrt v +end +fn pkbits32 v long to ulong +ret and bitcast ulong v 4294967295 +end +fn pkhash x long y long seed ulong to ulong +m = ulong 4294967295 +a = and mul pkbits32 x 2376512323 m +b = and mul pkbits32 y 3625334849 m +c = and mul and seed m 3407524639 m +h = xor xor a b c +h = xor h shr h 13 +h = and mul h 1540483477 m +h = xor h shr h 15 +h = and mul h 668265261 m +h = xor h shr h 16 +ret h +end +fn pksmooth t long to ulong +t = pkclamp t 0 256 +ret ulong shr mul mul t t sub 768 mul 2 t 16 +end +fn pkeaseout t long to ulong +u = sub 256 pkclamp t 0 256 +ret sub ulong 256 ulong shr mul mul u u u 16 +end +fn pkprog now ulong from ulong upto ulong to long +if le now from +ret 0 +end +if ge now upto +ret 256 +end +ret long div mul sub now from 256 sub upto from +end +fn pknrow ix long iy long seed ulong fx ulong to ulong +a = mul shr pkhash ix iy seed 16 sub 256 fx +ret add a mul shr pkhash add ix 1 iy seed 16 fx +end +fn pknoise x long y long seed ulong to ulong +fx = pksmooth long and pkbits32 x 255 +fy = pksmooth long and pkbits32 y 255 +ix = shr x 8 +iy = shr y 8 +a = pknrow ix iy seed fx +b = pknrow ix add iy 1 seed fx +ret shr add mul a sub 256 fy mul b fy 16 +end +fn pkfbm x long y long seed ulong octaves ulong to ulong +sum = ulong 0 +total = ulong 0 +for o ulong octaves +w = shl ulong 1 sub sub octaves 1 o +sd = and add seed mul o 7919 4294967295 +sum = add sum mul pknoise shl x o shl y o sd w +total = add total w +end +ret div sum total +end +fn pklenc light ulong to ulong +i = shr light 3 +if ge light 32767 +i = 4095 +end +ret shr add ulong get Ssrgb i 8 4 +end +fn pkscale c ulong f ulong to ulong +if eq f 0 +ret 0 +end +if ge f 256 +ret c +end +out = ulong 0 +s = ulong 16 +for k ulong 3 +x = and shr c s 255 +x = pklenc shr mul ulong get Slin x f 8 +out = or out shl x s +s = sub s 8 +end +ret out +end +fn pkadd d ulong c ulong a ulong to ulong +if or eq a 0 eq c 0 +ret d +end +if and eq d 0 eq a 256 +ret c +end +out = ulong 0 +s = ulong 16 +for k ulong 3 +x = and shr d s 255 +y = and shr c s 255 +v = shr mul ulong get Slin y a 8 +if ne v 0 +v = add ulong get Slin x v +i = shr v 3 +if ge v 32767 +i = 4095 +end +x = shr add ulong get Ssrgb i 8 4 +end +out = or out shl x s +s = sub s 8 +end +ret out +end +fn pkmix d ulong c ulong a ulong to ulong +if or eq a 0 eq d c +ret d +end +if ge a 256 +ret c +end +out = ulong 0 +s = ulong 16 +for k ulong 3 +x = and shr d s 255 +y = and shr c s 255 +if ne x y +v = mul ulong get Slin x sub 256 a +v = shr add v mul ulong get Slin y a 8 +i = shr v 3 +if ge v 32767 +i = 4095 +end +x = shr add ulong get Ssrgb i 8 4 +end +out = or out shl x s +s = sub s 8 +end +ret out +end +fn pkcover d16 long to ulong +v = sub 8 d16 +if le v 0 +ret 0 +end +if ge v 16 +ret 256 +end +ret ulong mul v 16 +end +fn pkclip x long y long w long h long to void +x0 = pkmax x 0 +y0 = pkmax y 0 +x1 = pkmin add x w get Lg 0 +y1 = pkmin add y h get Lg 1 +put Lg 5 x0 +put Lg 6 y0 +put Lg 7 pkmax sub x1 x0 0 +put Lg 8 pkmax sub y1 y0 0 +end +fn pkfit x long y long w long h long to bool +note Ps[28..31] = the part of (x,y,w,h) inside the clip and the screen, as x0 y0 x1 y1; false when empty +x0 = pkmax x pkmax get Lg 5 0 +y0 = pkmax y pkmax get Lg 6 0 +x1 = add get Lg 5 get Lg 7 +x1 = pkmin x1 get Lg 0 +x1 = pkmin add x w x1 +y1 = add get Lg 6 get Lg 8 +y1 = pkmin y1 get Lg 1 +y1 = pkmin add y h y1 +put Ps 28 x0 +put Ps 29 y0 +put Ps 30 x1 +put Ps 31 y1 +if or le x1 x0 le y1 y0 +ret false +end +ret true +end +fn pkmeets x long y long w long h long to bool +x0 = pkmax x get Lg 5 +y0 = pkmax y get Lg 6 +x1 = pkmin add x w add get Lg 5 get Lg 7 +y1 = pkmin add y h add get Lg 6 get Lg 8 +if or le x1 x0 le y1 y0 +ret false +end +ret true +end +fn pkplot x long y long color ulong a ulong to void +if eq a 0 +ret +end +lx = get Lg 5 +ly = get Lg 6 +if or lt x lx lt y ly +ret +end +if ge x add lx get Lg 7 +ret +end +if ge y add ly get Lg 8 +ret +end +if or lt x 0 lt y 0 +ret +end +if ge x get Lg 0 +ret +end +if ge y get Lg 1 +ret +end +i = ulong add mul y get Lg 0 x +put Nfrm i uint pkadd ulong get Nfrm i color a +end +fn pkblend i ulong color ulong w ulong to void +note frame pixel i gets color's light times w/256 added (no clip test: callers fit first) +put Nfrm i uint pkadd ulong get Nfrm i color w +end +fn pkglowrow xa long xb long to void +note Ps: 0 cx, 2 r2, 3 inv, 4 color, 5 a, 10 y * width, 11 dy*dy +for i ulong ulong add sub xb xa 1 +x = add xa long i +dx = add mul x 16 8 +dx = sub dx get Ps 0 +dx = add mul dx dx get Ps 11 +if lt dx get Ps 2 +f = shr mul dx get Ps 3 32 +f = sub 256 f +f = shr mul shr mul f f 8 f 8 +f = shr mul f get Ps 5 8 +x = add get Ps 10 x +if eq get Nfrm x 0 +f = add f long get Pgc 2 +put Nfrm x uint get Pgt ulong f +else +dx = get Ps 4 +pkblend ulong x ulong dx ulong f +end +end +end +end +note pkglowtab: the glow's colour over one black for every weight, kept for the last two +note colours (two alternate at the merger): most of the sky is one black, so the row's add +note becomes a table read; the bytes are pkadd's. Pgc: colour of table 0, of table 1, current. +fn pkglowtab color ulong to void +if eq get Pgc 0 color +put Pgc 2 0 +ret +end +if eq get Pgc 1 color +put Pgc 2 257 +ret +end +k = ulong 257 +if eq get Pgc 2 257 +k = 0 +end +put Pgc 2 k +put Pgc div k 257 color +for i ulong 257 +put Pgt add k i pkadd 0 color i +end +end +fn pkglowy y long to void +dy = add mul y 16 8 +dy = sub dy get Ps 1 +dy = mul dy dy +if lt dy get Ps 2 +put Ps 11 dy +put Ps 10 mul y get Lg 0 +dy = sub get Ps 2 dy +half = long pkisqrt ulong dy +xa = sub get Ps 0 half +xa = pkmax get Ps 6 shr xa 4 +xb = add get Ps 0 half +xb = pkmin get Ps 7 shr xb 4 +if le xa xb +pkglowrow xa xb +end +end +end +fn pkglow cx long cy long r long color ulong a ulong to void +if or le r 0 eq a 0 +ret +end +x0 = shr sub cx r 4 +y0 = shr sub cy r 4 +if not pkfit x0 y0 add sub shr add cx r 4 x0 1 add sub shr add cy r 4 y0 1 +ret +end +put Ps 0 cx +put Ps 1 cy +put Ps 2 mul r r +put Ps 3 div 1099511627776 mul r r +put Ps 4 long color +put Ps 5 long a +put Ps 6 get Ps 28 +put Ps 7 sub get Ps 30 1 +pkglowtab color +y0 = get Ps 29 +for j ulong ulong sub get Ps 31 y0 +pkglowy add y0 long j +end +end +fn pkthreadpx xc long yy long to void +note Ps: 12 color, 17 radius, 18 steep, 19 yc (16ths), 27 a +d = add mul yy 16 8 +d = sub d get Ps 19 +d = sub pkabs d get Ps 17 +cov = pkcover d +cov = shr mul ulong get Ps 27 cov 8 +color = ulong get Ps 12 +if eq get Ps 18 1 +pkplot yy xc color cov +else +pkplot xc yy color cov +end +end +fn pkthreadcol xc long to void +note one column (row when steep) at major coordinate xc; Ps: 8 x0, 9 y0, 13 a0, 14 a1, 15 len, 16 grad +along = add mul xc 16 8 +along = sub along get Ps 8 +yc = shr mul along get Ps 16 16 +yc = add yc get Ps 9 +put Ps 19 yc +a = sub get Ps 14 get Ps 13 +a = div mul a along get Ps 15 +put Ps 27 add a get Ps 13 +ya = sub yc get Ps 17 +ya = shr sub ya 8 4 +yb = add yc get Ps 17 +yb = shr add yb 8 4 +for j ulong ulong add sub yb ya 1 +pkthreadpx xc add ya long j +end +end +fn pkthreadgo to void +x0 = get Ps 8 +x1 = get Ps 10 +ln = sub x1 x0 +if lt ln 1 +ln = 1 +end +put Ps 15 ln +grad = div mul sub get Ps 11 get Ps 9 65536 ln +put Ps 16 grad +note slant: the native-scaled width projected onto the minor axis (256 = flat) +grad = long shr pkisqrt ulong add 4294967296 mul grad grad 8 +put Ps 17 shr mul get Pa 0 grad 9 +first = shr add x0 7 4 +last = shr sub x1 8 4 +x0 = get Lg 5 +x1 = get Lg 7 +if eq get Ps 18 1 +x0 = get Lg 6 +x1 = get Lg 8 +end +first = pkmax first x0 +last = pkmin last sub add x0 x1 1 +if gt first last +ret +end +for i ulong ulong add sub last first 1 +pkthreadcol add first long i +end +end +fn pkthreadbox x0 long y0 long x1 long y1 long pad long to bool +bx = sub shr pkmin x0 x1 4 pad +by = sub shr pkmin y0 y1 4 pad +bw = add add sub shr pkmax x0 x1 4 bx pad 1 +bh = add add sub shr pkmax y0 y1 4 by pad 1 +ret pkmeets bx by bw bh +end +fn pkthread x0 long y0 long x1 long y1 long color ulong a01 ulong to void +note width, a0 and a1 ride in Pa[0..2] (Omega takes at most six values); a01 is ignored +w = get Pa 0 +if le w 0 +ret +end +if and eq get Pa 1 0 eq get Pa 2 0 +ret +end +if not pkthreadbox x0 y0 x1 y1 add shr w 4 1 +ret +end +put Ps 18 0 +if gt pkabs sub y1 y0 pkabs sub x1 x0 +put Ps 18 1 +t = x0 +x0 = y0 +y0 = t +t = x1 +x1 = y1 +y1 = t +end +put Ps 13 get Pa 1 +put Ps 14 get Pa 2 +if gt x0 x1 +t = x0 +x0 = x1 +x1 = t +t = y0 +y0 = y1 +y1 = t +put Ps 13 get Pa 2 +put Ps 14 get Pa 1 +end +put Ps 8 x0 +put Ps 9 y0 +put Ps 10 x1 +put Ps 11 y1 +put Ps 12 long color +pkthreadgo +end +fn pksdrrect x long y long rx long ry long rw long rh long to long +note The rounded rectangle's radius rides in Lg[9] (Omega takes at most six values). +rad = mul get Lg 9 16 +x = add mul x 16 8 +x = sub x mul rx 16 +x = sub x mul rw 8 +rw = sub mul rw 8 rad +x = sub pkabs x rw +y = add mul y 16 8 +y = sub y mul ry 16 +y = sub y mul rh 8 +rh = sub mul rh 8 rad +y = sub pkabs y rh +out = pkmax x y +if and gt x 0 gt y 0 +x = add mul x x mul y y +out = long pkisqrt ulong x +end +ret sub out rad +end +fn pkadvance c uchar to ulong +note the advance of c, 1/256 px: the number after 'w' at the start of its glyph, times the scale +if not afpick c +ret 0 +end +put Afpos 0 add get Afpos 0 1 +ret mul ulong afnum get Af 0 +end +fn pkletterpx xx long to void +note Ps: 10 alpha row offset (row*w - gx), 11 y * width, 22 color, 23 a, 24 plus +cov = ulong get Alpha ulong add xx get Ps 10 +if ne cov 0 +cov = add cov shr cov 7 +cov = shr mul cov ulong get Ps 23 8 +i = ulong add xx get Ps 11 +color = ulong get Ps 22 +if eq get Ps 24 1 +put Nfrm i uint pkadd ulong get Nfrm i color cov +else +put Nfrm i uint pkmix ulong get Nfrm i color cov +end +end +end +fn pkletterrow yy long to void +m = sub yy get Ps 21 +m = mul m long get Af 3 +put Ps 10 sub m get Ps 20 +put Ps 11 mul yy get Lg 0 +x0 = get Ps 25 +n = ulong sub get Ps 26 x0 +for i ulong n +pkletterpx add x0 long i +end +end +fn pkletterrows to void +note every row of the fitted glyph box Ps[28..31] +put Ps 25 get Ps 28 +put Ps 26 get Ps 30 +y0 = get Ps 29 +n = ulong sub get Ps 31 y0 +for j ulong n +pkletterrow add y0 long j +end +end +fn pkletter pen ulong y long c uchar color ulong a ulong plus bool to ulong +note ck_letter: the glyph c of the face afinit made, its pen at pen (1/256 px) on baseline y, mixed in +note with weight a (added light when plus); returns the pen after it +if eq a 0 +ret add pen pkadvance c +end +if not afglyph c +ret add pen pkadvance c +end +if eq get Af 2 0 +ret add pen get Af 5 +end +gx = add long div add pen 128 256 get Ab 0 +gy = add y get Ab 1 +if pkfit gx gy long get Af 3 long get Af 4 +put Ps 20 gx +put Ps 21 gy +put Ps 22 long color +put Ps 23 long a +put Ps 24 0 +if plus +put Ps 24 1 +end +pkletterrows +end +ret add pen get Af 5 +end diff --git a/native/omega/allen/look-show.om b/native/omega/allen/look-show.om new file mode 100644 index 00000000..5519ab63 --- /dev/null +++ b/native/omega/allen/look-show.om @@ -0,0 +1,582 @@ +note SPDX-License-Identifier: MIT +note Allen's look, the show: what the firmware loop draws each frame and where. Native resolution +note (Lg[0] x Lg[1], the GOP mode), the frame Nfrm (look-paint.om) composed in allen_ui.c's order: +note night base, lights, the merger flash, Allen's being, his words and the bar; in repository mode +note the repository screen (repository-screen.om, drawn through surface.om at native scale) on top. +note Only rectangles that changed are composed; their rows are blitted from two persistent BGRA +note halves (Efa rows 0..hh-1, Efb rows hh..h-1; each at most 16 MiB, the compiler's array limit). +note Sh: 0 ms at start, 1 last t, 2 rows per half (hh), 3 full redraw pending, 4 frames drawn, +note 5 repository screen dirty, 6 last full-screen compose ms, 7 fade strip, 8 the request is +note with the Spark (thinking), 9 the fade's last full pass is done, 10 the ripple radius last +note drawn, 11 now (ms), 12 the ripple was on screen last frame, 13 pixels composed this frame, +note 14 rectangles composed this frame, 15 this frame redrew the whole screen (look-stat.om). +global Sh long 16 +global Efa uchar 16777216 +global Efb uchar 16777216 +global Shrow uchar 2176 +global Shd long 1280 +global Shdn ulong 1 +global Shr long 4 +global Shl long 10 +global Shb long 20 +global Shbn ulong 1 +const SHRECTS ulong 320 +const SHBORN ulong 12300 +const SHFADE ulong 6800 +const SHMERGE ulong 12000 +const SHGONE ulong 15600 +const SHCOARSE ulong 0 +fn shfits w ulong h ulong to bool +if or lt w 640 lt h 400 +ret false +end +if or gt w 3840 gt h 2176 +ret false +end +hh = div add h 1 2 +ret le mul mul hh w 4 len Efa +end +fn shclipr x long y long w long h long to bool +note Shr becomes (x,y,w,h) held inside the screen; false when nothing is left. +x1 = add x w +y1 = add y h +if lt x 0 +x = 0 +end +if lt y 0 +y = 0 +end +if gt x1 get Lg 0 +x1 = get Lg 0 +end +if gt y1 get Lg 1 +y1 = get Lg 1 +end +put Shr 0 x +put Shr 1 y +put Shr 2 sub x1 x +put Shr 3 sub y1 y +if or le sub x1 x 0 le sub y1 y 0 +ret false +end +ret true +end +fn shmark x long y long w long h long to void +note Remember a rectangle to compose this frame. Past the list's room, the whole screen is marked. +if not shclipr x y w h +ret +end +n = get Shdn 0 +if ge n SHRECTS +put Sh 3 1 +ret +end +at = mul n 4 +put Shd at get Shr 0 +put Shd add at 1 get Shr 1 +put Shd add at 2 get Shr 2 +put Shd add at 3 get Shr 3 +put Shdn 0 add n 1 +end +fn shmarkall to void +put Sh 3 1 +end +fn shrowa i ulong at ulong n ulong to void +note n pixels from Nfrm[i..] as BGRA into Efa[at..] (rows of the upper half). +for k ulong n +c = get Nfrm add i k +put Efa at uchar and c 255 +put Efa add at 1 uchar and shr c 8 255 +put Efa add at 2 uchar and shr c 16 255 +put Efa add at 3 0 +at = add at 4 +end +end +fn shrowb i ulong at ulong n ulong to void +note The same into Efb (rows of the lower half). +for k ulong n +c = get Nfrm add i k +put Efb at uchar and c 255 +put Efb add at 1 uchar and shr c 8 255 +put Efb add at 2 uchar and shr c 16 255 +put Efb add at 3 0 +at = add at 4 +end +end +fn shrow y ulong x0 ulong n ulong to void +note One row's pixels x0..x0+n-1 from Nfrm into the BGRA half that holds row y. +w = ulong get Lg 0 +hh = ulong get Sh 2 +i = add mul y w x0 +if lt y hh +shrowa i mul i 4 n +else +shrowb i mul add mul sub y hh w x0 4 n +end +put Shrow y 1 +end +fn shconvert x long y long w long h long to void +note Nfrm -> BGRA for the rectangle, and its rows are remembered for the blit. +for r ulong ulong h +shrow add ulong y r ulong x ulong w +end +end +fn shblit y0 ulong rows ulong to bool +note Rows y0..y0+rows-1 (whole width) to the screen from the half that holds them; a run that +note crosses the halves is sent as two. +w = ulong get Lg 0 +hh = ulong get Sh 2 +if and lt y0 hh gt add y0 rows hh +if not shblit y0 sub hh y0 +ret false +end +ret shblit hh sub add y0 rows hh +end +arg = or or w shl rows 32 shl y0 48 +n = mul mul w rows 4 +put Stw 10 add get Stw 10 n +st = ulong 0 +if lt y0 hh +st = efi 3 arg Efa mul mul y0 w 4 n +else +st = efi 3 arg Efb mul mul sub y0 hh w 4 n +end +ret eq st 0 +end +fn shflush to bool +note Blit every run of rows marked by shrow, then clear the marks. +h = ulong get Lg 1 +y = ulong 0 +ok = true +while lt y h bound 2176 +if eq get Shrow y 0 +y = add y 1 +else +n = ulong 0 +while and lt add y n h ne get Shrow add y n 0 bound 2176 +put Shrow add y n 0 +n = add n 1 +end +if not shblit y n +ok = false +end +y = add y n +end +end +ret ok +end +fn shrepo to void +note The repository screen, through surface.om at native scale, over the composed sky. +if ne get Dmo 0 1 +ret +end +ok = ghrender +end +fn shcompose x long y long w long h long to void +note allen_ui.c compose: night base, lights, flash, the being, words and bar. +pkclip x y w h +ntbase x y w h +ntlights x y w h 0 0 +hmflash x y w h +mddraw x y w h +hmtext x y w h +end +fn shfull to void +note The whole screen, then the repository screen if it is up, then BGRA. +w = get Lg 0 +h = get Lg 1 +shcompose 0 0 w h +shrepo +shconvert 0 0 w h +put Sh 13 mul w h +put Sh 14 1 +put Sh 15 1 +put Shdn 0 0 +put Sh 3 0 +end +fn shrects to void +note Every marked rectangle: compose and convert. Rectangles may overlap; drawing twice is harmless +note because every layer is a pure function of position and time. +n = get Shdn 0 +px = long 0 +for i ulong n +at = mul i 4 +x = get Shd at +y = get Shd add at 1 +w = get Shd add at 2 +h = get Shd add at 3 +shcompose x y w h +shconvert x y w h +px = add px mul w h +end +put Sh 13 px +put Sh 14 long n +put Sh 15 0 +put Shdn 0 0 +end +fn shtwinkles to void +note The twinkling stars' boxes (ck_night_star_box) as in allen_ui.c: every star, every frame. +n = ntcount +for i ulong n +ntstarbox i +shmark get Pa 0 get Pa 1 get Pa 2 get Pa 3 +end +end +fn shstrip to void +note The eyes adjust over 6.8 s in slow patches: the screen is composed a sixth at a time, so a +note frame stays cheap and every part of the sky is refreshed about twice a second. +h = get Lg 1 +k = rem get Sh 7 6 +y0 = div mul h k 6 +y1 = div mul h add k 1 6 +shmark 0 y0 get Lg 0 sub y1 y0 +put Sh 7 add get Sh 7 1 +end +fn shchord r long dy long to long +note Half the width of a circle of radius r at dy from its centre (0 outside). +if ge dy r +ret 0 +end +ret long pkisqrt ulong sub mul r r mul dy dy +end +fn shringband hi long lo long ya long yb long to void +note The ring between radii lo and hi within rows ya..yb-1: one rectangle, or two when the band +note misses the ring's hollow middle. Distances are from (cx, cy). +cy = get Lg 4 +cx = get Lg 3 +near = long 0 +if gt ya cy +near = sub ya cy +end +if lt yb cy +near = sub cy yb +end +far = pkmax pkabs sub ya cy pkabs sub yb cy +xo = shchord hi near +xi = shchord lo far +if eq xo 0 +ret +end +if eq xi 0 +shmark sub cx xo ya mul xo 2 sub yb ya +else +shmark sub cx xo ya sub xo xi sub yb ya +shmark add cx xi ya sub xo xi sub yb ya +end +end +fn shring to void +note The ripple bends the sky only within reach of its crest (night.c in_ripple); since the last +note frame the crest moved out, so the band from the old inner edge to the new outer edge changes. +r = get Ntrip 0 +w = get Ntrip 1 +if eq w 0 +ret +end +reach = add div mul w 22 10 9 +hi = add r reach +lo = sub get Sh 10 reach +if or lt lo 0 eq get Sh 10 0 +lo = 0 +end +put Sh 10 r +cy = get Lg 4 +ya = sub cy hi +if lt ya 0 +ya = 0 +end +yend = add cy hi +if gt yend get Lg 1 +yend = get Lg 1 +end +while lt ya yend bound 64 +yb = add ya 64 +if gt yb yend +yb = yend +end +shringband hi lo ya yb +ya = yb +end +end +fn shbadd x long y long w long h long to void +note A box onto the list Shb (at most 5: two holes now, two before, one spare). +n = get Shbn 0 +if ge n 5 +ret +end +at = mul n 4 +put Shb at x +put Shb add at 1 y +put Shb add at 2 w +put Shb add at 3 h +put Shbn 0 add n 1 +end +fn shbmeet a ulong b ulong to bool +note Do boxes a and b of Shb overlap (share at least one pixel column and row). +a = mul a 4 +b = mul b 4 +if ge get Shb a add get Shb b get Shb add b 2 +ret false +end +if ge get Shb b add get Shb a get Shb add a 2 +ret false +end +if ge get Shb add a 1 add get Shb add b 1 get Shb add b 3 +ret false +end +if ge get Shb add b 1 add get Shb add a 1 get Shb add a 3 +ret false +end +ret true +end +fn shbjoin a ulong b ulong to void +note Box a becomes the union of a and b; the last box moves into b's place. +n = get Shbn 0 +a = mul a 4 +b = mul b 4 +x1 = add get Shb a get Shb add a 2 +y1 = add get Shb b get Shb add b 2 +x1 = pkmax x1 y1 +y1 = add get Shb add a 1 get Shb add a 3 +x0 = add get Shb add b 1 get Shb add b 3 +y1 = pkmax y1 x0 +x0 = pkmin get Shb a get Shb b +put Shb a x0 +x0 = pkmin get Shb add a 1 get Shb add b 1 +put Shb add a 1 x0 +put Shb add a 2 sub x1 get Shb a +put Shb add a 3 sub y1 get Shb add a 1 +n = sub n 1 +put Shbn 0 n +n = mul n 4 +for i ulong 4 +put Shb add b i get Shb add n i +end +end +fn shbmerge to void +note Join overlapping boxes until none overlap: every layer is a pure function of position and +note time, so one union costs less than two boxes composed twice where they meet. +for pass ulong 8 +joined = false +n = get Shbn 0 +for a ulong n +for b ulong n +if and lt a b not joined +if shbmeet a b +shbjoin a b +joined = true +end +end +end +end +if not joined +ret +end +end +end +fn shlens to void +note The holes' lens boxes now (Shl remembers them for the next frame) and the boxes of the +note frame before, merged where they meet, then marked. +put Shbn 0 0 +n = ulong get Shl 8 +for i ulong n +at = mul i 4 +shbadd get Shl at get Shl add at 1 get Shl add at 2 get Shl add at 3 +end +put Shl 8 0 +for i ulong ntholes +if ntholebox i +shbadd get Pa 0 get Pa 1 get Pa 2 get Pa 3 +k = ulong get Shl 8 +at = mul k 4 +for j ulong 4 +put Shl add at j get Pa j +end +put Shl 8 add long k 1 +end +end +shbmerge +n = get Shbn 0 +for i ulong n +at = mul i 4 +shmark get Shb at get Shb add at 1 get Shb add at 2 get Shb add at 3 +end +end +fn shdecide t ulong to void +note Which parts of the screen change at t (ms since the sky started). Sh[9]: the fade's last +note full pass is done; Sh[12]: the ripple was on screen last frame; Shl: the lens rect last frame. +if lt t add SHFADE 400 +shstrip +else +if eq get Sh 9 0 +put Sh 9 1 +shmarkall +end +end +if ne get Ntrip 1 0 +shring +put Sh 12 1 +put Ntcoarse 0 SHCOARSE +else +put Ntcoarse 0 0 +if ne get Sh 12 0 +put Sh 12 0 +shmarkall +end +end +note The holes' lens regions now and where they were, Allen, his words and bar, the twinkles. +shlens +mddirty +shmark get Mdbox 0 get Mdbox 1 get Mdbox 2 get Mdbox 3 +shmark get Hmdirty 0 get Hmdirty 1 get Hmdirty 2 get Hmdirty 3 +shtwinkles +end +fn shstep now ulong to bool +note Move the show on to now and draw what changed. False when the screen refused a blit. +if eq get Sh 0 0 +put Sh 0 long now +end +put Sh 11 long now +t = sub now ulong get Sh 0 +ntat t +hmstep long t +mdat long t +if eq get Dmo 0 1 +note Repository mode: a still picture, redrawn only when the screen says it changed. +if or ne get Sh 5 0 ne get Sh 3 0 +shfull +put Sh 5 0 +ret shflush +end +ret true +end +shdecide t +if ne get Sh 3 0 +shfull +else +shrects +end +put Sh 1 long t +put Sh 4 add get Sh 4 1 +t1 = efms +ok = shflush +shstat now t1 efms t +ret ok +end +fn shstat t0 ulong t1 ulong t2 ulong t ulong to void +note The frame's clocks and what it composed, for the stopwatch (look-stat.om). +rf = ulong add mul get Sh 14 2 get Sh 15 +stframe t0 t1 t2 t ulong get Sh 13 rf +end +fn shsubmit to void +note Enter in the bar: a recognised repository request opens the repository screen; anything else +note goes to the Spark through the courier (look-chat.om) and Allen thinks until the answer comes. +n = get Hminn 0 +if or eq n 0 gt n 159 +ret +end +for i ulong n +put In i get Hmin i +put Dprm i get Hmin i +end +put Inlen 0 n +put Dprmn 0 n +if stasked +hmkey 13 +ret +end +if inmatch +hmkey 13 +ininstall ulong get Sh 11 +ret +end +if ghask +put Dmo 0 1 +put Sh 5 1 +hmkey 13 +ret +end +if eq get Es 6 0 +ret +end +if chask ulong get Sh 11 +put Sh 8 1 +hmthink 1 +end +hmkey 13 +end +fn shkey key ulong to bool +note Keys: the repository screen takes them while it is up (Escape closes it); otherwise the bar. +if eq get Dmo 0 1 +if eq key 27 +put Dmo 0 0 +ghinit +shmarkall +ret true +end +ghkey key +put Sh 5 1 +ret true +end +if or eq key 10 eq key 13 +shsubmit +ret true +end +hmkey key +ret true +end +fn shanswer to void +note The courier's visible text becomes what Allen says. +if ne get Chevent 0 1 +if or eq get Chevent 0 5 eq get Chevent 0 6 +if eq get Chevent 0 6 +hmthink 0 +put Sh 8 0 +end +put Chevent 0 0 +end +ret +end +n = get Chsayn 0 +if gt n len Hmsay +n = len Hmsay +end +for i ulong n +put Hmsay i get Chsay i +end +put Hmsayn 0 n +hmsaid +hmthink 0 +put Sh 8 0 +put Chevent 0 0 +end +fn shinit now ulong to bool +note Sizes from the screen (Es), then every module of the look. +w = get Es 0 +h = get Es 1 +if not shfits w h +ret false +end +put Lg 0 long w +put Lg 1 long h +kw = div mul w 256 1920 +kh = div mul h 256 1080 +if lt kh kw +kw = kh +end +put Lg 2 long kw +put Lg 3 long div w 2 +put Lg 4 long div mul h 40 100 +put Sh 2 long div add h 1 2 +for i ulong 2176 +put Shrow i 0 +end +put Shdn 0 0 +put Shl 8 0 +pkinit +ntinit +mdinit long SHBORN +hminit +put Sh 0 long now +put Sh 3 1 +ret true +end diff --git a/native/omega/allen/look-sky.om b/native/omega/allen/look-sky.om new file mode 100644 index 00000000..9f648ce9 --- /dev/null +++ b/native/omega/allen/look-sky.om @@ -0,0 +1,360 @@ +note SPDX-License-Identifier: MIT +note Allen's look: the real sky. Handwritten Omega port of native/kernel/ui/sky_real.c (aienux 4b24df65): +note the gnomonic projection of the catalogue's stars (look-skydata.om) into Nsky, the list of the bright +note ones that twinkle, the twinkle itself (into Nfrm, inside the clip), and the two Magellanic Clouds' +note light and phase maps for the sweeping light. Same integers as the C; tests/look-sky.om compares the +note sky byte for byte with the C oracle. +note Ported: ck_sky_project (skproj), ck_sky_draw_stars (skstars), ck_sky_twinkle (sktwink), +note ck_sky_galaxy_bound/in_view/box/maps (skgbound skginview skgbox skgmaps), and ck_night_init's sky +note construction (skmake, night.c:120-133). Not ported, never reached by the default iMac build (sky_mode 0, +note allen_ui.c:1226): ck_sky_draw_milkyway and its helpers, ck_sky_gmst, ck_sky_zenith, ck_sky_view_at. +note Interface (NIGHT reads these; the names were agreed with LookNight): +note skmake: reads Lg 0..4 (w h k cx cy), runs skinit, clears Nsky w*h, draws the stars into Nsky, fills +note Sktwn/Sktw, then every galaxy's box, offset and maps. Never touches Nfrm or the clip. +note Sktwn: how many stars twinkle (<= 256). Sktw: 8 longs per star i at 8*i: 0 x16, 1 y16 (16ths of a +note pixel), 2 peak (catalogue flux, linear Q16), 3 4 5 col (linear, brightest channel 4096), 6 period +note (ms), 7 phase (ms). +note sktwink i amount: ck_sky_twinkle of star i with amount (1/256 of its flux) into Nfrm, clipped by Lg 5..8. +note Skgbox: x y w h per galaxy (w 0: empty; only galaxies 0 and 1 exist). Skgtint: its sRGB tint. +note Skgper: ms for the sweep to come round. Skgoff: where its maps start in Skglit (light 0..255) and +note Skgpha (phase 0..255), row-major box w*h each. The pools hold every box a 3840-wide screen can need: +note sum of (2a+1)^2 over ck_sky_galaxy_bound = 445^2 + 231^2 = 251386 (Wolfram). +const SKGPOOL ulong 251386 +global Sktwn ulong 1 +global Sktw long 2048 +global Skgbox long 24 +global Skgtint uint 6 +global Skgper ulong 6 +global Skgoff ulong 6 +global Skglit uchar SKGPOOL +global Skgpha uchar SKGPOOL +note scratch: Skpx 0 x16 1 y16 (skproj's result), Skgp 0 gx 1 gy (skginview's result); +note Skpk 0 peak 1 2 3 colour, Skclip x y w h, Sktgt 0 Nsky 1 Nfrm (skpoint's arguments); +note Skgw 0 gx 1 gy 2 a 3 b 4 cos 5 sin 6 box x 7 box y 8 a^2 9 b^2 (skgmaps' per-galaxy values for skgpx) +global Skpx long 2 +global Skgp long 2 +global Skpk ulong 4 +global Skclip long 4 +global Sktgt ulong 1 +global Skgw long 10 +note ck_sky_project: where direction (dx dy dz) (Q15) lands on the Lg 0 wide screen whose view centre is +note (Lg 3, Lg 4): Skpx 0 1 in 16ths of a pixel; 0 when behind the camera (more than 88 degrees away). +fn skproj dx long dy long dz long to long +a2 = add mul get Skview 11 dx mul get Skview 12 dy +a2 = add a2 mul get Skview 13 dz +if lt a2 1099511627776 +ret 0 +end +a2 = shr a2 16 +u = add mul get Skview 5 dx mul get Skview 6 dy +u = add u mul get Skview 7 dz +u = div mul u 16384 a2 +t = add mul get Skview 8 dx mul get Skview 9 dy +t = add t mul get Skview 10 dz +t = div mul t 16384 a2 +s = mul get Lg 0 8 +u = div mul u s get Skview 4 +t = div mul t s get Skview 4 +put Skpx 0 add mul get Lg 3 16 u +put Skpx 1 sub mul get Lg 4 16 t +ret 1 +end +note one native pixel of point_add: pixel (x, y) of the target gets weight/256 of the light Skpk +fn skdep x long y long wt ulong to void +i = ulong add mul y get Lg 0 x +c = ulong 0 +if eq get Sktgt 0 0 +c = ulong get Nsky i +else +c = ulong get Nfrm i +end +out = ulong 0 +for k ulong 3 +lv = and shr c sub 16 mul 8 k 255 +a = mul get Skpk 0 get Skpk add k 1 +a = shr mul shr a 13 wt 8 +if ne a 0 +l = add ulong get Slin lv a +if ge l 32767 +l = 4095 +else +l = shr l 3 +end +lv = shr add ulong get Ssrgb l 8 4 +if gt lv 255 +lv = 255 +end +end +out = or shl out 8 lv +end +c = or and c 4278190080 out +if eq get Sktgt 0 0 +put Nsky i uint c +else +put Nfrm i uint c +end +end +note the clip for skpoint: (x, y, w, h) cut to the screen, kept as x0 y0 x1 y1 (ends exclusive) in Skclip +fn skclip x long y long w long h long to void +put Skclip 0 pkmax x 0 +put Skclip 1 pkmax y 0 +put Skclip 2 pkmin add x w get Lg 0 +put Skclip 3 pkmin add y h get Lg 1 +end +note point_add: a point source at (x16, y16) deposits the light Skpk on the 2 x 2 native pixels round it, +note inside Skclip (already cut to the screen), into Nsky (Sktgt 0) or Nfrm (Sktgt 1). Weights sum to 256. +fn skpoint x16 long y16 long to void +x0 = shr sub x16 8 4 +y0 = shr sub y16 8 4 +fx = ulong and sub x16 8 15 +fy = ulong and sub y16 8 15 +for j ulong 2 +y = add y0 long j +if ge y get Skclip 1 +if lt y get Skclip 3 +for i ulong 2 +x = add x0 long i +if ge x get Skclip 0 +if lt x get Skclip 2 +wt = sub 16 fx +if eq i 1 +wt = fx +end +if eq j 1 +wt = mul wt fy +else +wt = mul wt sub 16 fy +end +if ne wt 0 +skdep x y wt +end +end +end +end +end +end +end +end +note ck_sky_draw_stars for star i: project it, add its light to Nsky, list it to twinkle when V <= 1.0 +fn skstar1 i ulong to void +j = mul i 3 +if eq skproj get Skstar j get Skstar add j 1 get Skstar add j 2 0 +ret +end +x = get Skpx 0 +y = get Skpx 1 +if lt x -32 +ret +end +if lt y -32 +ret +end +if gt x add mul get Lg 0 16 32 +ret +end +if gt y add mul get Lg 1 16 32 +ret +end +bv = get Skbv i +if ge bv 128 +bv = 127 +end +bv = mul bv 3 +put Skpk 0 get Skflux get Skmag i +put Skpk 1 get Skpal bv +put Skpk 2 get Skpal add bv 1 +put Skpk 3 get Skpal add bv 2 +skpoint x y +if le get Skmag i 59 +n = get Sktwn 0 +if lt n 256 +n = mul n 8 +put Sktw n x +put Sktw add n 1 y +put Sktw add n 2 long get Skpk 0 +put Sktw add n 3 long get Skpk 1 +put Sktw add n 4 long get Skpk 2 +put Sktw add n 5 long get Skpk 3 +put Sktw add n 6 long add 1200 rem mul i 137 2400 +put Sktw add n 7 long rem mul i 919 65536 +put Sktwn 0 add get Sktwn 0 1 +end +end +end +note ck_sky_draw_stars: every catalogue star in the view into Nsky (clip: the whole screen), the bright +note ones listed in Sktw +fn skstars to void +put Sktwn 0 0 +put Sktgt 0 0 +skclip 0 0 get Lg 0 get Lg 1 +for i ulong SKNST +skstar1 i +end +end +note ck_sky_twinkle: star i of Sktw with amount/256 more of its light, into Nfrm inside the clip Lg 5..8 +fn sktwink i ulong amount ulong to void +n = mul i 8 +put Skpk 0 shr mul ulong get Sktw add n 2 amount 8 +put Skpk 1 ulong get Sktw add n 3 +put Skpk 2 ulong get Sktw add n 4 +put Skpk 3 ulong get Sktw add n 5 +put Sktgt 0 1 +skclip get Lg 5 get Lg 6 get Lg 7 get Lg 8 +skpoint get Sktw n get Sktw add n 1 +end +note ck_sky_galaxy_bound: the side of the largest box galaxy i can need on a w-wide screen (0: no galaxy i) +fn skgbound w long i ulong to long +if ge i SKNGAL +ret 0 +end +a = add shr mul get Skgal add mul i 7 3 w 16 4 +ret add mul a 2 1 +end +note ck_sky_galaxy_in_view: galaxy i's centre pixel into Skgp 0 1; 1 when it is on the Lg 0 x h screen +fn skginview i ulong h long to long +if ge i SKNGAL +ret 0 +end +j = mul i 7 +if eq skproj get Skgal j get Skgal add j 1 get Skgal add j 2 0 +ret 0 +end +x = shr add get Skpx 0 8 4 +y = shr add get Skpx 1 8 4 +put Skgp 0 x +put Skgp 1 y +if lt x 0 +ret 0 +end +if ge x get Lg 0 +ret 0 +end +if lt y 0 +ret 0 +end +if ge y h +ret 0 +end +ret 1 +end +note ck_sky_galaxy_box: galaxy i's box on the screen into Skgbox (clipped; empty when out of view or none) +fn skgbox i ulong to void +b = mul i 4 +put Skgbox b 0 +put Skgbox add b 1 0 +put Skgbox add b 2 0 +put Skgbox add b 3 0 +if eq skginview i get Lg 1 0 +ret +end +a = add shr mul get Skgal add mul i 7 3 get Lg 0 16 4 +x0 = pkmax 0 sub get Skgp 0 a +y0 = pkmax 0 sub get Skgp 1 a +x1 = pkmin sub get Lg 0 1 add get Skgp 0 a +y1 = pkmin sub get Lg 1 1 add get Skgp 1 a +if ge x0 x1 +ret +end +if ge y0 y1 +ret +end +put Skgbox b x0 +put Skgbox add b 1 y0 +put Skgbox add b 2 sub x1 x0 +put Skgbox add b 3 sub y1 y0 +end +note one map pixel (px, py) of the galaxy Skgw describes, at pool offset off: its light and phase +fn skgpx px long py long off ulong to void +px = sub add get Skgw 6 px get Skgw 0 +py = sub add get Skgw 7 py get Skgw 1 +u = mul px get Skgw 4 +u = shr add u mul py get Skgw 5 14 +v = mul neg px get Skgw 5 +v = shr add v mul py get Skgw 4 14 +a = get Skgw 2 +note f < 0: no galaxy there (a or b 0, or outside the ellipse u^2 b^2 + v^2 a^2 > a^2 b^2); +note Skgw 8 is a^2, Skgw 9 is b^2 +f = long -1 +if ne a 0 +if ne get Skgw 3 0 +f = mul mul u u get Skgw 9 +f = add f mul mul v v get Skgw 8 +f = sub mul get Skgw 8 get Skgw 9 f +end +end +if lt f 0 +put Skglit off 0 +put Skgpha off 128 +ret +end +note light falls off as (1 - (u/a)^2 - (v/b)^2)^2 +f = mul mul u u 65536 +f = sub 65536 div f get Skgw 8 +v = mul mul v v 65536 +f = sub f div v get Skgw 9 +if lt f 0 +f = 0 +end +f = shr mul f f 16 +f = shr mul f 255 16 +put Skglit off uchar f +f = mul add u a 255 +f = div f add mul a 2 1 +put Skgpha off uchar f +end +note ck_sky_galaxy_maps: galaxy i's light and phase over its box into Skglit / Skgpha at Skgoff i +fn skgmaps i ulong to void +if ge i SKNGAL +ret +end +b = mul i 4 +if eq get Skgbox add b 2 0 +ret +end +if eq skginview i 2147483647 0 +ret +end +j = mul i 7 +put Skgw 0 get Skgp 0 +put Skgw 1 get Skgp 1 +put Skgw 2 shr mul get Skgal add j 3 get Lg 0 16 +put Skgw 3 add shr mul get Skgal add j 4 get Lg 0 16 1 +put Skgw 4 pkcos ulong get Skgal add j 5 +put Skgw 5 pksin ulong get Skgal add j 5 +put Skgw 6 get Skgbox b +put Skgw 7 get Skgbox add b 1 +put Skgw 8 mul get Skgw 2 get Skgw 2 +put Skgw 9 mul get Skgw 3 get Skgw 3 +put Skgtint i uint get Skgal add j 6 +put Skgper i add 2400 mul i 400 +w = ulong get Skgbox add b 2 +h = ulong get Skgbox add b 3 +off = get Skgoff i +for py ulong h +for px ulong w +skgpx long px long py off +off = add off 1 +end +end +end +note the sky as ck_night_init makes it (night.c:120-133): black, the stars, the galaxies +fn skmake to void +skinit +w = ulong get Lg 0 +h = ulong get Lg 1 +for y ulong h +r = mul y w +for x ulong w +put Nsky add r x 0 +end +end +skstars +off = ulong 0 +for i ulong 6 +skgbox i +put Skgoff i off +b = mul i 4 +off = add off mul ulong get Skgbox add b 2 ulong get Skgbox add b 3 +skgmaps i +end +end diff --git a/native/omega/allen/look-skydata.om b/native/omega/allen/look-skydata.om new file mode 100644 index 00000000..e08f4d78 --- /dev/null +++ b/native/omega/allen/look-skydata.om @@ -0,0 +1,124 @@ +note SPDX-License-Identifier: MIT +note Allen's look: the sky's tables. GENERATED by ~/work/IMacLook/sky/gen_skydata.py from +note native/kernel/ui/sky_data.c (aienux 4b24df65, itself generated by native/kernel/tools/ck_sky_gen.c +note from the Yale Bright Star Catalogue); do not edit the text lines. Decimal numbers, one space between, +note a trailing space. skinit decodes them once into the Sk* pools below; skmake (look-sky.om) calls it. +note Left out on purpose: ck_sky_milkyway, ck_sky_luma, ck_sky_chroma (ck_night_init at 4b24df65 clears the +note sky to black and never calls ck_sky_draw_milkyway: night.c:122-125) and ck_sky_checks (host test only). +note Sdview: ra_mdeg dec_mdeg fov_mdeg roll_mdeg tan_half_q30, then rot_q30 row-major (rows: screen right, +note screen up, the view centre). Sdstars: x y z (Q15, J2000) mag ((V+2)*20) bv (palette index) per star. +note Sdflux: light at the middle of a star of magnitude code m, linear Q16. Sdpal: linear sRGB r g b per +note B-V step, brightest channel 4096. ck_sky_lin / ck_sky_srgb16 (Slin / Ssrgb) are PAINT's: pkinit fills +note them. Sdgal: dir x y z (Q15), a_q16, b_q16, angle +note (turns/65536 from screen right towards down), tint (sRGB packed) per galaxy. +text Sdview "113697 -72757 80000 0 900976368 983207820 431536659 0 -412141747 939018691 318283808 -127918209 291447275 -1025483750 " +text Sdstars "-2072 19750 -26064 26 28 -12262 -10232 -28611 40 55 16145 7334 -27554 49 12 -13891 -8332 -28483 52 8 -16180 -3418 -28288 65 8 -14726 -1717 -29221 67 8 -12262 -10232 -28611 67 64 -17627 -2412 -27517 73 100 -8481 7557 -30735 74 20 -14725 -1717 -29221 75 7 -9685 13514 -28236 77 84 -3592 -11164 -30596 78 92 -12463 14249 -26745 79 22 -21163 -3875 -24714 83 20 -12687 10923 -28168 85 29 -17683 -8235 -26329 86 9 -14504 11944 -26845 90 11 -20730 -756 -25365 92 14 -20236 6695 -24887 94 65 -11517 -1885 -30618 94 10 -13368 4671 -29549 95 9 7184 820 -31959 96 51 -16962 -1122 -28013 96 8 -7595 -12533 -29307 97 34 13551 7728 -28815 97 34 -7701 -9090 -30525 98 20 -4495 20300 -25326 99 80 -11553 7567 -29714 100 34 -11969 -2450 -30404 101 11 -14203 10779 -27491 103 98 -14783 1568 -29201 103 18 -10520 -9024 -29691 104 32 4872 7449 -31535 105 101 6880 17467 -26856 105 15 -3217 15074 -28915 105 30 -10005 5003 -30798 106 16 -14411 5821 -28847 106 16 6732 13565 -29058 107 66 -14161 6824 -28750 108 97 -12502 11360 -28077 109 10 -9623 17222 -26163 109 11 -16320 9722 -26699 111 16 16880 11441 -25648 111 14 -16115 -1506 -28491 112 91 -12718 15117 -26142 112 11 -9990 -2784 -31083 112 79 -12920 813 -30101 113 28 -12586 8390 -29067 114 81 17799 9865 -25682 114 62 -16056 15484 -24002 115 80 1738 15035 -29062 115 61 5885 -4065 -31977 115 70 -7872 10665 -29966 115 76 -3232 10450 -30887 116 72 -16240 4849 -28043 116 68 -15649 6652 -28010 116 36 -4630 -4164 -32170 117 92 -11110 11601 -28560 117 15 -20423 7708 -24437 117 35 7789 11571 -29650 117 76 1142 20560 -25488 117 29 -21785 10775 -21977 117 22 10814 21691 -22051 117 75 -21402 -3552 -24557 117 22 -9952 -1419 -31187 117 12 -18757 3223 -26673 118 12 -2327 -5865 -32154 118 66 -16465 3757 -28079 118 82 -20804 -2558 -25186 118 10 17854 5491 -26921 118 16 -4210 8844 -31269 119 72 -19981 -1017 -25950 119 12 -11280 10222 -29016 119 11 -4046 11613 -30372 120 59 15320 14524 -25061 120 125 -9376 9178 -30026 120 27 -8241 3652 -31503 120 38 -17259 -4191 -27536 121 12 -14316 -1154 -29452 121 12 -4215 6102 -31917 121 40 -11051 -12883 -28028 121 24 -13495 9945 -28154 122 20 9715 6914 -30520 122 22 9308 7783 -30438 122 17 -6037 2334 -32121 122 99 -15769 929 -28708 122 65 -12259 -941 -30373 122 99 -7703 -10672 -30008 122 78 -14041 -422 -29603 123 37 4657 -1557 -32397 123 30 13863 1225 -29665 125 49 -2333 -6685 -31993 125 73 8942 18341 -25638 125 35 -6057 -486 -32199 125 14 -20210 -6074 -25066 125 10 -17375 6384 -27038 126 72 -14458 651 -29398 126 12 -2897 -2161 -32567 126 86 -10641 12612 -28308 127 15 -14715 -194 -29276 127 34 -20946 -4943 -24708 127 88 -14844 -10425 -27288 127 26 -13282 11526 -27648 127 101 894 13436 -29872 127 30 -6328 10133 -30511 127 15 -4089 5806 -31988 127 78 -17312 12483 -24862 127 29 17309 3314 -27624 127 20 14756 2044 -29185 127 16 -3000 19502 -26160 128 19 -23442 6264 -22021 128 26 -4194 18976 -26381 128 66 -10553 18607 -24821 128 12 7301 15050 -28176 129 74 8290 22951 -21868 129 37 -16399 6329 -27653 129 101 -5105 1714 -32321 129 10 -23082 893 -23240 129 85 -20758 -733 -25342 129 12 -7081 6770 -31268 130 50 -11940 13412 -27409 130 12 -16619 7669 -27179 130 14 13548 -5 -29835 130 16 7599 13282 -28974 130 102 809 18226 -27218 130 75 -10557 -12964 -28181 130 30 -12853 9054 -28749 130 16 -14870 -5606 -28655 131 14 -13152 -5049 -29584 131 62 14752 2045 -29187 131 28 7917 13541 -28769 131 101 -17008 7966 -26851 131 101 -15214 5273 -28538 131 105 -19094 11969 -23787 132 80 -25132 7121 -19783 132 72 -15880 3332 -28467 132 48 -15612 -5094 -28354 132 16 -14758 3506 -29045 132 72 -19022 2103 -26598 132 16 -16329 -3969 -28130 132 12 -10054 18700 -24958 133 8 381 14827 -29218 133 73 -17721 -3636 -27320 133 12 -18255 -9167 -25620 133 68 -16127 6895 -27678 133 46 -15743 5827 -28141 133 94 -21206 -3986 -24659 133 75 -2706 -5825 -32131 134 104 10927 5991 -30305 134 68 -13806 14256 -26073 134 14 -15581 -3144 -28654 134 73 -7907 7527 -30895 134 12 -12653 -7133 -29372 134 76 9107 11805 -29179 134 40 4150 17124 -27627 134 46 -12884 662 -30121 134 97 -14789 -279 -29238 134 16 -9364 3862 -31162 135 22 6214 5717 -31660 135 86 -16466 -10480 -26320 135 67 -8396 13306 -28743 135 42 7333 51 -31936 136 84 -11672 -3976 -30358 136 16 -845 18790 -26831 136 8 -11668 9708 -29039 136 67 -7311 12621 -29341 136 12 -12651 17651 -24537 136 12 -13319 4701 -29567 136 13 -13603 4676 -29441 136 14 -20283 -2358 -25626 136 13 2546 12448 -30203 137 84 -22294 10122 -21776 137 76 9362 8250 -30298 137 23 -13451 4445 -29546 137 12 -20456 -5822 -24926 137 21 11169 3835 -30565 137 44 -10885 13523 -27791 137 70 -12801 14932 -26208 137 12 -17926 9437 -25754 137 14 -14714 -1710 -29227 137 14 -9476 -11060 -29352 137 82 -12191 -4270 -30114 137 95 -17959 7316 -26413 138 45 -13732 489 -29747 138 15 -6688 11 -32077 138 17 -4218 -2905 -32364 138 32 -4340 -10284 -30807 138 48 -11696 12009 -28154 138 10 -15950 -5355 -28118 138 44 -13928 -9991 -27926 138 63 11165 21643 -21922 139 36 -3662 21522 -24435 139 64 -5846 20424 -24947 139 26 -8755 3580 -31372 139 104 -16263 -3010 -28287 139 18 -8080 18221 -26008 139 90 -15284 1277 -28956 139 77 -5254 20969 -24625 139 104 7845 13769 -28680 139 91 -11075 486 -30835 139 90 10184 10078 -29469 140 26 -11720 5281 -30140 140 14 -18663 -1550 -26888 140 100 14210 -149 -29525 140 23 7491 5386 -31441 140 75 -664 13526 -29838 140 101 -13179 16461 -25080 140 86 -16493 12188 -25556 140 11 -17158 -8160 -26696 140 18 -20753 8285 -23966 140 72 5053 20637 -24945 141 94 -15096 1087 -29062 141 60 17430 8701 -26347 141 22 -7637 -159 -31864 141 94 -471 15297 -28973 141 82 -7960 -3100 -31634 141 76 -450 11818 -30558 141 16 -19003 -7815 -25524 141 24 -4577 -3276 -32280 141 15 8332 1794 -31639 141 88 8796 21455 -23151 141 10 -7679 11139 -29843 141 77 -14807 -9889 -27507 141 16 -19287 12293 -23464 142 15 -19511 10573 -24108 142 64 -15505 5926 -28252 142 79 -23865 3292 -22210 142 18 14709 2115 -29204 142 22 -385 8608 -31614 142 56 -11816 15737 -26199 142 32 -10386 -12048 -28647 142 17 -6180 -10233 -30509 142 76 -7585 19166 -25471 142 73 4932 -2299 -32312 142 94 11491 11859 -28302 142 37 567 12843 -30140 142 13 -15313 12148 -26299 142 15 -4145 3071 -32358 142 13 -13694 2208 -29686 142 16 -10748 -10446 -29138 142 20 4547 -157 -32450 142 66 -17264 12805 -24731 142 14 -15023 3429 -28917 143 31 -16533 2047 -28216 143 74 2477 16737 -28061 143 70 -5365 19725 -25609 143 101 -6544 20508 -24704 143 82 -23470 5497 -22195 143 22 -16497 2039 -28238 143 44 -15665 1578 -28737 143 76 -15400 1475 -28885 143 19 -12469 -1207 -30278 143 30 5308 -5093 -31931 143 44 -8303 12395 -29174 143 24 -13846 15974 -25036 143 10 -11873 11937 -28111 143 41 -11740 5885 -30020 143 30 -19899 -5060 -25536 143 17 800 20108 -25859 143 70 -3180 11903 -30363 143 90 -4975 17263 -27403 143 18 -8023 13949 -28543 143 107 -12038 16340 -25725 143 12 -14217 2144 -29444 143 45 -13587 1219 -29792 143 60 -17263 -4193 -27533 143 14 -9930 -10356 -29459 143 66 -15654 15810 -24055 144 32 -8273 -282 -31704 144 85 947 7681 -31840 144 76 -12657 15089 -26188 144 13 3327 14289 -29299 144 102 -7036 8453 -30866 144 20 -11766 -11319 -28410 144 78 14523 12258 -26693 144 40 -14920 -13319 -25955 144 69 -2298 17769 -27435 144 75 -14312 14096 -25887 145 14 -13503 4486 -29516 145 16 -17058 5628 -27405 145 16 -13974 2923 -29493 145 17 -12907 -9024 -28734 145 34 9811 11517 -29065 145 50 6094 13355 -29295 145 68 -16968 5146 -27555 145 28 -21955 2315 -24213 145 32 -17484 -9304 -26104 145 16 11083 10070 -29145 145 25 -10815 13445 -27856 145 13 -15669 13371 -25483 145 16 5353 15624 -28300 145 30 -2719 20780 -25189 145 40 -13892 12258 -27027 145 70 -2710 -5841 -32128 145 90 4429 194 -32466 146 73 4883 3805 -32177 146 69 -11872 6266 -29891 146 69 -18336 9204 -25549 146 32 324 -1329 -32738 146 84 448 19882 -26042 146 36 -5438 7620 -31401 146 20 -6479 5562 -31635 146 21 -13162 5528 -29494 146 113 -22845 1424 -23447 146 14 3511 -2217 -32503 146 57 9134 -4031 -31209 146 52 -15660 2299 -28691 146 16 15409 12636 -26011 146 34 6894 19678 -25277 146 69 2597 10172 -31040 146 70 1330 22476 -23807 146 72 -14587 -2759 -29211 146 34 -13149 -5128 -29571 146 40 -14261 9920 -27783 146 30 -17393 -4332 -27430 146 20 -13295 17472 -24324 147 13 -15221 16062 -24166 147 33 9983 21234 -22872 147 74 1675 14148 -29508 147 72 -13376 4458 -29579 147 15 -21615 -778 -24614 147 20 -5394 -5295 -31883 147 92 13092 9590 -28466 147 40 -8748 9498 -30116 147 41 -12097 -245 -30451 147 20 5363 -1681 -32281 147 12 -4079 3300 -32344 147 43 -20995 4410 -24767 147 29 -11219 -9864 -29163 147 34 14833 4487 -28871 147 64 -5952 8515 -31076 147 17 5293 20768 -24786 148 41 -1262 11304 -30730 148 68 -23552 9134 -20870 148 127 -15825 5551 -28150 148 33 -15326 -7311 -28024 148 18 -14230 -13777 -26103 148 26 13372 2507 -29809 148 45 -6940 18901 -25851 148 16 -9031 7762 -30527 148 41 -17434 -1742 -27689 148 15 5451 14343 -28952 148 99 -4165 20075 -25560 148 87 -2379 10420 -30975 148 15 15715 13490 -25392 148 48 -17484 969 -27696 148 103 -1726 1778 -32673 148 36 -21927 2154 -24254 149 82 -18172 139 -27266 149 16 11132 2724 -30697 149 75 6772 13705 -28983 149 75 3668 20470 -25322 149 46 -1470 5834 -32210 149 22 -16181 12407 -25650 149 15 -15765 11328 -26397 149 28 -6257 4127 -31898 149 64 -15915 5994 -28008 149 45 2897 22125 -23995 149 51 -2706 -662 -32648 149 71 -10437 -12308 -28518 149 15 2376 8178 -31641 149 96 257 6044 -32204 149 16 -9475 11565 -29158 149 71 -4060 4782 -32161 149 15 -8124 6399 -31092 149 74 -7606 5752 -31349 149 98 -5139 1738 -32315 149 68 869 -8412 -31657 149 21 438 -405 -32762 149 34 -12507 14985 -26319 150 12 -16509 -2296 -28211 150 52 -18620 -6835 -26082 150 14 18523 9245 -25399 150 100 -5653 -7469 -31400 150 14 1426 -200 -32735 150 84 -4576 16153 -28139 150 15 -21311 2340 -24780 150 72 -16759 -2019 -28084 150 92 -6393 -3891 -31901 150 98 -3898 -9937 -30980 150 81 11362 1026 -30717 150 18 -11545 17513 -25173 150 101 -14231 16624 -24389 150 11 -13089 -4009 -29771 150 19 6393 -3055 -31992 150 36 17474 8381 -26422 150 46 4694 5399 -31976 150 42 -12798 14943 -26203 150 12 -3851 2207 -32465 150 22 -12968 4708 -29721 150 12 11498 -2820 -30554 150 38 7126 7268 -31146 151 13 -2263 5772 -32175 151 84 -10209 16813 -26206 151 87 -6686 8931 -30809 151 18 9810 11472 -29083 151 52 3527 10108 -30969 151 14 -12435 11106 -28208 151 62 -12511 -13806 -26954 151 77 10298 6832 -30347 151 98 -19432 12800 -23070 151 11 -23847 1947 -22387 151 50 -9895 -2182 -31161 151 78 -1106 11161 -30788 151 96 -15995 10819 -26473 151 18 -16223 -10664 -26396 151 92 19779 2998 -25951 151 44 4277 4569 -32164 151 35 -12688 8011 -29129 151 86 -10446 2468 -30959 151 18 -17842 610 -27477 151 24 -15155 154 -29051 151 12 -1775 -2615 -32614 151 26 -17315 7455 -26801 152 98 -2178 -1026 -32678 152 29 -8308 16112 -27296 152 76 -11941 12849 -27676 152 15 -9864 1554 -31208 152 23 10429 213 -31062 152 14 -2758 20063 -25759 152 47 -7982 14135 -28463 152 48 -13827 7247 -28809 152 100 -21478 10530 -22394 152 96 -6896 -6500 -31367 152 61 5792 18629 -26327 152 36 -1812 18056 -27283 152 32 -3800 18147 -27017 152 96 -12690 15085 -26174 152 13 -14189 75 -29535 152 29 -9812 -7201 -30423 152 44 -19200 12076 -23647 152 78 -8506 15523 -27575 153 85 -14307 11812 -27009 153 30 -14161 -6395 -28849 153 45 -909 5152 -32347 153 30 539 5403 -32314 153 50 -5962 8514 -31075 153 15 -19998 9296 -24235 153 103 -7945 791 -31779 153 38 -2710 -2754 -32538 153 68 -2749 -2866 -32525 153 85 -5343 -7655 -31409 153 18 -9794 15438 -27192 153 30 -73 20525 -25542 153 30 -12678 5974 -29618 153 22 -21418 5289 -24227 153 32 -10116 -3976 -30912 153 18 -10150 -12442 -28563 153 44 12533 16720 -25239 154 75 6976 -6425 -31364 154 50 14684 -1997 -29224 154 12 2721 1233 -32631 154 67 10303 6916 -30326 154 85 2398 5027 -32290 154 62 -3231 10452 -30887 154 40 -12086 15459 -26242 154 49 -3047 4183 -32356 154 71 17785 3278 -27324 154 30 14534 3465 -29162 154 98 4028 5248 -32092 154 66 -2364 16831 -28014 154 17 -8998 16836 -26632 154 12 -11556 18288 -24611 154 14 -15041 627 -29104 154 33 -4730 -8705 -31233 154 78 14439 6872 -28600 154 84 13010 21312 -21218 154 50 -357 13302 -29943 154 18 -13019 13576 -26830 154 44 -19673 12021 -23284 154 15 -22061 2395 -24109 154 103 -18666 -5674 -26326 154 16 -10928 -5984 -30306 154 94 -17614 -9684 -25877 154 16 -8697 -11086 -29583 154 102 -8836 19677 -24666 154 17 -17908 10882 -25190 154 20 -15437 7885 -27806 154 16 -15815 -3600 -28471 154 39 14122 -975 -29551 154 90 12310 18469 -24104 155 68 -18907 11964 -23939 155 74 -19329 -4370 -26096 155 26 -10422 -12053 -28632 155 16 4464 -48 -32462 155 73 10894 9593 -29376 155 66 11806 13176 -27580 155 127 -7835 14090 -28526 155 98 -21456 8673 -23197 155 12 -16232 3338 -28268 155 15 -12055 -1171 -30447 155 72 5922 13912 -29070 155 70 -17574 14435 -23589 155 66 -10184 -5403 -30672 155 106 -10773 -7311 -30069 155 17 -6968 -11944 -29706 155 17 -5342 -11086 -30369 155 28 6355 -425 -32142 155 76 16529 7691 -27227 155 64 -2448 21712 -24418 155 17 -19214 3939 -26248 155 86 -15783 -3743 -28471 155 36 -8640 -9388 -30181 155 54 2854 166 -32642 155 106 -12035 9621 -28918 155 28 -13457 4643 -29513 155 20 3191 -4037 -32360 155 77 2135 -867 -32686 155 71 14682 19119 -22194 156 31 1009 9118 -31457 156 105 -7451 14434 -28457 156 41 -11147 11766 -28478 156 16 -18131 9093 -25735 156 27 10049 -4412 -30875 156 39 2010 4357 -32414 156 38 5512 13914 -29150 156 72 -6090 11739 -29980 156 18 -3954 4472 -32219 156 100 -11283 11208 -28649 156 80 -16707 15102 -23801 156 10 -14104 8881 -28212 156 88 -17720 2875 -27412 156 20 -12744 -5955 -29594 156 40 -1714 16154 -28457 156 20 -3976 19589 -25964 156 96 -12976 16043 -25454 156 14 -14562 10098 -27561 156 75 -22937 4745 -22915 156 103 -17920 -2351 -27332 156 98 15035 10519 -27147 156 98 -7917 13874 -28610 156 16 -10554 5523 -30525 156 21 -16512 7822 -27200 156 44 -22841 6122 -22682 156 16 -19441 2837 -26224 156 46 -7386 -8372 -30806 156 127 7108 -831 -31976 156 54 15606 16010 -23955 156 85 -2046 17242 -27789 156 84 -11769 18265 -24527 156 12 7918 10400 -30047 157 17 -15775 1632 -28673 157 16 -18810 -7058 -25885 157 26 -9815 -7618 -30320 157 70 14349 16718 -24255 157 82 1132 4142 -32484 157 66 -11748 16331 -25864 157 20 -6221 -2090 -32103 157 74 -10749 -8035 -29893 157 95 505 -9197 -31446 157 43 2817 22618 -23541 157 88 -6547 5619 -31611 157 19 392 -7976 -31779 157 82 16528 7690 -27228 157 65 3647 1661 -32521 157 50 6367 13300 -29262 157 16 -7607 18366 -26048 157 70 -9655 16584 -26560 157 13 -15191 15468 -24569 157 74 -15531 13182 -25665 157 47 -14733 -11670 -26841 157 44 -15574 -12332 -26058 157 75 -10552 -9890 -29403 157 56 -8464 8380 -30525 158 101 -13654 10440 -27897 158 105 -9485 -1340 -31336 158 76 -647 -5165 -32351 158 103 16395 2927 -28219 158 48 -11639 -133 -30630 158 16 -19699 -6533 -25356 158 19 -16146 -5418 -27993 158 74 -17191 -9307 -26297 158 20 -7529 -9486 -30447 158 71 1296 -8957 -31492 158 69 -13918 16427 -24700 158 10 -12730 1544 -30154 158 76 -15752 -3769 -28484 158 30 -12548 -4127 -29987 158 23 -9654 18467 -25287 158 75 -14893 15882 -24488 158 12 -10230 7956 -30095 158 20 -21646 8684 -23015 158 66 -16602 6204 -27560 158 13 -15930 5069 -28182 158 20 -19950 5614 -25380 158 29 -14730 322 -29268 158 30 -10690 -3466 -30780 158 41 -9645 -8741 -30071 158 16 -2000 -2205 -32631 158 17 3162 -3825 -32389 158 105 16707 12017 -25498 158 31 -16603 14744 -24096 158 18 -12045 9345 -29004 158 75 -15917 5873 -28033 158 102 -15488 4494 -28524 158 74 -14879 -804 -29183 158 34 -18062 -1736 -27284 158 99 -15642 -9346 -27233 158 81 13208 5142 -29543 159 98 15627 17422 -22934 159 42 11736 19069 -23923 159 82 -17519 10753 -25518 159 12 -14843 4362 -28885 159 108 -18315 -4317 -26826 159 86 -9721 -2447 -31196 159 76 -5144 -5153 -31948 159 73 18564 9757 -25177 159 27 6344 14434 -28724 159 97 594 17761 -27529 159 53 -14078 7965 -28497 159 33 -10769 17798 -25317 159 80 -15636 6881 -27961 159 36 -14476 -2030 -29326 159 34 -3661 -2022 -32499 159 93 -4467 -6493 -31805 159 18 709 -5513 -32292 159 78 6860 -3839 -31810 159 40 7214 9037 -30659 159 41 -5837 19326 -25809 159 70 -7339 17606 -26643 159 98 -22114 10492 -21784 159 17 -12417 1207 -30299 159 71 -19206 1620 -26499 159 103 -15897 -343 -28650 159 103 7102 667 -31981 159 90 -6441 18879 -25995 159 75 -10041 14182 -27780 159 16 -8353 11303 -29600 159 68 -5477 1944 -32247 159 16 -11395 -6636 -29996 159 38 14897 -173 -29184 159 26 15972 3012 -28452 160 86 -2068 19985 -25884 160 72 -21727 11234 -21804 160 82 13461 17641 -24110 160 26 -12096 9787 -28837 160 73 -10369 3086 -30929 160 19 -13842 2487 -29595 160 43 -15746 -4769 -28337 160 44 -15397 10602 -26911 160 14 -15820 6328 -27988 160 36 -15622 5069 -28354 160 34 -14369 -1727 -29398 160 24 -17917 -3414 -27221 160 16 -16176 -7797 -27408 160 16 -16536 -9218 -26744 160 59 -17222 -10927 -25645 160 17 -15898 -11530 -26230 160 75 5085 -5950 -31819 160 42 7410 -700 -31910 160 65 15823 6985 -27830 160 39 -12397 5299 -29865 160 24 -15940 -7333 -27673 160 77 -6477 -7229 -31297 160 20 -4453 16309 -28069 160 35 -4569 14055 -29245 160 19 -10773 18612 -24722 160 22 -12927 11308 -27905 160 15 -16573 3942 -27991 160 82 -17285 -6360 -27101 160 34 -7254 -4552 -31628 160 49 10899 10192 -29172 161 82 1714 11820 -30513 161 37 -12347 13118 -27371 161 19 -10018 -2829 -31069 161 22 -14080 -1748 -29536 161 21 -9507 -3428 -31170 161 88 -9507 -7819 -30367 161 45 -529 -2009 -32701 161 22 7767 -3383 -31653 161 52 8340 9764 -30146 161 26 8985 15363 -27513 161 42 2443 6565 -32010 161 75 4029 19753 -25832 161 90 675 6317 -32145 161 19 -6881 18814 -25930 161 41 -11811 15901 -26102 161 23 -8826 10108 -29893 161 30 -4060 4703 -32173 161 32 -10894 8609 -29680 161 28 -18725 11062 -24509 161 13 -20310 73 -25714 161 84 -2496 -25 -32672 161 84 -9396 -3554 -31189 161 24 -9300 -5954 -30850 161 107 10717 -3141 -30805 161 53 18651 2917 -26783 161 70 4983 2533 -32287 161 37 13962 7721 -28620 161 38 -8204 17795 -26263 161 15 -15231 9829 -27296 161 67 -12154 2290 -30343 161 108 -17643 447 -27608 161 22 -13474 -375 -29866 161 52 -13450 -1005 -29862 161 22 -18969 -6070 -26019 161 16 -9551 -6145 -30736 161 29 14846 2923 -29064 161 42 7372 23479 -21635 161 38 -8222 3022 -31574 161 105 -13011 -4527 -29730 161 42 -5975 -4569 -31892 161 79 -14969 -13385 -25893 161 24 -79 -7828 -31818 161 80 10918 -742 -30886 161 66 3579 23206 -22855 162 80 -15769 12770 -25728 162 48 -22098 8574 -22623 162 67 -15728 -761 -28735 162 40 -18029 -3409 -27148 162 18 8465 17881 -26120 162 44 -21454 8674 -23198 162 15 -9773 1360 -31246 162 28 -5606 -3254 -32119 162 22 -9642 -9207 -29932 162 17 17693 9910 -25738 162 44 11521 6631 -29950 162 78 8820 20556 -23945 162 43 492 21220 -24963 162 14 -9610 16415 -26681 162 18 -11976 9005 -29141 162 92 -14667 7391 -28354 162 16 -19628 8328 -24881 162 96 -14901 1050 -29164 162 23 -9965 -4581 -30877 162 91 -13908 -12216 -27037 162 17 17195 4771 -27481 162 67 5992 2594 -32110 162 68 2985 18014 -27208 162 15 2318 22094 -24086 162 78 -2138 10763 -30875 162 86 -3521 15875 -28448 162 43 -6633 7249 -31259 162 30 -13390 12644 -27102 162 12 -9710 8303 -30174 162 83 -22567 8344 -22244 162 53 -23286 6786 -22032 162 16 -15912 4427 -28300 162 75 -20733 4317 -25004 162 73 -12969 -5314 -29618 162 26 -15833 -10447 -26718 162 22 -12884 -11291 -27932 162 71 17433 11163 -25400 162 61 14569 15963 -24630 162 76 4792 16413 -27952 162 42 -7994 16104 -27394 162 40 -10815 18642 -24681 162 15 -8265 11681 -29477 162 66 -5801 7378 -31394 162 68 -17097 10153 -26044 162 14 -19646 10964 -23822 162 21 -22999 3809 -23026 162 66 -23802 3731 -22208 162 11 5831 -1335 -32216 162 27 10412 1528 -31031 163 32 -22076 9581 -22238 163 76 -8112 2278 -31665 163 96 -20718 5063 -24876 163 19 12348 -2270 -30266 163 88 7536 12551 -29315 163 75 -7206 12841 -29272 163 15 -5622 5052 -31883 163 75 -13492 7512 -28900 163 18 -16054 6371 -27846 163 38 -16778 -9332 -26553 163 24 19019 3784 -26413 163 46 15020 13077 -26020 163 24 7918 8478 -30645 163 71 7178 8867 -30717 163 44 -2094 15301 -28899 163 12 -16984 11514 -25547 163 15 -19568 5230 -25756 163 29 -17988 -2252 -27295 163 66 7004 -3572 -31810 163 70 5951 -2301 -32140 163 89 9027 -2059 -31432 163 91 5790 3205 -32092 163 42 8690 20808 -23774 163 73 -17924 9095 -25878 163 78 -16877 8298 -26833 163 12 -15176 4121 -28747 163 17 -17604 -114 -27637 163 20 -11605 -2310 -30556 163 54 -15647 -5155 -28325 163 50 -17501 12666 -24636 163 34 -11108 -620 -30821 163 62 -16166 -9885 -26732 163 32 -9349 -10021 -29763 163 94 2256 -3079 -32544 163 30 15720 7060 -27870 164 101 1064 19063 -26630 164 90 -2578 15404 -28805 164 51 -2856 6410 -32007 164 106 -4964 10154 -30756 164 17 -22136 9707 -22124 164 70 -15486 -5681 -28312 164 42 -14878 -5607 -28651 164 20 -3951 -5606 -32041 164 80 -7422 -11418 -29803 164 31 4902 -3466 -32212 164 43 1863 14280 -29433 164 31 -2911 19812 -25936 164 75 -16013 11553 -26149 164 73 -14217 7962 -28428 164 29 -8277 3653 -31493 164 24 -11839 4895 -30159 164 20 -2979 809 -32621 164 26 -19301 -6889 -25567 164 20 386 2953 -32631 164 19 -10045 5976 -30611 164 15 -17004 9652 -26294 164 14 -15385 8708 -27589 164 76 -10561 -4308 -30718 164 21 -11675 -6640 -29888 164 73 -5986 -5982 -31655 164 18 7286 -6598 -31258 164 74 13105 3678 -29806 164 102 14993 14241 -25418 164 99 -7487 15543 -27857 164 73 -11221 12785 -28006 164 16 -15663 5312 -28286 164 50 -23219 4629 -22652 164 101 -13356 -1196 -29897 164 18 11174 2600 -30693 164 48 -14154 9376 -28026 164 43 -14770 7200 -28349 164 30 -15951 -586 -28616 164 107 -14126 -881 -29552 164 26 -9766 -699 -31270 164 20 -15367 -1916 -28876 164 83 -15278 -2383 -28889 164 56 -12979 -11078 -27973 164 43 -2234 -10585 -30930 164 73 15520 4041 -28574 165 25 -14792 5810 -28655 165 90 -11924 -329 -30518 165 82 -20435 -1027 -25594 165 61 -13322 -12112 -27377 165 76 12385 4329 -30026 165 22 16110 12805 -25498 165 46 -21208 -4733 -24526 165 22 -18835 -4384 -26452 165 76 8070 23350 -21525 165 93 -8206 14676 -28124 165 124 -15259 5085 -28548 165 22 -12519 -2144 -30205 165 23 -1645 -8582 -31580 165 20 9796 8474 -30098 165 46 -4857 20218 -25324 165 70 -11553 7567 -29714 165 24 -10163 3484 -30956 165 30 -21422 1385 -24756 165 78 -22314 319 -23992 165 40 -21387 -2510 -24697 165 54 -12862 -2263 -30052 165 18 4532 18525 -26645 165 97 2225 9297 -31341 165 20 3067 19794 -25932 165 24 -1457 14454 -29371 165 100 -1569 14367 -29407 165 14 -4671 17850 -27078 165 78 -10327 7814 -30099 165 88 -22247 9944 -21906 165 64 -9351 3201 -31241 165 44 -8272 1473 -31671 165 18 856 -4590 -32433 165 14 2851 9486 -31234 166 46 -8192 18693 -25635 166 24 -9397 16029 -26990 166 12 -7688 12254 -29401 166 17 -14306 12053 -26902 166 15 -9855 -10701 -29361 166 23 -8038 -9637 -30269 166 16 3886 5374 -32089 166 77 7231 16278 -27503 166 53 1714 6420 -32086 166 96 -1772 13437 -29833 166 36 -11991 13996 -27093 166 79 10660 15888 -26601 166 72 -7745 12799 -29153 166 15 -13241 14705 -26117 166 15 -12591 10246 -28463 166 94 -18478 8946 -25538 166 97 -7233 2798 -31836 166 80 -19961 4783 -25541 166 68 -13365 -1480 -29881 166 68 -13848 -11676 -27305 166 79 -10552 -11590 -28775 166 52 1311 12968 -30063 166 16 -22401 4308 -23523 166 40 1723 15703 -28707 166 62 -10473 18286 -25092 166 50 -7976 9182 -30426 166 95 -13238 11550 -27659 166 72 -20079 4779 -25449 166 78 -10329 -11574 -28863 166 115 19244 760 -26510 167 57 5575 2640 -32181 167 67 -8239 16115 -27315 167 70 -8120 14111 -28436 167 17 -14455 12378 -26675 167 90 -5682 1725 -32224 167 93 -3923 326 -32530 167 74 -13559 -348 -29828 167 31 -2186 -245 -32693 167 74 -11331 -2104 -30673 167 59 -14003 -4542 -29274 167 42 5892 -1062 -32215 167 66 -10475 18286 -25091 167 50 -4697 8196 -31376 167 27 -11712 15059 -26641 167 86 -11345 13434 -27649 167 30 -7355 -3398 -31749 167 20 -14160 -8929 -28168 167 22 10500 -3346 -30858 167 24 824 19809 -26089 167 58 -8967 5380 -31054 167 16 -15878 7082 -27774 167 96 -10199 2192 -31062 167 88 -5781 1056 -32236 167 33 -6479 -394 -32118 167 82 115 -4849 -32406 167 95 539 14337 -29459 167 63 -11361 14859 -26904 167 60 -10388 12466 -28467 167 20 -16750 5471 -27626 167 101 -12407 -1259 -30301 167 64 -10652 -7857 -29974 167 26 11864 6705 -29799 167 65 11346 8555 -29526 167 18 11181 22326 -21218 167 93 6953 14312 -28644 167 24 -1800 9343 -31355 167 68 -10238 9705 -29575 167 88 -17564 10515 -25585 167 12 -20713 -730 -25379 167 18 -10768 -3677 -30728 167 80 -12408 -5369 -29848 167 19 6725 12564 -29506 168 52 -5864 11926 -29951 168 68 -9577 17455 -26025 168 20 -11921 12464 -27860 168 15 -15623 1970 -28735 168 46 -20870 -3117 -25068 168 43 3354 -2484 -32500 168 26 14039 16964 -24265 168 70 9437 21529 -22828 168 42 1624 22773 -23504 168 34 -5331 13055 -29578 168 98 -7476 16787 -27129 168 79 -13471 17370 -24300 168 12 -13762 14671 -25866 168 20 -6063 452 -32198 168 65 -16185 -10851 -26343 168 99 -13595 -9219 -28352 168 122 -7422 -11418 -29803 168 32 1427 -6738 -32035 168 50 2390 -4310 -32394 168 90 -13950 13579 -26357 168 16 -15098 7727 -28036 168 103 -16620 -3190 -28058 168 75 -12517 -7840 -29249 168 71 -12758 -10266 -28382 168 83 18825 3092 -26641 168 70 16698 5275 -27695 168 64 10524 7748 -30048 168 97 9507 12716 -28663 168 72 1528 2234 -32655 168 20 3711 12432 -30089 168 101 -1545 19781 -26077 168 93 -3812 16268 -28187 168 29 -13901 6980 -28839 168 15 -13552 3228 -29658 168 26 -9975 1756 -31162 168 22 -18660 -8992 -25389 168 103 6092 -3451 -32010 168 31 5063 -1072 -32356 168 95 13608 2193 -29727 168 83 5791 18630 -26326 168 50 -4862 21252 -24462 168 80 -9508 13844 -28136 168 40 -13347 7488 -28973 168 106 -15577 5570 -28284 168 24 -10403 -112 -31072 168 78 -17642 -2423 -27506 168 28 -15613 -7126 -27913 168 76 -14073 -8660 -28295 168 26 -3296 -2403 -32512 168 21 2154 18717 -26809 169 48 -1192 16728 -28150 169 50 -7355 15390 -27977 169 15 -14529 5970 -28757 169 108 -6935 1162 -32004 169 30 -19305 -5674 -25861 169 105 9505 22435 -21908 169 102 7027 19067 -25705 169 86 -10083 17758 -25625 169 32 -11621 17329 -25265 169 94 -12584 12068 -27743 169 32 -8913 -145 -31531 169 82 -6350 -9085 -30835 169 24 13890 20613 -21350 169 73 235 19523 -26315 169 94 -154 16335 -28405 169 99 -4587 17546 -27291 169 40 -13368 -10140 -28145 169 27 19 -2733 -32653 169 42 2368 -1783 -32633 169 90 12889 -1862 -30068 169 94 10335 16960 -26062 169 28 4746 13975 -29255 169 74 -1560 14573 -29306 169 53 -3831 18546 -26741 169 63 -5874 20062 -25233 169 50 -14793 9822 -27538 169 15 -10169 3475 -30955 169 32 -3371 11339 -30557 169 72 -346 1665 -32723 169 41 -12566 15143 -26200 169 15 -18518 -9058 -25470 169 14 -5788 -3938 -32010 169 91 4546 -3384 -32273 169 22 12575 -2776 -30130 169 68 -1771 17007 -27952 170 26 -15698 14416 -24888 170 29 -15833 9798 -26963 170 13 -6478 -2790 -31999 170 44 -656 -842 -32750 170 35 7957 554 -31781 170 70 12179 18200 -24374 170 71 3864 19716 -25885 170 80 -870 21236 -24939 170 46 -8156 -1410 -31704 170 24 -13539 -7839 -28791 170 36 -684 -9982 -31202 170 44 " +text Sdflux "9877139 9432595 9008058 8602629 8215447 7845691 7492576 7155355 6833311 6525761 6232054 5951565 5683700 5427892 5183596 4950296 4727496 4514724 4311528 4117477 3932160 3755184 3586173 3424768 3270628 3123426 2982848 2848598 2720390 2597952 2481025 2369361 2262722 2160883 2063627 1970748 1882050 1797344 1716450 1639197 1565421 1494966 1427681 1363425 1302061 1243458 1187493 1134047 1083007 1034263 987714 943259 900806 860263 821545 784569 749258 715535 683331 652576 623205 595156 568370 542789 518360 495030 472750 451472 431153 411748 393216 375518 358617 342477 327063 312343 298285 284860 272039 259795 248103 236936 226272 216088 206363 197075 188205 179734 171645 163920 156542 149497 142768 136342 130206 124346 118749 113405 108301 103426 98771 94326 90081 86026 82154 78457 74926 71554 68333 65258 62321 59516 56837 54279 51836 49503 47275 45147 43115 41175 39322 37552 35862 34248 32706 31234 29828 28486 27204 25980 24810 23694 22627 21609 20636 19707 18821 17973 17165 16392 15654 14950 14277 13634 13021 12435 11875 11340 10830 10343 9877 9433 9008 8603 8215 7846 7493 7155 6833 6526 6232 5952 5684 5428 5184 4950 4727 4515 4312 4117 3932 3755 3586 3425 3271 3123 2983 2849 2720 2598 2481 2369 2263 2161 2064 1971 1882 1797 1716 1639 1565 1495 1428 1363 1302 1243 1187 1134 1083 1034 988 943 901 860 822 785 749 716 683 653 623 595 568 543 518 495 473 451 431 412 393 376 359 342 327 312 298 285 272 260 248 237 226 216 206 197 188 180 172 164 157 149 143 136 130 124 119 113 108 103 99 94 90 86 82 78 " +text Sdpal "1623 2156 4096 1657 2185 4096 1691 2215 4096 1727 2245 4096 1763 2276 4096 1801 2307 4096 1839 2339 4096 1878 2371 4096 1918 2403 4096 1959 2436 4096 2000 2469 4096 2043 2503 4096 2087 2537 4096 2131 2572 4096 2177 2607 4096 2224 2643 4096 2272 2679 4096 2321 2715 4096 2371 2752 4096 2422 2790 4096 2474 2828 4096 2528 2867 4096 2582 2906 4096 2638 2945 4096 2695 2985 4096 2754 3026 4096 2813 3067 4096 2874 3109 4096 2937 3151 4096 3001 3194 4096 3066 3237 4096 3132 3281 4096 3201 3325 4096 3270 3371 4096 3341 3416 4096 3414 3462 4096 3488 3509 4096 3564 3557 4096 3642 3605 4096 3721 3654 4096 3802 3703 4096 3885 3753 4096 3970 3804 4096 4056 3855 4096 4096 3861 4048 4096 3830 3962 4096 3799 3877 4096 3768 3795 4096 3738 3714 4096 3708 3635 4096 3677 3557 4096 3648 3482 4096 3618 3408 4096 3589 3335 4096 3560 3264 4096 3531 3194 4096 3502 3126 4096 3474 3060 4096 3446 2995 4096 3418 2931 4096 3390 2869 4096 3363 2808 4096 3336 2748 4096 3309 2689 4096 3282 2632 4096 3256 2576 4096 3230 2521 4096 3204 2468 4096 3178 2415 4096 3153 2364 4096 3127 2313 4096 3102 2264 4096 3078 2216 4096 3053 2169 4096 3029 2123 4096 3004 2077 4096 2981 2033 4096 2957 1990 4096 2933 1947 4096 2910 1906 4096 2887 1865 4096 2864 1825 4096 2841 1786 4096 2819 1748 4096 2797 1711 4096 2775 1674 4096 2753 1638 4096 2731 1603 4096 2710 1569 4096 2689 1535 4096 2667 1502 4096 2647 1470 4096 2626 1438 4096 2605 1407 4096 2585 1377 4096 2565 1347 4096 2545 1318 4096 2525 1290 4096 2506 1262 4096 2486 1234 4096 2467 1208 4096 2448 1181 4096 2429 1156 4096 2410 1131 4096 2392 1106 4096 2373 1082 4096 2355 1058 4096 2337 1035 4096 2319 1012 4096 2301 990 4096 2284 968 4096 2266 947 4096 2249 926 4096 2232 905 4096 2215 885 4096 2198 865 4096 2181 846 4096 2165 827 4096 2148 809 4096 2132 790 4096 2116 773 4096 2100 755 4096 2084 738 4096 2068 721 4096 2053 705 4096 2037 689 4096 2022 673 4096 2007 658 " +text Sdgal "1794 11195 -30743 3732 3257 23970 16775162 9419 2207 -31306 1905 1255 58867 16644351 " +const SKNST ulong 1035 +const SKNGAL ulong 2 +global Skview long 14 +global Skstar long 3105 +global Skmag ulong 1035 +global Skbv ulong 1035 +global Skflux ulong 256 +global Skpal ulong 384 +global Skgal long 14 +global Skrdy ulong 1 +global Sdbuf uchar 65536 +global Sdpos ulong 1 +fn sdnext to long +p = get Sdpos 0 +while eq get Sdbuf p 32 bound 64 +p = add p 1 +end +m = false +if eq get Sdbuf p 45 +m = true +p = add p 1 +end +v = long 0 +b = ulong get Sdbuf p +while and ge b 48 le b 57 bound 20 +v = add mul v 10 long sub b 48 +p = add p 1 +b = ulong get Sdbuf p +end +put Sdpos 0 p +if m +ret neg v +end +ret v +end +fn skdview to void +n = len Sdview +for i ulong n +put Sdbuf i get Sdview i +end +put Sdbuf n 0 +put Sdpos 0 0 +for i ulong 14 +put Skview i sdnext +end +end +fn skdstars to void +n = len Sdstars +for i ulong n +put Sdbuf i get Sdstars i +end +put Sdbuf n 0 +put Sdpos 0 0 +for i ulong SKNST +j = mul i 3 +put Skstar j sdnext +put Skstar add j 1 sdnext +put Skstar add j 2 sdnext +put Skmag i ulong sdnext +put Skbv i ulong sdnext +end +end +fn skdflux to void +n = len Sdflux +for i ulong n +put Sdbuf i get Sdflux i +end +put Sdbuf n 0 +put Sdpos 0 0 +for i ulong 256 +put Skflux i ulong sdnext +end +end +fn skdpal to void +n = len Sdpal +for i ulong n +put Sdbuf i get Sdpal i +end +put Sdbuf n 0 +put Sdpos 0 0 +for i ulong 384 +put Skpal i ulong sdnext +end +end +fn skdgal to void +n = len Sdgal +for i ulong n +put Sdbuf i get Sdgal i +end +put Sdbuf n 0 +put Sdpos 0 0 +for i ulong 14 +put Skgal i sdnext +end +end +fn skinit to void +if ne get Skrdy 0 0 +ret +end +put Skrdy 0 1 +skdview +skdstars +skdflux +skdpal +skdgal +end diff --git a/native/omega/allen/look-stat.om b/native/omega/allen/look-stat.om new file mode 100644 index 00000000..eed2bc5c --- /dev/null +++ b/native/omega/allen/look-stat.om @@ -0,0 +1,148 @@ +note SPDX-License-Identifier: MIT +note Allen's look, the stopwatch: what a second of frames costs on the machine that runs the show. +note look-show.om stamps three clocks a frame (before the decision, after compose and conversion, +note after the blit); once a second the sums become one line +note STAT s= t= f= cc= bl= +note r= px= full= max= +note lens=x rip= kb= +note sent as one datagram to the courier's port (the relay drops anything that is not courier +note wire; tcpdump on the Spark reads it) and kept as Allen's answer to the typed line `stats`. +note Stw: 0 second start ms, 1 frames, 2 compose+convert ms, 3 blit ms, 4 rectangles, 5 pixels, +note 6 full redraws, 7 slowest frame ms, 8 seconds counted, 9 a line waits in Stt for the wire, +note 10 bytes blitted. +global Stw ulong 16 +global Stv ulong 16 +global Stt uchar 256 +global Sttn ulong 1 +global Stdig uchar 24 +text Stfmt "STAT s=# t=# f=# cc=# bl=# r=# px=# full=# max=# lens=#x# rip=# kb=#" +text Stkey "stats" +fn stput c uchar to void +n = get Sttn 0 +if lt n len Stt +put Stt n c +put Sttn 0 add n 1 +end +end +fn stnum v ulong to void +n = ulong 0 +while gt v 9 bound 24 +put Stdig n uchar rem v 10 +v = div v 10 +n = add n 1 +end +put Stdig n uchar v +n = add n 1 +for i ulong n +stput add uchar 48 get Stdig sub sub n 1 i +end +end +fn stdiff a ulong b ulong to ulong +note b - a, 0 when the clock failed or went backwards. +if or lt b a eq b 18446744073709551615 +ret 0 +end +ret sub b a +end +fn stline to void +note Stfmt with every # replaced by the next value of Stv. +put Sttn 0 0 +k = ulong 0 +for i ulong len Stfmt +c = get Stfmt i +if eq c 35 +stnum get Stv k +k = add k 1 +else +stput c +end +end +end +fn stsecond now ulong t ulong to void +put Stw 8 add get Stw 8 1 +put Stv 0 get Stw 8 +put Stv 1 t +put Stv 2 get Stw 1 +put Stv 3 get Stw 2 +put Stv 4 get Stw 3 +put Stv 5 get Stw 4 +put Stv 6 get Stw 5 +put Stv 7 get Stw 6 +put Stv 8 get Stw 7 +put Stv 9 ulong pkmax get Ntlens 2 0 +put Stv 10 ulong pkmax get Ntlens 3 0 +put Stv 11 ulong pkmax get Ntrip 0 0 +put Stv 12 div get Stw 10 1024 +stline +put Stw 9 1 +for i ulong 8 +put Stw i 0 +end +put Stw 0 now +put Stw 10 0 +end +fn stframe t0 ulong t1 ulong t2 ulong t ulong px ulong rf ulong to void +note One frame: t0 before the decision, t1 after compose and conversion, t2 after the blit; +note t is the show's clock, px the pixels composed, rf twice the rectangles plus 1 for a +note whole-screen redraw (six parameters is the language's limit). +if eq get Stw 0 0 +put Stw 0 t0 +end +put Stw 1 add get Stw 1 1 +put Stw 2 add get Stw 2 stdiff t0 t1 +put Stw 3 add get Stw 3 stdiff t1 t2 +put Stw 4 add get Stw 4 shr rf 1 +put Stw 5 add get Stw 5 px +put Stw 6 add get Stw 6 and rf 1 +d = stdiff t0 t2 +if gt d get Stw 7 +put Stw 7 d +end +if ge t2 add get Stw 0 1000 +stsecond t2 t +end +end +fn ststep up bool to void +note Offer the waiting line to the wire when the network is up and nothing is in flight; the +note courier's own datagrams are offered again on their clock, so one frame of delay is harmless. +if or eq get Stw 9 0 not up +ret +end +if ne get Ntxlen 0 0 +ret +end +n = get Sttn 0 +if or eq n 0 gt n 1472 +put Stw 9 0 +ret +end +ntxzero +for i ulong n +put Ntx add 42 i get Stt i +end +nudp 4294967295 47033 47033 n true +nqueue 7 add 42 n +put Stw 9 0 +end +fn stasked to bool +note True when the typed line is `stats`: the last line becomes what Allen says. +n = get Hminn 0 +if ne n len Stkey +ret false +end +for i ulong n +if ne get Hmin i get Stkey i +ret false +end +end +n = get Sttn 0 +if gt n len Hmsay +n = len Hmsay +end +for i ulong n +put Hmsay i get Stt i +end +put Hmsayn 0 n +hmsaid +ret true +end diff --git a/native/omega/allen/main.om b/native/omega/allen/main.om new file mode 100644 index 00000000..71a402ff --- /dev/null +++ b/native/omega/allen/main.om @@ -0,0 +1,146 @@ +note Development stdio boundary. Lines ASK, SAY, WAIT, CODE, CANCEL, RESET, +note and TIME milliseconds. stdout courier jobs; stderr actual visible text. +note No socket, clock, model, framebuffer, keyboard, filesystem or EFI provider. +global Input uchar 8192 +global Lstate ulong 3 +fn sendout fd int to bool +p = ulong 0 +while lt p get Outlen 0 +w = write fd Outb p sub get Outlen 0 p +if le w 0 +ret false +end +p = add p ulong w +end +ret true +end +fn display to bool +outreset +for i ulong get R 8 +emitb get Answer i +end +emitb 10 +ret sendout 2 +end +text Cmds "CANCELRESET" +fn isword off ulong size ulong to bool +if ne get Inlen 0 size +ret false +end +for i ulong size +if ne get In i get Cmds add off i +ret false +end +end +ret true +end +fn dispatch to bool +if isword 0 6 +cancel +ret true +end +if isword 6 5 +reset +ret true +end +if and ineq 0 84 ineq 1 73 +put P 0 5 +put P 2 0 +number +if or ne get P 2 0 ne get P 0 get Inlen 0 +ret false +end +if lt get P 1 get Lstate 2 +ret false +end +put Lstate 2 get P 1 +v = tick get Lstate 2 +ret true +end +if ineq 0 67 +if codetake +b = heard get C 0 get Lstate 2 +ret true +end +ret false +end +if or ineq 0 83 ineq 0 87 +v = saytake get Lstate 2 +if eq v 1 +if ne get S 1 0 +ret display +end +ret true +end +if eq v 2 +emitb 10 +ret sendout 1 +end +ret false +end +if and ineq 0 65 ineq 1 83 +if not and ineq 2 75 ineq 3 32 +ret false +end +n = sub get Inlen 0 4 +for i ulong n +put In i get In add i 4 +end +put Inlen 0 n +kind = classify +if not start kind get Lstate 2 +ret false +end +if gt kind 1 +codebeg get R 0 +b = display +end +if not jobbuild kind get R 0 +cancel +ret false +end +emitb 10 +ret sendout 1 +end +ret false +end +fn main to int +constants +while true +n = read 0 Input 0 len Input +if lt n 0 +ret 2 +end +if eq n 0 +if ne get Lstate 0 0 +ret 65 +end +ret 0 +end +for i ulong ulong n +c = get Input i +if eq c 10 +if eq get Lstate 1 0 +put Inlen 0 get Lstate 0 +b = dispatch +if not b +put Lstate 0 0 +ret 65 +end +else +put Lstate 1 0 +end +put Lstate 0 0 +else +if lt get Lstate 0 8192 +put In get Lstate 0 c +put Lstate 0 add get Lstate 0 1 +else +note Refuse immediately: no silent discard and no later command execution. +ret 65 +end +end +end +end +ret 0 +end diff --git a/native/omega/allen/memory.om b/native/omega/allen/memory.om new file mode 100644 index 00000000..08342ab6 --- /dev/null +++ b/native/omega/allen/memory.om @@ -0,0 +1,451 @@ +note Legacy application record codec; SHA is unkeyed integrity ONLY. +global Unit uchar 4096 +global Enc uchar 4096 +global Mem uchar 3692 +global Md ulong 3 +global Note uchar 128 +global Ns ulong 4 +text Magic "AIENALM1" +text Nmagic "AIENNOT1" +fn get32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Unit add off i mul i 8 +end +ret v +end +fn get64 off ulong to ulong +ret or get32 off shl get32 add off 4 32 +end +fn put32 off ulong v ulong to void +for i ulong 4 +put Unit add off i uchar and shr v mul i 8 255 +end +end +fn put64 off ulong v ulong to void +put32 off and v 4294967295 +put32 add off 4 shr v 32 +end +fn mem32 off ulong to ulong +v = ulong 0 +for i ulong 4 +v = or v shl ulong get Mem add off i mul i 8 +end +ret v +end +fn mset32 off ulong v ulong to void +for i ulong 4 +put Mem add off i uchar and shr v mul i 8 255 +end +end +fn zeroend off ulong to bool +for i ulong sub ulong 4096 off +if ne get Unit add off i 0 +ret false +end +end +ret true +end +fn fieldok off ulong cap ulong name bool to bool +n = ulong 0 +while lt n cap +if eq get Unit add off n 0 +for j ulong sub cap n +if ne get Unit add add off n j 0 +ret false +end +end +ret true +end +c = get Unit add off n +lower = and ge c 97 le c 122 +digit = isdigit c +if name +if eq n 0 +if not or and ge c 65 le c 90 digit +ret false +end +else +if not or lower digit +ret false +end +end +else +if eq c 32 +if or eq n 0 eq n sub cap 1 +ret false +end +if eq get Unit add off add n 1 0 +ret false +end +if eq get Unit add off sub n 1 32 +ret false +end +else +if not or lower digit +ret false +end +end +end +n = add n 1 +end +ret false +end +fn digest count ulong to void +hinit +for i ulong 32 +hbyte get Unit i +end +for i ulong count +hbyte get Unit add i 64 +end +finish +end +fn hashok count ulong to bool +digest count +d = uchar 0 +for i ulong 32 +d = or d xor get Hash i get Unit add i 32 +end +ret eq d 0 +end +fn seal count ulong to void +digest count +for i ulong 32 +put Unit add i 32 get Hash i +end +end +fn memvalid to bool +for i ulong 8 +if ne get Unit i get Magic i +ret false +end +end +ver = get32 8 +if or lt ver 2 gt ver 4 +ret false +end +n = get32 96 +if or gt n 32 gt get32 100 512 +ret false +end +size = add 40 mul n 113 +if ge ver 3 +size = add size 24 +end +if eq ver 4 +size = add size 12 +end +if or ne size get32 12 eq get64 16 0 +ret false +end +for i ulong 8 +if ne get Unit add i 24 0 +ret false +end +end +if not zeroend add 64 size +ret false +end +if not hashok size +ret false +end +if not fieldok 72 24 true +ret false +end +for i ulong n +off = add 104 mul i 113 +if or eq get Unit off 0 eq get Unit add off 48 0 +ret false +end +if not fieldok off 48 false +ret false +end +if not fieldok add off 48 64 false +ret false +end +if gt get Unit add off 112 1 +ret false +end +end +off = add 104 mul n 113 +if ge ver 3 +if not fieldok off 24 true +ret false +end +end +if eq ver 4 +if ne get Unit add off 27 0 +ret false +end +end +ret true +end +fn memdec to bool +if not memvalid +ret false +end +size = get32 12 +for i ulong 3692 +put Mem i 0 +end +for i ulong size +put Mem i get Unit add i 64 +end +put Md 0 get64 16 +put Md 1 get32 8 +put Md 2 size +ret true +end +fn memenc gen ulong to bool +n = mem32 32 +if or gt n 32 eq gen 0 +ret false +end +size = add 76 mul n 113 +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Magic i +end +put32 8 4 +put32 12 size +put64 16 gen +for i ulong size +put Unit add i 64 get Mem i +end +seal size +if not memvalid +ret false +end +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +fn noteval index ulong to bool +for i ulong 8 +if ne get Unit i get Nmagic i +ret false +end +end +n = get32 12 +if or eq n 0 ge n 128 +ret false +end +if or ne get32 8 1 ne get32 16 index +ret false +end +if or gt get32 24 1 ne get32 28 0 +ret false +end +if not zeroend add n 64 +ret false +end +for i ulong n +c = get Unit add i 64 +if or lt c 32 gt c 126 +ret false +end +end +ret hashok n +end +fn notedec index ulong to bool +if not noteval index +ret false +end +n = get32 12 +for i ulong 128 +put Note i 0 +end +for i ulong n +put Note i get Unit add i 64 +end +put Ns 0 n +put Ns 1 index +put Ns 2 get32 20 +put Ns 3 get32 24 +ret true +end +fn noteenc to bool +n = get Ns 0 +if or eq n 0 ge n 128 +ret false +end +if or gt get Ns 1 511 gt get Ns 2 4294967295 +ret false +end +if gt get Ns 3 1 +ret false +end +for i ulong n +c = get Note i +if or lt c 32 gt c 126 +ret false +end +end +for i ulong 4096 +put Unit i 0 +end +for i ulong 8 +put Unit i get Nmagic i +end +put32 8 1 +put32 12 n +put32 16 get Ns 1 +put32 20 get Ns 2 +put32 24 get Ns 3 +for i ulong n +put Unit add i 64 get Note i +end +seal n +for i ulong 4096 +put Enc i get Unit i +end +ret true +end +note Store St gen,newest,valid. Tx phase,target,newgen. Provider owns actual I/O. +global St ulong 3 +global Nt ulong 2 +global Load ulong 1 +global Tx ulong 3 +fn txbegin to bool +if ne get Nt 0 0 +ret false +end +if or ne get Tx 0 0 eq get St 0 18446744073709551615 +ret false +end +if not memenc add get St 0 1 +ret false +end +put Tx 1 0 +if ne get St 0 0 +put Tx 1 sub ulong 1 get St 1 +end +put Tx 2 add get St 0 1 +put Tx 0 1 +ret true +end +fn txwrite ok bool to bool +if ne get Tx 0 1 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 2 +ret true +end +fn txflush ok bool to bool +if ne get Tx 0 2 +ret false +end +if not ok +put Tx 0 0 +ret false +end +put Tx 0 3 +ret true +end +fn txread ok bool to bool +if ne get Tx 0 3 +ret false +end +put Tx 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Unit i get Enc i +end +if ne d 0 +ret false +end +put St 0 get Tx 2 +put St 1 get Tx 1 +if lt get St 2 2 +put St 2 add get St 2 1 +end +ret true +end +note Load each copy once into Unit. Caller resets St and calls loadcopy0,1. +fn loadbeg to void +for i ulong 3 +put St i 0 +end +put Load 0 0 +end +fn loadcopy slot ulong to bool +if gt slot 1 +ret false +end +if ne and get Load 0 shl ulong 1 slot 0 +ret false +end +if not memvalid +ret false +end +put Load 0 or get Load 0 shl ulong 1 slot +put St 2 add get St 2 1 +if gt get64 16 get St 0 +b = memdec +put St 0 get Md 0 +put St 1 slot +end +ret true +end +note Note transaction completes before the parent copy may publish its count. +fn nbegin to bool +if or ne get Nt 0 0 ne get Tx 0 0 +ret false +end +if not noteenc +ret false +end +put Nt 1 get Ns 1 +put Nt 0 1 +ret true +end +fn nwrite ok bool to bool +if ne get Nt 0 1 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 2 +ret true +end +fn nflush ok bool to bool +if ne get Nt 0 2 +ret false +end +if not ok +put Nt 0 0 +ret false +end +put Nt 0 3 +ret true +end +fn nread ok bool to bool +if ne get Nt 0 3 +ret false +end +put Nt 0 0 +if not ok +ret false +end +d = uchar 0 +for i ulong 4096 +d = or d xor get Enc i get Unit i +end +if ne d 0 +ret false +end +ret noteval get Nt 1 +end diff --git a/native/omega/allen/net.om b/native/omega/allen/net.om new file mode 100644 index 00000000..8fcf8f74 --- /dev/null +++ b/native/omega/allen/net.om @@ -0,0 +1,1845 @@ +note Native bounded single HTTPS client. RFC826/791/768/2131/2132/1035/9293/6298. +note Caller provides Ethernet frames without FCS, checked monotonic milliseconds, +note six-byte unicast Nmac before netinit, and 32 fresh EFI entropy bytes in +note Nrand before every netconnect. netconnect consumes and wipes Nrand: DHCP xid, +note IPv4 id, DNS id/port, TCP port and ISN are never reused across connections. +note netwrite true transfers a copy, not a peer ACK. netsent is firmware acceptance. +note Public state 0idle 1DHCP 2DNS 3SYN 4open 5EOF/closed 6error. +note Errors: 1clock 2MAC/entropy 3DHCPtimeout 4DHCPnak 5config 6conflict +note 7ARPtimeout 8DNStimeout 9DNSrefused/truncated 10DNSinvalid/empty +note 11TCPtimeout 12peerreset 13unsupportedTCP 14leaseexpired 15transmit +note 16establishdeadline 17callerbounds. Invalid unrelated packets are ignored. +note Limits: untagged Ethernet MTU1500, IPv4 without options/fragments, +note DHCP lease without renewal, 120s establishment, DNS A/CNAME <=8 links, +note 64 DNS records/UDP message, one stop-and-wait TCP segment, receive64KiB. +note No DNS-over-TCP or EDNS: truncation fails; lease expiry fails explicitly. +note A bound lease is reused by later netconnect calls; anything else restarts DHCP. +note Internal Ncfg slots: now,dhcp,ip,mask,router,dns,server,offer,xid,leaseMS, +note leaseAt,initAt,dhcpDue,dhcpTries,probeCount,want,connectAt,generation, +note ipid,dnsid,dnsport,tcpport,dnsDue,dnsTries,cnameHops,qnameLen, +note arpWanted,arpCached,arpDue,arpTries,arpAt,initialized. +global Nrx uchar 2048 +global Ntx uchar 2048 +global Ntxlen ulong 1 +global Nmac uchar 6 +global Nrand uchar 32 +global Tcpin uchar 65536 +global Tcpout uchar 65536 +global Tcpn ulong 1 +global Tcpstate ulong 8 +global Ncfg ulong 32 +note Nct: una,next,rcvnxt,ringHead,peerwin,wl1,wl2,mss,ackPending, +note flightLen,flightKind(1syn2data3fin),flightSent,flightSeq,sentAt,rto, +note retries,sendTotal,sendOffset,closeWanted,finAcked,peerFin,finPending, +note finSeq,activity,timewaitAt,iss,srtt,rttvar,rttValid,zeroAt,synRetried. +global Nct ulong 32 +global Nsbuf uchar 65536 +global Nrbuf uchar 65536 +global Nrmap uchar 65536 +global Nhop uchar 6 +global Narp uchar 6 +global Napip ulong 1 +note Queue kind 1DHCP 2ARPquery 3ARPreply 4DNS 5TCPflight 6TCPack 7courierUDP. +note Kind 7 (look-chat.om, netudpsend) is fire-and-forget: netsent only clears it, +note no retry bookkeeping; the courier scheduler resends on its own clock. +note Q1 failures Q2 queuedAt Q3 DHCP/ARP phase Q4 seq Q5 ack Q6 window Q7 generation. +global Nq ulong 8 +note Parsed packet: frameLen,ipHlen,ipLen,src,dst,l4off,l4len,seq,ack, +note flags,dataOff,dataLen,window,tcpHlen. +global Npk ulong 16 +note Ndrop: reason code of the last segment refused before the payload path. Diagnosis only. +global Ndrop ulong 1 +note Ndropt/Ndropd/Ndropw: length, start offset and window of the last accepted segment. +global Ndropt ulong 1 +global Ndropd ulong 1 +global Ndropw ulong 1 +global Nopt ulong 8 +note DNS decoder base,end,next,nameLen,answerStart,answerCount,rrNext,rrData. +global Nd ulong 8 +global Nname uchar 256 +global Nwant uchar 256 +global Nrr ulong 4 +note Courier UDP hooks (look-chat.om): one datagram body out in Chtx, one in +note Chrx/Chrxn (0 = empty slot); a second arrival before chstep consumed the +note slot is dropped and counted in Chdrop. Port 47033 both ways, like the C +note kernel (x86/courier_udp.h CK_COURIER_PORT); source 0.0.0.0 before a lease. +global Chtx uchar 1600 +global Chrx uchar 1600 +global Chrxn ulong 1 +global Chdrop ulong 1 +text Nhost "api.github.com" +fn nr16 p ulong to ulong +ret add shl ulong get Nrx p 8 ulong get Nrx add p 1 +end +fn nr32 p ulong to ulong +ret add shl nr16 p 16 nr16 add p 2 +end +fn nt16 p ulong v ulong to void +put Ntx p uchar and shr v 8 255 +put Ntx add p 1 uchar and v 255 +end +fn nt32 p ulong v ulong to void +nt16 p shr v 16 +nt16 add p 2 and v 65535 +end +fn nadd a ulong b ulong to ulong +ret and add a b 4294967295 +end +fn ndiff a ulong b ulong to ulong +ret and sub add a 4294967296 b 4294967295 +end +fn nlt a ulong b ulong to bool +ret gt ndiff a b 2147483647 +end +fn nfold s ulong to ulong +while gt s 65535 bound 8 +s = add and s 65535 shr s 16 +end +ret xor s 65535 +end +fn nrsum p ulong n ulong to ulong +s = ulong 0 +while ge n 2 bound 1024 +s = add s nr16 p +p = add p 2 +n = sub n 2 +end +if eq n 1 +s = add s shl ulong get Nrx p 8 +end +ret s +end +fn ntsum p ulong n ulong to ulong +s = ulong 0 +while ge n 2 bound 1024 +s = add s shl ulong get Ntx p 8 +s = add s ulong get Ntx add p 1 +p = add p 2 +n = sub n 2 +end +if eq n 1 +s = add s shl ulong get Ntx p 8 +end +ret s +end +fn npssum a ulong b ulong proto ulong n ulong to ulong +s = add shr a 16 and a 65535 +s = add s shr b 16 +s = add s and b 65535 +ret add add s proto n +end +fn nipok ip ulong to bool +if or eq ip 0 eq ip 4294967295 +ret false +end +x = shr ip 24 +ret and ne x 0 and ne x 127 lt x 224 +end +fn nmacrx p ulong to bool +v = uchar 0 +for i ulong 6 +v = or v get Nrx add p i +end +ret and ne v 0 eq and get Nrx p 1 0 +end +fn nmaceq p ulong to bool +for i ulong 6 +if ne get Nrx add p i get Nmac i +ret false +end +end +ret true +end +fn nwipe to void +for i ulong 65536 +put Tcpin i uchar 0 +put Tcpout i uchar 0 +put Nsbuf i uchar 0 +put Nrbuf i uchar 0 +put Nrmap i uchar 0 +end +put Tcpn 0 0 +end +fn nfail code ulong to void +put Tcpstate 0 6 +put Tcpstate 1 code +put Ntxlen 0 0 +for i ulong 2048 +put Ntx i uchar 0 +end +for i ulong 32 +put Nrand i uchar 0 +put Nct i 0 +end +nwipe +end +fn nclock now ulong to bool +if or lt now get Ncfg 0 gt now 1000000000000000000 +nfail 1 +ret false +end +put Ncfg 0 now +ret true +end +fn ntxzero to void +for i ulong 1514 +put Ntx i uchar 0 +end +end +fn neth typ ulong broad bool to void +for i ulong 6 +if broad +put Ntx i uchar 255 +else +put Ntx i get Nhop i +end +put Ntx add i 6 get Nmac i +end +nt16 12 typ +end +fn nqueue kind ulong n ulong to void +if lt n 60 +n = 60 +end +put Ntxlen 0 n +put Nq 0 kind +put Nq 1 0 +put Nq 2 get Ncfg 0 +put Nq 7 get Ncfg 17 +end +fn nipbuild dest ulong proto ulong n ulong broad bool to void +neth 2048 broad +put Ntx 14 uchar 69 +nt16 16 add n 20 +nt16 18 get Ncfg 18 +put Ncfg 18 and add get Ncfg 18 1 65535 +nt16 20 16384 +put Ntx 22 uchar 64 +put Ntx 23 uchar proto +nt32 26 get Ncfg 2 +nt32 30 dest +nt16 24 nfold ntsum 14 20 +end +fn nudp dest ulong srcp ulong dstp ulong n ulong broad bool to void +nt16 34 srcp +nt16 36 dstp +nt16 38 add n 8 +s = npssum get Ncfg 2 dest 17 add n 8 +s = nfold add s ntsum 34 add n 8 +if eq s 0 +s = 65535 +end +nt16 40 s +nipbuild dest 17 add n 8 broad +end +note Courier datagram out: Chtx[0..n) to 255.255.255.255:47033 from Ncfg2:47033 +note in a broadcast frame, queued as kind 7 only when nothing else is in flight. +note Error state 6 does not refuse it: the courier has no TCP, DHCP or DNS +note dependency, so Allen keeps answering after a failed repository session. +note false: not queued, the courier scheduler offers the same datagram again on +note its own clock. +fn netudpsend n ulong to bool +if ne get Ntxlen 0 0 +ret false +end +if or eq n 0 gt n 1472 +ret false +end +ntxzero +for i ulong n +put Ntx add 42 i get Chtx i +end +nudp 4294967295 47033 47033 n true +nqueue 7 add 42 n +ret true +end +fn narpout target ulong probe bool to void +ntxzero +neth 2054 true +nt16 14 1 +nt16 16 2048 +put Ntx 18 uchar 6 +put Ntx 19 uchar 4 +nt16 20 1 +for i ulong 6 +put Ntx add i 22 get Nmac i +end +if not probe +nt32 28 get Ncfg 2 +end +nt32 38 target +put Nq 3 get Ncfg 1 +nqueue 2 42 +end +fn narprepl to void +ntxzero +neth 2054 false +for i ulong 6 +put Ntx i get Narp i +put Ntx add i 32 get Narp i +put Ntx add i 22 get Nmac i +end +nt16 14 1 +nt16 16 2048 +put Ntx 18 uchar 6 +put Ntx 19 uchar 4 +nt16 20 2 +nt32 28 get Ncfg 2 +nt32 38 get Napip 0 +put Napip 0 0 +nqueue 3 42 +end +fn nroute dest ulong to bool +if ne and dest get Ncfg 3 and get Ncfg 2 get Ncfg 3 +dest = get Ncfg 4 +end +if eq dest 0 +nfail 5 +ret false +end +if eq get Ncfg 27 dest +if lt sub get Ncfg 0 get Ncfg 30 60000 +ret true +end +put Ncfg 27 0 +end +if ne get Ncfg 26 dest +put Ncfg 26 dest +put Ncfg 29 0 +put Ncfg 28 get Ncfg 0 +end +if ge get Ncfg 0 get Ncfg 28 +if ge get Ncfg 29 5 +nfail 7 +ret false +end +narpout dest false +end +ret false +end +fn ndhcpout to void +ntxzero +put Ntx 42 uchar 1 +put Ntx 43 uchar 1 +put Ntx 44 uchar 6 +nt32 46 get Ncfg 8 +nt16 50 div sub get Ncfg 0 get Ncfg 11 1000 +nt16 52 32768 +for i ulong 6 +put Ntx add i 70 get Nmac i +end +nt32 278 1669485411 +put Ntx 282 uchar 53 +put Ntx 283 uchar 1 +mt = uchar 1 +if eq get Ncfg 1 2 +mt = 3 +end +if eq get Ncfg 1 5 +mt = 4 +end +put Ntx 284 mt +p = ulong 285 +if ne mt 1 +put Ntx p uchar 50 +put Ntx add p 1 uchar 4 +nt32 add p 2 get Ncfg 7 +put Ntx add p 6 uchar 54 +put Ntx add p 7 uchar 4 +nt32 add p 8 get Ncfg 6 +p = add p 12 +end +put Ntx p uchar 61 +put Ntx add p 1 uchar 7 +put Ntx add p 2 uchar 1 +for i ulong 6 +put Ntx add add p 3 i get Nmac i +end +p = add p 9 +note RFC2131 table 5: DHCPDECLINE carries no parameter list or size option. +if ne mt 4 +put Ntx p uchar 55 +put Ntx add p 1 uchar 6 +put Ntx add p 2 uchar 1 +put Ntx add p 3 uchar 3 +put Ntx add p 4 uchar 6 +put Ntx add p 5 uchar 51 +put Ntx add p 6 uchar 58 +put Ntx add p 7 uchar 59 +put Ntx add p 8 uchar 57 +put Ntx add p 9 uchar 2 +nt16 add p 10 1472 +p = add p 12 +end +put Ntx p uchar 255 +p = add p 1 +if lt p 342 +p = 342 +end +nudp 4294967295 68 67 sub p 42 true +put Nq 3 get Ncfg 1 +nqueue 1 p +end +fn ndnsout to void +ntxzero +nt16 42 get Ncfg 19 +nt16 44 256 +nt16 46 1 +for i ulong get Ncfg 25 +put Ntx add i 54 get Nwant i +end +p = add 54 get Ncfg 25 +nt16 p 1 +nt16 add p 2 1 +nudp get Ncfg 5 get Ncfg 20 53 sub add p 4 42 false +nqueue 4 add p 4 +end +fn nwindow to ulong +ret sub 65535 get Tcpn 0 +end +fn ntcpout flight bool to void +ntxzero +nt16 34 get Ncfg 21 +nt16 36 443 +nt32 38 get Nct 1 +nt32 42 get Nct 2 +put Ntx 46 uchar 80 +put Ntx 47 uchar 16 +nt16 48 nwindow +n = ulong 20 +if flight +nt32 38 get Nct 12 +if eq get Nct 10 1 +put Ntx 46 uchar 96 +put Ntx 47 uchar 2 +nt32 42 0 +put Ntx 54 uchar 2 +put Ntx 55 uchar 4 +nt16 56 1460 +n = 24 +else +if eq get Nct 10 3 +put Ntx 47 uchar 17 +else +put Ntx 47 uchar 24 +n = add n get Nct 9 +for i ulong get Nct 9 +put Ntx add i 54 get Nsbuf add get Nct 17 i +end +end +end +end +s = npssum get Ncfg 2 get Tcpstate 2 6 n +nt16 50 nfold add s ntsum 34 n +nipbuild get Tcpstate 2 6 n false +put Nq 4 get Nct 12 +put Nq 5 get Nct 2 +put Nq 6 nwindow +if flight +nqueue 5 add n 34 +else +nqueue 6 add n 34 +end +end +note DHCP option fields are parsed atomically before changing lease state. +fn ndopt code ulong p ulong n ulong to bool +slot = ulong 8 +if eq code 53 +slot = 0 +end +if eq code 54 +slot = 1 +end +if eq code 1 +slot = 2 +end +if eq code 3 +slot = 3 +end +if eq code 6 +slot = 4 +end +if eq code 51 +slot = 5 +end +if eq code 52 +slot = 7 +end +if eq slot 8 +ret true +end +if ne and get Nopt 6 shl ulong 1 slot 0 +ret false +end +put Nopt 6 or get Nopt 6 shl ulong 1 slot +if or eq slot 0 eq slot 7 +if ne n 1 +ret false +end +put Nopt slot ulong get Nrx p +ret true +end +if or eq slot 3 eq slot 4 +if or lt n 4 ne rem n 4 0 +ret false +end +else +if ne n 4 +ret false +end +end +put Nopt slot nr32 p +ret true +end +fn ndopts p ulong stop ulong to bool +while lt p stop bound 2048 +code = ulong get Nrx p +p = add p 1 +if eq code 255 +ret true +end +if ne code 0 +if ge p stop +ret false +end +n = ulong get Nrx p +p = add p 1 +if gt n sub stop p +ret false +end +if not ndopt code p n +ret false +end +p = add p n +end +end +ret false +end +fn ndconf to bool +m = get Ncfg 3 +if or eq m 0 eq m 4294967295 +ret false +end +v = xor m 4294967295 +if ne and v add v 1 0 +ret false +end +v = and get Ncfg 7 xor m 4294967295 +if or eq v 0 eq v xor m 4294967295 +ret false +end +if not nipok get Ncfg 4 +ret false +end +if ne and get Ncfg 4 m and get Ncfg 7 m +ret false +end +if not nipok get Ncfg 5 +ret false +end +ret ge get Ncfg 9 10000 +end +fn ndcopy to void +if ne get Nopt 2 0 +put Ncfg 3 get Nopt 2 +end +if ne get Nopt 3 0 +put Ncfg 4 get Nopt 3 +end +if ne get Nopt 4 0 +put Ncfg 5 get Nopt 4 +end +if ne get Nopt 5 0 +put Ncfg 9 mul get Nopt 5 1000 +end +end +fn ndhcpin to void +p = add get Npk 5 8 +n = sub get Npk 6 8 +if lt n 240 +ret +end +if or ne get Nrx p 2 ne get Nrx add p 1 1 +ret +end +if ne get Nrx add p 2 6 +ret +end +if ne nr32 add p 4 get Ncfg 8 +ret +end +if not nmaceq add p 28 +ret +end +if ne nr32 add p 236 1669485411 +ret +end +for i ulong 8 +put Nopt i 0 +end +if not ndopts add p 240 add p n +ret +end +if gt get Nopt 7 3 +ret +end +if ne and get Nopt 7 1 0 +if not ndopts add p 108 add p 236 +ret +end +end +if ne and get Nopt 7 2 0 +if not ndopts add p 44 add p 108 +ret +end +end +if not nipok get Nopt 1 +ret +end +if eq get Ncfg 1 1 +if ne get Nopt 0 2 +ret +end +if not nipok nr32 add p 16 +ret +end +put Ncfg 7 nr32 add p 16 +put Ncfg 6 get Nopt 1 +ndcopy +put Ncfg 1 2 +put Ncfg 13 0 +put Ncfg 12 get Ncfg 0 +ret +end +if ne get Ncfg 1 2 +ret +end +if ne get Nopt 1 get Ncfg 6 +ret +end +if eq get Nopt 0 6 +nfail 4 +ret +end +if ne get Nopt 0 5 +ret +end +if ne nr32 add p 16 get Ncfg 7 +ret +end +ndcopy +if not ndconf +nfail 5 +ret +end +put Ncfg 10 get Ncfg 0 +put Ncfg 1 3 +put Ncfg 14 0 +put Ncfg 12 add get Ncfg 0 rem get Ncfg 8 1000 +end +fn narpin to void +if lt get Npk 0 42 +ret +end +if or ne nr16 14 1 ne nr16 16 2048 +ret +end +if or ne get Nrx 18 6 ne get Nrx 19 4 +ret +end +if or lt nr16 20 1 gt nr16 20 2 +ret +end +if not nmacrx 22 +ret +end +for i ulong 6 +if ne get Nrx add i 6 get Nrx add i 22 +ret +end +end +if nmaceq 22 +ret +end +if eq get Ncfg 1 3 +if or eq nr32 28 get Ncfg 7 and eq nr32 28 0 eq nr32 38 get Ncfg 7 +put Ncfg 1 5 +put Ncfg 12 get Ncfg 0 +end +ret +end +if ne get Ncfg 1 4 +ret +end +if eq nr32 28 get Ncfg 2 +nfail 6 +ret +end +if ne nr32 38 get Ncfg 2 +ret +end +if eq nr16 20 2 +if not nmaceq 32 +ret +end +if or eq get Ncfg 26 0 ne nr32 28 get Ncfg 26 +ret +end +for i ulong 6 +put Nhop i get Nrx add i 22 +end +put Ncfg 27 get Ncfg 26 +put Ncfg 26 0 +put Ncfg 30 get Ncfg 0 +ret +end +if nipok nr32 28 +if eq get Napip 0 0 +for i ulong 6 +put Narp i get Nrx add i 22 +end +put Napip 0 nr32 28 +end +end +end +note DNS names expand to lowercase wire labels, never textual pointer arithmetic. +note Compression pointers must point backward into this message, with <=128 hops. +fn ndname p ulong to bool +used = ulong 0 +next = ulong 0 +for hop ulong 256 +if ge p get Nd 1 +ret false +end +c = ulong get Nrx p +if eq and c 192 192 +if ge add p 1 get Nd 1 +ret false +end +q = add get Nd 0 and nr16 p 16383 +if or ge q p lt q add get Nd 0 12 +ret false +end +if eq next 0 +next = add p 2 +end +p = q +else +if ne and c 192 0 +ret false +end +p = add p 1 +if or gt add used add c 1 255 gt c sub get Nd 1 p +ret false +end +put Nname used uchar c +used = add used 1 +if eq c 0 +if eq next 0 +next = p +end +put Nd 2 next +put Nd 3 used +ret true +end +for i ulong c +v = get Nrx add p i +if and ge v 65 le v 90 +v = add v 32 +end +put Nname used v +used = add used 1 +end +p = add p c +end +end +ret false +end +fn ndmatch to bool +if ne get Nd 3 get Ncfg 25 +ret false +end +for i ulong get Nd 3 +if ne get Nname i get Nwant i +ret false +end +end +ret true +end +fn ndrr p ulong to bool +if not ndname p +ret false +end +p = get Nd 2 +if gt add p 10 get Nd 1 +ret false +end +put Nrr 0 nr16 p +put Nrr 1 nr16 add p 2 +put Nrr 2 nr16 add p 8 +put Nrr 3 nr32 add p 4 +p = add p 10 +if gt get Nrr 2 sub get Nd 1 p +ret false +end +put Nd 7 p +put Nd 6 add p get Nrr 2 +ret true +end +fn ndtarget to void +for i ulong get Nd 3 +put Nwant i get Nname i +end +put Ncfg 25 get Nd 3 +put Ncfg 24 add get Ncfg 24 1 +end +fn ndanswer to void +for pass ulong 9 +p = get Nd 4 +changed = false +for i ulong get Nd 5 +if not ndrr p +nfail 10 +ret +end +p = get Nd 6 +if and eq get Nrr 1 1 ndmatch +if eq get Nrr 0 1 +if ne get Nrr 2 4 +nfail 10 +ret +end +if not nipok nr32 get Nd 7 +nfail 10 +ret +end +put Tcpstate 2 nr32 get Nd 7 +put Tcpstate 0 3 +put Nct 9 1 +put Nct 10 1 +put Nct 11 0 +put Nct 12 get Nct 25 +put Nct 0 get Nct 25 +put Nct 1 get Nct 25 +put Nct 14 1000 +put Nct 15 0 +ret +end +if eq get Nrr 0 5 +if ge get Ncfg 24 8 +nfail 10 +ret +end +if not ndname get Nd 7 +nfail 10 +ret +end +if ne get Nd 2 p +nfail 10 +ret +end +if ndmatch +nfail 10 +ret +end +ndtarget +changed = true +break +end +end +end +if not changed +if eq pass 0 +nfail 10 +ret +end +put Ncfg 19 and add get Ncfg 19 1 65535 +put Ncfg 22 get Ncfg 0 +put Ncfg 23 0 +ret +end +end +nfail 10 +end +fn ndnsin to void +p = add get Npk 5 8 +if lt get Npk 6 20 +ret +end +if ne nr16 p get Ncfg 19 +ret +end +if ne and nr16 add p 2 63488 32768 +ret +end +if ne nr16 add p 4 1 +ret +end +put Nd 0 p +put Nd 1 add get Npk 5 get Npk 6 +if not ndname add p 12 +ret +end +if not ndmatch +ret +end +q = get Nd 2 +if gt add q 4 get Nd 1 +ret +end +if or ne nr16 q 1 ne nr16 add q 2 1 +ret +end +if ne and nr16 add p 2 527 0 +nfail 9 +ret +end +put Nd 4 add q 4 +put Nd 5 nr16 add p 6 +n = add get Nd 5 nr16 add p 8 +n = add n nr16 add p 10 +if gt n 64 +nfail 10 +ret +end +q = get Nd 4 +for i ulong n +if not ndrr q +nfail 10 +ret +end +q = get Nd 6 +end +if ne q get Nd 1 +nfail 10 +ret +end +ndanswer +end +fn nrtt to void +if ne get Nct 15 0 +ret +end +r = sub get Ncfg 0 get Nct 13 +if eq r 0 +r = 1 +end +if eq get Nct 28 0 +put Nct 26 r +put Nct 27 div r 2 +put Nct 28 1 +else +d = get Nct 26 +if ge d r +d = sub d r +else +d = sub r d +end +put Nct 27 div add mul get Nct 27 3 d 4 +put Nct 26 div add mul get Nct 26 7 r 8 +end +r = add get Nct 26 mul get Nct 27 4 +if lt r 1000 +r = 1000 +end +if gt r 60000 +r = 60000 +end +if and ne get Nct 30 0 lt r 3000 +r = 3000 +end +put Nct 14 r +end +fn ntopts p ulong stop ulong to bool +while lt p stop bound 40 +kind = ulong get Nrx p +if eq kind 0 +ret true +end +if eq kind 1 +p = add p 1 +else +if ge add p 1 stop +ret false +end +n = ulong get Nrx add p 1 +if or lt n 2 gt n sub stop p +ret false +end +if eq kind 2 +if ne n 4 +ret false +end +n = nr16 add p 2 +if eq n 0 +ret false +end +if gt n 1460 +n = 1460 +end +put Nct 7 n +n = 4 +end +p = add p n +end +end +ret true +end +fn ntaccept to bool +n = get Npk 11 +if ne and get Npk 9 1 0 +n = add n 1 +end +w = nwindow +if eq n 0 +if eq w 0 +ret eq get Npk 7 get Nct 2 +end +ret lt ndiff get Npk 7 get Nct 2 w +end +if eq w 0 +ret false +end +if lt ndiff get Npk 7 get Nct 2 w +ret true +end +ret lt ndiff nadd get Npk 7 sub n 1 get Nct 2 w +end +fn ntack to bool +a = get Npk 8 +if nlt get Nct 1 a +put Nct 8 1 +ret false +end +if nlt a get Nct 0 +ret true +end +if or nlt get Nct 5 get Npk 7 and eq get Nct 5 get Npk 7 not nlt a get Nct 6 +put Nct 4 get Npk 12 +put Nct 5 get Npk 7 +put Nct 6 a +end +if eq a get Nct 0 +ret true +end +if or eq get Nct 9 0 eq get Nct 11 0 +ret false +end +n = ndiff a get Nct 0 +if gt n get Nct 9 +ret false +end +if eq n get Nct 9 +nrtt +end +if eq get Nct 10 2 +for i ulong n +put Nsbuf add get Nct 17 i uchar 0 +end +put Nct 17 add get Nct 17 n +end +put Nct 0 a +put Nct 12 a +put Nct 9 sub get Nct 9 n +put Nct 13 get Ncfg 0 +if ne get Nct 9 0 +note Partial ACK retains Karn ambiguity for the remaining bytes. +put Nct 15 1 +ret true +end +if eq get Nct 10 3 +put Nct 19 1 +end +put Nct 10 0 +put Nct 11 0 +put Nct 15 0 +if eq get Nct 17 get Nct 16 +put Nct 17 0 +put Nct 16 0 +end +ret true +end +fn ntfinish to void +if and ne get Nct 19 0 ne get Nct 20 0 +if eq get Nct 24 0 +put Nct 24 add get Ncfg 0 1 +end +put Tcpstate 0 5 +end +end +fn ntdrain to void +while ne get Nrmap get Nct 3 0 bound 65536 +if ge get Tcpn 0 65535 +break +end +if ne get Nct 20 0 +break +end +if and ne get Nct 21 0 eq get Nct 22 get Nct 2 +break +end +put Tcpin get Tcpn 0 get Nrbuf get Nct 3 +put Tcpn 0 add get Tcpn 0 1 +put Nrmap get Nct 3 uchar 0 +put Nrbuf get Nct 3 uchar 0 +put Nct 3 and add get Nct 3 1 65535 +put Nct 2 nadd get Nct 2 1 +end +if and ne get Nct 21 0 eq get Nct 22 get Nct 2 +put Nct 2 nadd get Nct 2 1 +put Nct 21 0 +put Nct 20 1 +put Nct 18 1 +put Nct 8 1 +put Tcpstate 0 5 +end +ntfinish +end +fn ntdata to void +if ne get Nct 20 0 +put Nct 8 1 +ret +end +note Out-of-order bytes are stored directly in the ring and drained once the gap fills. +note This deliberately does not borrow Nct 21/22, which hold the peer FIN state: doing so +note made a retransmitted in-order segment look like a FIN and stalled the stream. +for i ulong get Npk 11 +s = nadd get Npk 7 i +d = ndiff s get Nct 2 +if lt d nwindow +p = and add get Nct 3 d 65535 +v = get Nrx add get Npk 10 i +if eq get Nrmap p 0 +put Nrbuf p v +put Nrmap p uchar 1 +else +if ne get Nrbuf p v +nfail 13 +ret +end +end +end +end +if or ne get Npk 11 0 ne and get Npk 9 1 0 +put Nct 8 1 +end +ntdrain +end +fn ntsynin to void +if eq get Nct 11 0 +ret +end +if ne get Npk 8 nadd get Nct 25 1 +ret +end +if eq and get Npk 9 20 20 +nfail 12 +ret +end +if ne and get Npk 9 23 18 +ret +end +if ne get Npk 11 0 +nfail 13 +ret +end +if not ntopts add get Npk 5 20 get Npk 10 +ret +end +nrtt +put Nct 0 get Npk 8 +put Nct 1 get Npk 8 +put Nct 2 nadd get Npk 7 1 +put Nct 4 get Npk 12 +put Nct 5 get Npk 7 +put Nct 6 get Npk 8 +put Nct 9 0 +put Nct 10 0 +put Nct 11 0 +put Nct 15 0 +put Nct 8 1 +put Nct 23 get Ncfg 0 +put Tcpstate 0 4 +end +fn ntcpin to void +p = get Npk 5 +if lt get Npk 6 20 +ret +end +if or ne nr16 p 443 ne nr16 add p 2 get Ncfg 21 +ret +end +if ne get Npk 3 get Tcpstate 2 +put Ndrop 0 12 +ret +end +s = npssum get Npk 3 get Npk 4 6 get Npk 6 +if ne nfold add s nrsum p get Npk 6 0 +put Ndrop 0 13 +ret +end +put Npk 13 mul ulong shr get Nrx add p 12 4 4 +if or lt get Npk 13 20 gt get Npk 13 get Npk 6 +put Ndrop 0 14 +ret +end +note RFC9293: the four reserved header bits are ignored on receipt. +put Npk 7 nr32 add p 4 +put Npk 8 nr32 add p 8 +put Npk 9 ulong get Nrx add p 13 +put Npk 10 add p get Npk 13 +put Npk 11 sub get Npk 6 get Npk 13 +put Npk 12 nr16 add p 14 +if eq get Tcpstate 0 3 +ntsynin +ret +end +if or lt get Tcpstate 0 4 gt get Tcpstate 0 5 +put Ndrop 0 15 +ret +end +if ne get Nct 31 0 +put Ndrop 0 16 +ret +end +if ne and get Npk 9 4 0 +if eq get Npk 7 get Nct 2 +nfail 12 +else +if ntaccept +put Nct 8 1 +end +end +ret +end +if not ntaccept +put Nct 8 1 +if and ne get Nct 24 0 ne and get Npk 9 1 0 +if eq nadd get Npk 7 add get Npk 11 1 get Nct 2 +put Nct 24 add get Ncfg 0 1 +end +end +ret +end +if ne and get Npk 9 2 0 +put Nct 8 1 +ret +end +if eq and get Npk 9 16 0 +ret +end +note CWR/ECE are ignored (ECN was not offered); urgent data is refused. +if ne and get Npk 9 32 0 +nfail 13 +ret +end +if not ntack +put Ndrop 0 1 +ret +end +put Ndropt 0 get Npk 11 +put Ndropd 0 ndiff get Npk 7 get Nct 2 +put Ndropw 0 nwindow +put Nct 23 get Ncfg 0 +ntdata +if ne and get Npk 9 1 0 +note FIN occupies one sequence number after the payload. Latch it; ntdrain completes it when +note the stream reaches it, in order or after the gap fills. +put Nct 21 1 +put Nct 22 nadd get Npk 7 get Npk 11 +ntdrain +end +end +note Courier datagram in (UDP to port 47033, checksum already verified). Like +note the C kernel (courier_udp_x86.c pump) the frame is ours by its Ethernet +note destination (netinput: our MAC or ff:ff:ff:ff:ff:ff) and the port alone: +note any IPv4 destination is taken, so the relay's --udp-answer 192.168.1.255 +note reaches a kernel that has no lease yet. Copied into Chrx when the slot is +note free, else dropped and counted. Any source port. +fn netudpin p ulong to void +n = sub get Npk 6 8 +if or eq n 0 gt n len Chrx +ret +end +if ne get Chrxn 0 0 +put Chdrop 0 add get Chdrop 0 1 +ret +end +for i ulong n +put Chrx i get Nrx add add p 8 i +end +put Chrxn 0 n +end +fn nipin to void +if lt get Npk 0 34 +ret +end +if ne shr get Nrx 14 4 4 +ret +end +put Npk 1 mul ulong and get Nrx 14 15 4 +if lt get Npk 1 20 +ret +end +put Npk 2 nr16 16 +if or lt get Npk 2 get Npk 1 gt add get Npk 2 14 get Npk 0 +ret +end +if ne and nr16 20 49151 0 +ret +end +if eq get Nrx 22 0 +ret +end +if ne nfold nrsum 14 get Npk 1 0 +ret +end +note All IPv4 options are refused; no source-route or hidden forwarding path. +if ne get Npk 1 20 +ret +end +put Npk 3 nr32 26 +put Npk 4 nr32 30 +if not nipok get Npk 3 +ret +end +put Npk 5 add 14 get Npk 1 +put Npk 6 sub get Npk 2 get Npk 1 +if eq get Nrx 23 6 +if ne get Tcpstate 0 6 +if and eq get Ncfg 1 4 eq get Npk 4 get Ncfg 2 +ntcpin +end +end +ret +end +if ne get Nrx 23 17 +ret +end +p = get Npk 5 +if lt get Npk 6 8 +ret +end +if ne nr16 add p 4 get Npk 6 +ret +end +if ne nr16 add p 6 0 +s = npssum get Npk 3 get Npk 4 17 get Npk 6 +if ne nfold add s nrsum p get Npk 6 0 +ret +end +end +if and eq nr16 p 67 eq nr16 add p 2 68 +if ne get Tcpstate 0 6 +if or eq get Ncfg 1 1 eq get Ncfg 1 2 +note Any destination: chaddr, random xid and server-id gate acceptance. +ndhcpin +end +end +ret +end +if eq nr16 add p 2 47033 +netudpin p +ret +end +if ne get Tcpstate 0 2 +ret +end +if or ne get Npk 4 get Ncfg 2 ne get Npk 3 get Ncfg 5 +ret +end +if or ne nr16 p 53 ne nr16 add p 2 get Ncfg 20 +ret +end +ndnsin +end +fn nrnd32 p ulong to ulong +v = ulong 0 +for i ulong 4 +v = add shl v 8 ulong get Nrand add p i +end +ret v +end +fn nqhost to void +put Nwant 0 uchar 3 +put Nwant 4 uchar 6 +put Nwant 11 uchar 3 +put Nwant 15 uchar 0 +for i ulong 3 +put Nwant add i 1 get Nhost i +put Nwant add i 12 get Nhost add i 11 +end +for i ulong 6 +put Nwant add i 5 get Nhost add i 4 +end +put Ncfg 25 16 +end +fn netinit now ulong to void +put Ntxlen 0 0 +nwipe +for i ulong 32 +put Ncfg i 0 +put Nct i 0 +put Nrand i uchar 0 +end +for i ulong 8 +put Tcpstate i 0 +put Nq i 0 +end +put Napip 0 0 +for i ulong 6 +put Nhop i uchar 0 +put Narp i uchar 0 +end +if not nclock now +ret +end +v = uchar 0 +for i ulong 6 +v = or v get Nmac i +end +if or eq v 0 ne and get Nmac 0 1 0 +nfail 2 +ret +end +put Ncfg 31 1 +end +fn nbound to bool +if or ne get Ncfg 1 4 lt get Ncfg 14 5 +ret false +end +ret lt sub get Ncfg 0 get Ncfg 10 get Ncfg 9 +end +fn ndhcpnew to void +for i ulong 14 +put Ncfg add i 1 0 +end +for i ulong 5 +put Ncfg add i 26 0 +end +put Ncfg 8 nrnd32 0 +put Ncfg 1 1 +put Ncfg 11 get Ncfg 0 +put Ncfg 12 get Ncfg 0 +end +fn netconnect now ulong to void +if not nclock now +ret +end +if eq get Ncfg 31 0 +nfail 17 +ret +end +if and ge get Tcpstate 0 1 le get Tcpstate 0 4 +ret +end +v = uchar 0 +for i ulong 32 +v = or v get Nrand i +end +if eq v 0 +nfail 2 +ret +end +note A queued frame from an older generation is completed, never reinterpreted. +g = add get Ncfg 17 1 +nwipe +for i ulong 32 +put Nct i 0 +end +for i ulong 8 +put Tcpstate i 0 +end +for i ulong 10 +put Ncfg add i 15 0 +end +put Napip 0 0 +put Ncfg 17 g +put Ncfg 18 and nrnd32 20 65535 +put Ncfg 19 and nrnd32 4 65535 +put Ncfg 20 add 49152 rem nrnd32 8 16384 +put Ncfg 21 add 49152 rem nrnd32 16 16384 +put Nct 25 nrnd32 12 +put Nct 7 536 +put Nct 14 1000 +if nbound +put Tcpstate 0 2 +put Ncfg 22 now +else +ndhcpnew +put Tcpstate 0 1 +end +for i ulong 32 +put Nrand i uchar 0 +end +put Ncfg 15 1 +put Ncfg 16 now +nqhost +end +note Error state 6 freezes DHCP, DNS and TCP until the next netconnect. Courier +note datagrams on port 47033 still arrive, and ARP for a bound lease is still +note answered so a relay's unicast answer to the leased address can reach us. +fn netinput n ulong now ulong to void +if not nclock now +ret +end +if or lt n 14 gt n 1514 +ret +end +if not nmacrx 6 +ret +end +if nmaceq 6 +ret +end +note Any frame for us counts as activity: the mode-3 idle check in netstep must not be a +note connection-lifetime cap, or a long transfer dies mid-body with failure 14. +put Ncfg 10 now +if not nmaceq 0 +for i ulong 6 +if ne get Nrx i 255 +ret +end +end +end +put Npk 0 n +if eq nr16 12 2054 +if or ne get Tcpstate 0 6 eq get Ncfg 1 4 +narpin +end +end +if eq nr16 12 2048 +nipin +end +end +fn netwrite n ulong now ulong to bool +if not nclock now +ret false +end +if gt n 65536 +nfail 17 +ret false +end +if or ne get Tcpstate 0 4 ne get Nct 18 0 +ret false +end +if ne get Nct 16 0 +ret false +end +if eq n 0 +ret true +end +for i ulong n +put Nsbuf i get Tcpout i +end +put Nct 16 n +put Nct 17 0 +put Nct 29 now +ret true +end +fn netconsume n ulong to void +if gt n get Tcpn 0 +nfail 17 +ret +end +if eq n 0 +ret +end +left = sub get Tcpn 0 n +for i ulong left +put Tcpin i get Tcpin add i n +end +for i ulong n +put Tcpin add left i uchar 0 +end +put Tcpn 0 left +put Nct 8 1 +ntdrain +end +fn netclose now ulong to void +if not nclock now +ret +end +if eq get Tcpstate 0 6 +ret +end +if lt get Tcpstate 0 4 +put Tcpstate 0 5 +put Nct 31 1 +nwipe +ret +end +put Nct 18 1 +put Tcpstate 0 5 +end +fn nstepset to void +if eq get Ncfg 1 5 +ndhcpout +ret +end +if or eq get Ncfg 1 1 eq get Ncfg 1 2 +if ge sub get Ncfg 0 get Ncfg 11 60000 +nfail 3 +ret +end +if ge get Ncfg 0 get Ncfg 12 +if ge get Ncfg 13 5 +nfail 3 +else +ndhcpout +end +end +ret +end +if eq get Ncfg 1 3 +if lt get Ncfg 0 get Ncfg 12 +ret +end +if lt get Ncfg 14 3 +narpout get Ncfg 7 true +ret +end +put Ncfg 2 get Ncfg 7 +put Ncfg 1 4 +end +if ne get Ncfg 1 4 +ret +end +if lt get Ncfg 14 5 +if ge get Ncfg 0 get Ncfg 12 +narpout get Ncfg 2 false +put Nq 3 6 +end +ret +end +if eq get Tcpstate 0 1 +put Tcpstate 0 2 +put Ncfg 22 get Ncfg 0 +end +end +fn nstepdns to void +if lt get Ncfg 0 get Ncfg 22 +ret +end +if ge get Ncfg 23 4 +nfail 8 +ret +end +if nroute get Ncfg 5 +ndnsout +end +end +fn nflight kind ulong n ulong to void +put Nct 9 n +put Nct 10 kind +put Nct 11 0 +put Nct 12 get Nct 1 +put Nct 15 0 +end +fn nsteptcp to void +if ne get Nct 24 0 +if ge sub add get Ncfg 0 1 get Nct 24 120000 +put Nct 31 1 +put Nct 8 0 +ret +end +end +if ne get Nct 31 0 +ret +end +note FIN-WAIT-2 is bounded: our FIN is acknowledged, the peer stays silent. +if and ne get Nct 19 0 eq get Nct 20 0 +if ge sub get Ncfg 0 get Nct 23 60000 +put Nct 31 1 +ret +end +end +if ne get Nct 8 0 +if nroute get Tcpstate 2 +ntcpout false +end +ret +end +if ne get Nct 9 0 +if ne get Nct 11 0 +if lt sub get Ncfg 0 get Nct 13 get Nct 14 +ret +end +if ge get Nct 15 6 +nfail 11 +ret +end +end +if nroute get Tcpstate 2 +ntcpout true +end +ret +end +if eq get Tcpstate 0 3 +ret +end +if ne get Nct 16 0 +n = sub get Nct 16 get Nct 17 +if gt n get Nct 7 +n = get Nct 7 +end +if gt n get Nct 4 +n = get Nct 4 +end +if eq n 0 +if lt sub get Ncfg 0 get Nct 29 1000 +ret +end +note A one-byte persist probe is retained and retransmitted, never discarded. +n = 1 +end +nflight 2 n +else +if and ne get Nct 18 0 eq get Nct 19 0 +nflight 3 1 +else +ret +end +end +if nroute get Tcpstate 2 +ntcpout true +end +end +fn netstep now ulong to void +if not nclock now +ret +end +if or eq get Tcpstate 0 6 ne get Nct 31 0 +ret +end +if ge get Ncfg 1 3 +if and ne get Ncfg 9 0 ge sub now get Ncfg 10 get Ncfg 9 +nfail 14 +ret +end +end +if and ne get Ncfg 15 0 lt get Tcpstate 0 4 +if ge sub now get Ncfg 16 120000 +nfail 16 +ret +end +end +if ne get Ntxlen 0 0 +if ge sub now get Nq 2 10000 +nfail 15 +end +ret +end +nstepset +if or eq get Tcpstate 0 6 ne get Ntxlen 0 0 +ret +end +if lt get Ncfg 14 5 +ret +end +if ne get Napip 0 0 +narprepl +ret +end +if eq get Tcpstate 0 2 +nstepdns +end +if and ge get Tcpstate 0 3 le get Tcpstate 0 5 +nsteptcp +end +end +fn nqdhcp to void +if ne get Nq 3 get Ncfg 1 +ret +end +if eq get Ncfg 1 5 +nfail 6 +ret +end +d = add 3000 rem get Ncfg 8 2001 +d = mul d shl ulong 1 get Ncfg 13 +if gt d 16000 +d = 16000 +end +put Ncfg 13 add get Ncfg 13 1 +put Ncfg 12 add get Ncfg 0 d +end +fn nqarp to void +if eq get Nq 3 3 +if ne get Ncfg 1 3 +ret +end +put Ncfg 14 add get Ncfg 14 1 +d = add 1000 rem get Ncfg 8 1001 +if eq get Ncfg 14 3 +d = 2000 +end +put Ncfg 12 add get Ncfg 0 d +ret +end +if eq get Nq 3 6 +put Ncfg 14 add get Ncfg 14 1 +put Ncfg 12 add get Ncfg 0 2000 +ret +end +put Ncfg 28 add get Ncfg 0 mul 1000 shl ulong 1 get Ncfg 29 +put Ncfg 29 add get Ncfg 29 1 +end +fn nqflight to void +if or eq get Nct 9 0 ne get Nq 4 get Nct 12 +ret +end +if ne get Nct 11 0 +put Nct 15 add get Nct 15 1 +r = mul get Nct 14 2 +if gt r 60000 +r = 60000 +end +put Nct 14 r +if eq get Nct 10 1 +put Nct 30 1 +end +end +put Nct 11 1 +put Nct 13 get Ncfg 0 +put Nct 1 nadd get Nct 12 get Nct 9 +end +fn netsent ok bool now ulong to void +if not nclock now +ret +end +if eq get Ntxlen 0 0 +ret +end +if not ok +put Nq 1 add get Nq 1 1 +if ge get Nq 1 8 +nfail 15 +end +ret +end +put Ntxlen 0 0 +note Kind 7 (courier UDP) ends here: nothing to retry or acknowledge. +if ne get Nq 7 get Ncfg 17 +ret +end +if eq get Nq 0 1 +nqdhcp +end +if eq get Nq 0 2 +nqarp +end +if eq get Nq 0 4 +d = mul 2000 shl ulong 1 get Ncfg 23 +put Ncfg 23 add get Ncfg 23 1 +put Ncfg 22 add now d +end +if eq get Nq 0 5 +nqflight +end +if or eq get Nq 0 5 eq get Nq 0 6 +if and eq get Nq 5 get Nct 2 eq get Nq 6 nwindow +put Nct 8 0 +end +end +end diff --git a/native/omega/allen/paint.om b/native/omega/allen/paint.om new file mode 100644 index 00000000..ea0f79a2 --- /dev/null +++ b/native/omega/allen/paint.om @@ -0,0 +1,100 @@ +note Handwritten Omega port of paint.h ck_add, ck_scale, ck_mix and paint.c ck_glow. +note Bounded192x128 RAM canvas. This is rendering core, not full sky/font/device UI. +global Frame uint 24576 +global G ulong 6 +global Fb uchar 73728 +fn channel c uint shift uint to uint +ret and shr c shift 255 +end +fn addcolor d uint c uint a uint to uint +v = uint 0 +for i uint 3 +s = mul i 8 +n = add channel d s shr mul channel c s a 8 +if gt n 255 +n = 255 +end +v = or v shl n s +end +ret v +end +fn scale c uint f uint to uint +ret or and shr mul and c 16711935 f 8 16711935 and shr mul and c 65280 f 8 65280 +end +fn mix d uint c uint a uint to uint +if ge a 256 +ret c +end +ret add scale d sub uint 256 a scale c a +end +fn distance x ulong y ulong to ulong +dx = sub add mul long x 16 8 long get G 0 +dy = sub add mul long y 16 8 long get G 1 +ret ulong add mul dx dx mul dy dy +end +fn weight d2 ulong r2 ulong to ulong +inv = div ulong 1099511627776 r2 +f = sub ulong 256 shr mul d2 inv 32 +w = shr mul shr mul f f 8 f 8 +ret shr mul w get G 4 8 +end +fn glowpix x ulong y ulong to void +d2 = distance x y +r2 = mul get G 2 get G 2 +if ge d2 r2 +ret +end +a = uint weight d2 r2 +at = add mul y 192 x +put Frame at addcolor get Frame at uint get G 3 a +end +fn glow cx ulong cy ulong radius ulong color ulong alpha ulong to bool +if or eq radius 0 gt radius 8192 +ret false +end +if or gt cx 8192 gt cy 8192 +ret false +end +if or gt color 16777215 gt alpha 512 +ret false +end +put G 0 cx +put G 1 cy +put G 2 radius +put G 3 color +put G 4 alpha +for y ulong 128 +for x ulong 192 +glowpix x y +end +end +ret true +end +fn render to void +for i ulong 24576 +put Frame i 0 +end +note Frozen component pose; same halo and heart colors/weights as ck_mind_draw. +b = glow 1536 1024 1088 3951314 68 +b = glow 1536 1024 640 7363839 46 +b = glow 1536 1024 400 16765610 89 +b = glow 1536 1024 160 16772310 218 +b = glow 1536 1024 50 16775920 230 +end +fn frameout to bool +for i ulong 24576 +c = get Frame i +put Fb mul i 3 uchar channel c 16 +put Fb add mul i 3 1 uchar channel c 8 +put Fb add mul i 3 2 uchar channel c 0 +end +n = ulong 0 +while lt n len Fb +w = write 1 Fb n sub len Fb n +if le w 0 +ret false +end +n = add n ulong w +end +ret true +end diff --git a/native/omega/allen/platform.om b/native/omega/allen/platform.om new file mode 100644 index 00000000..a9c1ff48 --- /dev/null +++ b/native/omega/allen/platform.om @@ -0,0 +1,10 @@ +note SPDX-License-Identifier: MIT +note State shared between the firmware platform loop and the on-screen workflow. +note Declared once, before both, because Omega globals must precede their use. +note Es: width,height,scale,left,top,MAC ready,network ready,dirty,epoch base,ms base, +note pointer drag rows,last firmware error,last network retry. +global Es ulong 16 +global Dmo ulong 4 +global Dprm uchar 160 +global Dprmn ulong 1 +global Dstat ulong 1 diff --git a/native/omega/allen/presentation.om b/native/omega/allen/presentation.om new file mode 100644 index 00000000..d752c1e0 --- /dev/null +++ b/native/omega/allen/presentation.om @@ -0,0 +1,156 @@ +note Stable application presentation; see PRESENTATION.md for scope and ownership. +global Ds ulong 8 +global Dt ulong 64 +global Dtext uchar 2304 +global Dsay ulong 1 +global Dm ulong 3 +global Dcode uchar 32768 +global Dstart ulong 4096 +global Dlen ulong 4096 +global Dline ulong 4096 +global Dview ulong 3 +global Din uchar 8192 +fn dscene to bool +n = get Inlen 0 +for i ulong 8192 +put Din i get In i +end +for i ulong get R 8 +put In i get Answer i +end +put Inlen 0 get R 8 +ok = scdecode +for i ulong 8192 +put In i get Din i +end +put Inlen 0 n +if not ok +ret false +end +for i ulong 8 +put Ds i get Sc i +end +for i ulong 64 +put Dt i get Things i +end +for i ulong 2304 +put Dtext i 0 +end +for i ulong get Sc 4 +put Dtext i get Stext i +end +put Dsay 0 get Sw 3 +put Dm 0 1 +ret true +end +fn dcode to bool +if or le get R 2 1 ne get R 1 0 +ret false +end +if or eq get R 6 0 ne get C 0 get R 0 +ret false +end +if not rows 80 4096 +ret false +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong get C 2 +put Dcode i get Code i +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong get View 0 +put Dstart i get Rowst i +put Dlen i get Rowlen i +put Dline i get Rowline i +end +put Dview 0 get View 0 +put Dview 1 0 +put Dview 2 get C 2 +put Dm 1 1 +ret true +end +fn dpresent to bool +if or eq get A 0 0 ne get A 2 1 +ret false +end +if or gt get R 8 159 gt get Inlen 0 8192 +ret false +end +shown = dscene +coded = dcode +if or shown coded +put Dm 2 get R 0 +ret true +end +ret false +end +fn dask now ulong to bool +if not appask now +ret false +end +b = dpresent +ret true +end +fn drecv now ulong to bool +if not appreceive now +ret false +end +b = dpresent +ret true +end +fn dreset to void +appreset +for i ulong 8 +put Ds i 0 +end +for i ulong 64 +put Dt i 0 +end +for i ulong 2304 +put Dtext i 0 +end +put Dsay 0 0 +for i ulong 3 +put Dm i 0 +put Dview i 0 +end +for i ulong 32768 +put Dcode i 0 +end +for i ulong 4096 +put Dstart i 0 +put Dlen i 0 +put Dline i 0 +end +for i ulong 8192 +put Din i 0 +end +end +fn cvspan beg ulong size ulong x long y long color ulong to bool +if not cvargs x y color +ret false +end +if gt beg len Dtext +ret false +end +if gt size sub len Dtext beg +ret false +end +pen = mul x 256 +origin = pen +for i ulong size +if not afglyph get Dtext add beg i +ret false +end +cvblit affloor pen y color +pen = add pen long get Af 5 +end +put Cv 7 ulong sub pen origin +ret true +end diff --git a/native/omega/allen/provider-core.om b/native/omega/allen/provider-core.om new file mode 100644 index 00000000..7a308177 --- /dev/null +++ b/native/omega/allen/provider-core.om @@ -0,0 +1,256 @@ +note Host provider stream core. PROVIDER.md is the framing/state contract. +global Ph uchar 40 +global Pb uchar 4096 +global Pv ulong 4 +global Pc ulong 2 +global Pe ulong 2 +global Pout uchar 65536 +global Pn ulong 1 +text Prmagic "ALNPRV01" +fn prshape to bool +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +n = get Pv 3 +if eq op 1 +ret and gt arg 0 eq n 0 +end +if eq op 2 +if ne arg 0 +ret false +end +ret and gt n 0 le n 159 +end +if or eq op 3 eq op 4 +ret and le arg 1 eq n 0 +end +if eq op 5 +if ne arg 0 +ret false +end +ret and ge n 65 le n 1200 +end +if ne now 0 +ret false +end +if or eq op 6 eq op 7 +ret and eq arg 0 eq n 0 +end +if eq op 8 +ret and le arg 1 eq n 4096 +end +if eq op 9 +ret and le arg 511 eq n 4096 +end +if eq op 10 +ret and eq arg 0 eq n 0 +end +ret false +end +fn prparse to bool +for i ulong 8 +if ne get Ph i get Prmagic i +ret false +end +end +for k ulong 4 +v = ulong 0 +for i ulong 8 +off = add add 8 mul k 8 i +v = or v shl ulong get Ph off mul i 8 +end +put Pv k v +end +ret prshape +end +fn prbyte c uchar to void +put Pout get Pn 0 c +put Pn 0 add get Pn 0 1 +end +fn prword v ulong to void +for i ulong 8 +prbyte uchar and shr v mul i 8 255 +end +end +fn prhead op ulong status ulong event ulong size ulong to void +for i ulong 8 +prbyte get Prmagic i +end +prword op +prword status +prword event +prword size +end +fn prreply status ulong to void +put Pn 0 0 +kind = get Pe 1 +size = ulong 0 +if eq kind 1 +size = get Outlen 0 +end +if eq kind 2 +size = get R 8 +end +prhead get Pv 0 status get Pe 0 size +for i ulong size +if eq kind 1 +prbyte get Outb i +else +prbyte get Answer i +end +end +if eq kind 2 +if and gt get R 2 1 eq get R 1 0 +if and ne get R 6 0 eq codestat 2 +prhead 11 1 1 get C 2 +for i ulong get C 2 +prbyte get Code i +end +end +end +end +end +fn prevent to void +put Pe 0 get A 2 +if eq get A 2 1 +put Pe 1 2 +end +end +fn prload to ulong +if or ne get A 0 0 not ctxidle +ret 0 +end +constants +for i ulong 3692 +put Mem i 0 +end +loadbeg +b = ctxbegin +put Pc 0 1 +put Pc 1 0 +ret 1 +end +fn prcopy to ulong +if or ne get A 0 0 ne get Pc 0 1 +ret 0 +end +if not ctxidle +ret 0 +end +slot = get Pv 2 +bit = shl ulong 1 slot +if ne and get Pc 1 bit 0 +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ulong 2 +if loadcopy slot +status = 1 +end +put Pc 1 or get Pc 1 bit +if eq get Pc 1 3 +if not ctxbegin +ret 0 +end +put Pc 0 2 +if ne get Cx 2 0 +put Pc 0 3 +end +end +ret status +end +fn prnote to ulong +if or ne get A 0 0 ne get Pc 0 2 +ret 0 +end +if not ctxidle +ret 0 +end +for i ulong 4096 +put Unit i get Pb i +end +status = ctxtake get Pv 2 +if ne get Cx 2 0 +put Pc 0 3 +end +ret status +end +fn prapply to ulong +op = get Pv 0 +now = get Pv 1 +arg = get Pv 2 +if eq op 10 +ret prload +end +if eq op 8 +ret prcopy +end +if eq op 9 +ret prnote +end +if eq op 1 +if or eq get Pc 0 1 eq get Pc 0 2 +ret 0 +end +if appinit arg now +ret 1 +end +ret 0 +end +if eq get A 0 0 +ret 0 +end +if eq op 6 +appcancel +ret 1 +end +if eq op 7 +dreset +ret 1 +end +if not appclock now +ret 0 +end +if eq op 3 +offer = apppoll now ne arg 0 +prevent +if offer +put Pe 1 1 +ret 3 +end +ret 1 +end +if eq op 4 +if appsent now ne arg 0 +ret 1 +end +ret 0 +end +for i ulong get Pv 3 +put In i get Pb i +end +put Inlen 0 get Pv 3 +if eq op 2 +if not dask now +ret 0 +end +else +if not drecv now +ret 0 +end +end +prevent +ret 1 +end +fn prdo to bool +if not prparse +ret false +end +put Pe 0 0 +put Pe 1 0 +status = prapply +prreply status +ret true +end diff --git a/native/omega/allen/provider.om b/native/omega/allen/provider.om new file mode 100644 index 00000000..afa9bfc5 --- /dev/null +++ b/native/omega/allen/provider.om @@ -0,0 +1,70 @@ +note Native Linux stdin/stdout provider-stream entry. No fake clock or transport. +fn prreadhead to int +p = ulong 0 +while lt p 40 +n = read 0 Ph p sub ulong 40 p +if lt n 0 +ret 74 +end +if eq n 0 +if eq p 0 +ret 0 +end +ret 65 +end +p = add p ulong n +end +ret 1 +end +fn prreadbody to int +p = ulong 0 +size = get Pv 3 +while lt p size +n = read 0 Pb p sub size p +if lt n 0 +ret 74 +end +if eq n 0 +ret 65 +end +p = add p ulong n +end +ret 0 +end +fn prwrite to bool +p = ulong 0 +while lt p get Pn 0 +n = write 1 Pout p sub get Pn 0 p +if le n 0 +ret false +end +p = add p ulong n +end +ret true +end +fn main to int +constants +while true +status = prreadhead +if eq status 0 +ret 0 +end +if ne status 1 +ret status +end +if not prparse +ret 65 +end +status = prreadbody +if ne status 0 +ret status +end +if not prdo +ret 65 +end +if not prwrite +ret 74 +end +end +ret 0 +end diff --git a/native/omega/allen/reply.om b/native/omega/allen/reply.om new file mode 100644 index 00000000..59a377d4 --- /dev/null +++ b/native/omega/allen/reply.om @@ -0,0 +1,175 @@ +note SAY/WAIT parser, staged folded bytes. Native CODE receive remains separate. +global Say uchar 160 +global S ulong 5 +fn sayhead to bool +put P 0 0 +put P 2 0 +if ineq 0 87 +expect 87 +expect 65 +expect 73 +expect 84 +expect 32 +number +put S 0 get P 1 +put S 1 0 +put S 2 0 +if ne get P 0 get Inlen 0 +ret false +end +ret eq get P 2 0 +end +expect 83 +expect 65 +expect 89 +expect 32 +number +put S 0 get P 1 +expect 32 +if ne get P 2 0 +ret false +end +put S 1 1 +put S 2 1 +save = get P 0 +number +part = get P 1 +if ineq get P 0 47 +expect 47 +number +put S 2 get P 1 +expect 32 +if or ne get P 2 0 eq part 0 +ret false +end +put S 1 part +else +put P 0 save +put P 2 0 +end +put S 3 get P 0 +ret eq get P 2 0 +end +fn sayfold to bool +n = ulong 0 +p = get S 3 +space = true +while lt p get Inlen 0 +c = get In p +p = add p 1 +if eq c 92 +if or ineq p 110 ineq p 116 +c = 32 +p = add p 1 +end +end +if or lt c 32 ge c 127 +c = 32 +end +if eq c 32 +if not space +if ge n 159 +ret false +end +put Say n c +n = add n 1 +end +space = true +else +if ge n 159 +ret false +end +put Say n c +n = add n 1 +space = false +end +end +if gt n 0 +if eq get Say sub n 1 32 +n = sub n 1 +end +end +put S 4 n +ret true +end +note Return1 accepted,2 request AGAIN,3 give up after retry;0 rejected. +fn saytake now ulong to ulong +if or eq get R 1 0 gt get Inlen 0 319 +ret 0 +end +if not sayhead +ret 0 +end +if or ne get S 0 get R 0 lt now get R 4 +ret 0 +end +if eq get S 1 0 +b = heard get S 0 now +ret 1 +end +if not sayfold +ret 0 +end +if gt get R 2 1 +if eq get S 2 0 +ret 0 +end +if ne get C 0 get R 0 +ret 0 +end +if ne codestat 2 +if eq get R 13 0 +put R 13 1 +outreset +emitb 65 +emitb 71 +emitb 65 +emitb 73 +emitb 78 +emitb 32 +emitn get R 0 +ret 2 +end +cancel +ret 3 +end +else +if ne get S 1 add get R 11 1 +ret 0 +end +if and ne get S 2 0 ne get S 2 get S 1 +ret 0 +end +end +n = get R 8 +if or eq get S 1 1 gt get R 2 1 +n = 0 +end +join = ulong 0 +if and gt n 0 gt get S 4 0 +join = 1 +end +if gt add add n join get S 4 159 +ret 0 +end +if gt get R 2 1 +if not codeshow get R 0 +ret 0 +end +end +if eq join 1 +put Answer n uchar 32 +n = add n 1 +end +for i ulong get S 4 +put Answer add n i get Say i +end +put R 8 add n get S 4 +put R 11 get S 1 +put R 4 now +if ne get S 2 0 +put R 1 0 +histadd 1 +end +ret 1 +end diff --git a/native/omega/allen/repository-screen.om b/native/omega/allen/repository-screen.om new file mode 100644 index 00000000..d0325b6a --- /dev/null +++ b/native/omega/allen/repository-screen.om @@ -0,0 +1,543 @@ +note SPDX-License-Identifier: AGPL-3.0-only +note Repository window over committed Canvas/font API. No platform calls. +note Inputs ghkey: ASCII r refresh,b back,Tab switch,Enter open,Esc back; +note 256 up,257 down,258 page up,259 page down,260 left,261 right. +note Pointer uses logical Canvas coordinates and button1 press; wheel/swipe in rows. +note Gh view README0/files1/details2. Unsupported Unicode glyphs render one ? per scalar. +global Ghr ulong 8 +global Ghlines ulong 262145 +global Ghnumb uchar 20 +text Ghlabs "Allen / GitHub\nREADME\nFiles\nRefresh [R]\nBack [B]\nLIVE HTTPS / api.github.com\nLoading live GitHub response...\nNo current response. Refresh to retry.\nAsk me to find Allen's GitHub repository.\nUnsupported request. I can open Allen's repository.\nHTTP / transport error\nResponse exceeds bounded capacity\nInvalid response, identity, path or text\nAccess denied or GitHub rate limit\nRequest generation or path limit\nDefault branch:\nCommit:\nCommit time:\nRetrieved epoch seconds:\nRetrieval clock unavailable; session response:\nREADME not present at this commit (HTTP 404).\nEmpty README.\nEmpty directory.\nPath:\nBytes:\nObject SHA:\nDirectory\nFile\nOther object (not followed)\nText only; links and instructions are not executed.\nUp/Down scroll | PgUp/PgDn | Tab views | Enter open\nSource: github.com/\n" +fn ghscalar p ulong to ulong +c = get Ghread p +if lt c 128 +ret add p 1 +end +if lt c 224 +ret add p 2 +end +if lt c 240 +ret add p 3 +end +ret add p 4 +end +fn ghmeasure to void +w = get Cv 0 +h = get Cv 1 +if lt w 160 +w = 160 +end +if lt h 240 +h = 240 +end +cols = div sub w 32 10 +put Ghr 0 cols +put Ghr 1 div sub h 212 18 +if eq get Ghr 1 0 +put Ghr 1 1 +end +if and eq get Ghr 3 get Gh 12 eq get Ghr 4 cols +ret +end +put Ghr 3 get Gh 12 +put Ghr 4 cols +put Ghlines 0 0 +nrows = ulong 1 +col = ulong 0 +p = ulong 0 +while lt p get Gh 7 +c = get Ghread p +p = ghscalar p +if eq c 10 +put Ghlines nrows p +nrows = add nrows 1 +col = 0 +else +if ne c 13 +col = add col 1 +if ge col cols +if lt p get Gh 7 +if ne get Ghread p 10 +put Ghlines nrows p +nrows = add nrows 1 +col = 0 +end +end +end +end +end +end +put Ghr 2 nrows +end +fn ghrows to ulong +if eq get Gh 4 0 +ret get Ghr 2 +end +if eq get Gh 4 1 +ret get Gh 8 +end +ret 1 +end +fn ghlimit to ulong +n = ghrows +if le n get Ghr 1 +ret 0 +end +ret sub n get Ghr 1 +end +fn ghscroll delta long to void +if ne get Gh 0 2 +ret +end +ghmeasure +n = ghlimit +at = get Gh 5 +if gt at n +at = n +end +if lt delta 0 +note Avoid negating LONG_MIN. +if le delta neg long at +at = 0 +else +at = ulong add long at delta +end +else +if ge ulong delta sub n at +at = n +else +at = add at ulong delta +end +end +put Gh 5 at +end +fn ghswipe delta long to void +ghscroll delta +end +fn ghopen to void +if ne get Gh 4 1 +ret +end +if ge get Gh 6 get Gh 8 +ret +end +slot = mul get Gh 6 5 +if ne get Ghfiles add slot 2 2 +put Gh 4 2 +put Gh 5 0 +ret +end +p = get Ghfiles slot +n = get Ghfiles add slot 1 +for i ulong n +put Ghdir i get Ghpool add p i +end +put Gh 10 n +put Gh 8 0 +put Gh 9 0 +put Gh 5 0 +put Gh 6 0 +ghissue 4 +end +fn ghback to void +if eq get Gh 4 2 +put Gh 4 1 +put Gh 5 0 +ret +end +if and eq get Gh 4 1 gt get Gh 10 0 +n = get Gh 10 +while gt n 0 +n = sub n 1 +if eq get Ghdir n 47 +put Gh 10 n +put Gh 8 0 +put Gh 9 0 +ghissue 4 +ret +end +end +put Gh 10 0 +put Gh 8 0 +put Gh 9 0 +ghissue 4 +ret +end +put Gh 4 0 +put Gh 5 0 +end +fn ghselect down bool to void +if eq get Gh 8 0 +ret +end +n = get Gh 6 +if down +if lt add n 1 get Gh 8 +n = add n 1 +end +else +if gt n 0 +n = sub n 1 +end +end +put Gh 6 n +if lt n get Gh 5 +put Gh 5 n +end +if ge n add get Gh 5 get Ghr 1 +put Gh 5 add sub n get Ghr 1 1 +end +end +fn ghkey key ulong to void +if or eq key 114 eq key 82 +ghrefresh +ret +end +if ne get Gh 0 2 +ret +end +ghmeasure +if or or eq key 98 eq key 27 eq key 260 +ghback +ret +end +if eq key 9 +put Gh 4 rem add get Gh 4 1 2 +put Gh 5 0 +ret +end +if or eq key 13 eq key 261 +ghopen +ret +end +if or eq key 256 eq key 257 +if eq get Gh 4 1 +ghselect eq key 257 +else +if eq key 256 +ghscroll -1 +else +ghscroll 1 +end +end +end +if eq key 258 +ghscroll neg long get Ghr 1 +end +if eq key 259 +ghscroll long get Ghr 1 +end +end +fn ghpointer x long y long button ulong to void +if ne button 1 +ret +end +if or lt x 0 lt y 0 +ret +end +if or ge x long get Cv 0 ge y long get Cv 1 +ret +end +if and ge y 142 lt y 170 +if and ge x 300 lt x 460 +ghrefresh +ret +end +if ne get Gh 0 2 +ret +end +if lt x 140 +put Gh 4 0 +put Gh 5 0 +else +if lt x 280 +put Gh 4 1 +put Gh 5 0 +else +if ge x 460 +ghback +end +end +end +ret +end +if ne get Gh 0 2 +ret +end +if and eq get Gh 4 1 ge y 178 +ghmeasure +row = div ulong sub y 178 18 +if ge row get Ghr 1 +ret +end +row = add row get Gh 5 +if lt row get Gh 8 +if eq row get Gh 6 +ghopen +else +put Gh 6 row +end +end +end +end +fn ghfill x ulong y ulong w ulong h ulong color ulong to void +note The night colour is the screen's shade: translucent, so the sky shows through it. +a = ulong 255 +if eq color 395282 +a = 208 +end +cvfill x y w h color a +end +fn ghdraw c uchar x long y long color ulong to void +if not cvglyph c x y color +put Ghr 7 1 +end +end +fn ghlabel wanted ulong x long y long to void +which = ulong 0 +for i ulong len Ghlabs +c = get Ghlabs i +if eq c 10 +if eq which wanted +ret +end +which = add which 1 +else +if eq which wanted +if ge x long sub get Cv 0 8 +ret +end +ghdraw c x y 12573663 +x = add x 10 +end +end +end +end +fn ghsource src ulong p ulong to uchar +if eq src 0 +ret get Ghmeta p +end +if eq src 1 +ret get Ghread p +end +if eq src 2 +ret get Ghpool p +end +ret get Ghdir p +end +fn ghtext src ulong p ulong n ulong x long y long color ulong to void +stop = add p n +while lt p stop +c = ghsource src p +p = add p 1 +if eq c 10 +ret +end +if ne c 13 +if ge x long sub get Cv 0 8 +ret +end +if ge c 128 +while lt p stop +d = ghsource src p +if or lt d 128 ge d 192 +break +end +p = add p 1 +end +c = 63 +end +if lt c 32 +c = 32 +end +ghdraw c x y color +x = add x 10 +end +end +end +fn ghnum v ulong x long y long to void +n = ulong 0 +put Ghnumb n uchar add rem v 10 48 +n = add n 1 +v = div v 10 +while gt v 0 +put Ghnumb n uchar add rem v 10 48 +n = add n 1 +v = div v 10 +end +while gt n 0 +n = sub n 1 +ghdraw get Ghnumb n x y 12573663 +x = add x 10 +end +end +fn ghreadview to void +if ne get Gh 13 0 +ghlabel 20 16 192 +ret +end +if eq get Gh 7 0 +ghlabel 21 16 192 +ret +end +for i ulong get Ghr 1 +row = add get Gh 5 i +if ge row get Ghr 2 +ret +end +p = get Ghlines row +stop = get Gh 7 +if lt add row 1 get Ghr 2 +stop = get Ghlines add row 1 +end +y = long add 192 mul i 18 +ghtext 1 p sub stop p 16 y 15132654 +end +end +fn ghfileview to void +if eq get Gh 8 0 +ghlabel 22 16 192 +ret +end +for i ulong get Ghr 1 +row = add get Gh 5 i +if ge row get Gh 8 +ret +end +slot = mul row 5 +y = add 178 mul i 18 +if eq row get Gh 6 +ghfill 8 y sub get Cv 0 16 18 1850175 +end +p = get Ghfiles slot +n = get Ghfiles add slot 1 +mark = uchar 45 +if eq get Ghfiles add slot 2 2 +mark = 43 +end +ghdraw mark 16 long add y 14 7119850 +ghtext 2 p n 36 long add y 14 15132654 +end +end +fn ghdetails to void +slot = mul get Gh 6 5 +ghlabel 23 16 192 +ghtext 2 get Ghfiles slot get Ghfiles add slot 1 86 192 15132654 +ghlabel 24 16 212 +ghnum get Ghfiles add slot 3 96 212 +ghlabel 25 16 232 +ghtext 2 get Ghfiles add slot 4 40 16 250 15132654 +typ = get Ghfiles add slot 2 +if eq typ 1 +ghlabel 27 16 270 +else +ghlabel 28 16 270 +end +end +fn ghheader to void +ghlabel 0 16 24 +ghlabel 31 16 44 +note The repository is whatever discovery validated; until then the line shows only the host. +ghtext 0 720 get Ghlen 5 206 44 15132654 +if eq get Gh 0 2 +ghlabel 5 16 64 +ghtext 0 320 get Ghlen 2 16 84 15132654 +ghlabel 15 16 104 +ghtext 0 64 get Ghlen 1 176 104 15132654 +ghlabel 16 16 124 +ghtext 0 832 12 96 124 15132654 +ghtext 0 896 get Ghlen 4 236 124 12573663 +end +ghfill 8 142 sub get Cv 0 16 28 1581342 +ghlabel 1 16 160 +ghlabel 2 156 160 +ghlabel 3 306 160 +ghlabel 4 476 160 +end +fn ghstatus to void +state = get Gh 0 +if eq state 0 +ghlabel 8 16 192 +end +if eq state 1 +ghlabel 6 16 192 +ghnum get Ghreq 0 16 216 +end +if eq state 4 +ghlabel 9 16 192 +end +if eq state 3 +ghlabel 7 16 192 +err = get Gh 2 +label = ulong 10 +if eq err 2 +label = 11 +end +if eq err 3 +label = 12 +end +if eq err 4 +label = 13 +end +if eq err 8 +label = 14 +end +ghlabel label 16 216 +ghnum get Gh 3 16 240 +if ne get Gdiag 0 0 +note Show the failing stage and the transport states so a photograph identifies the break. +ghnum get Gdiag 0 96 240 +ghnum get Gdiag 1 176 240 +ghnum get Gdiag 2 256 240 +ghnum get Gdiag 3 336 240 +ghnum get Gdiag 4 416 240 +end +end +end +fn ghfooter to void +y = long sub get Cv 1 24 +if eq get Gh 0 2 +stamp = get Ghat 3 +if gt stamp 0 +ghlabel 18 16 y +ghnum stamp 266 y +else +ghlabel 19 16 y +ghnum get Gh 12 516 y +end +end +ghlabel 30 16 long sub get Cv 1 6 +end +fn ghrender to bool +if eq get Cv 6 0 +ret false +end +if or lt get Cv 0 320 lt get Cv 1 288 +ret false +end +if not cvfont 10 1000 +ret false +end +if not cvclip 0 0 get Cv 0 get Cv 1 +ret false +end +put Ghr 7 0 +ghmeasure +ghfill 0 0 get Cv 0 get Cv 1 395282 +ghheader +if eq get Gh 0 2 +if eq get Gh 4 0 +ghreadview +end +if eq get Gh 4 1 +ghfileview +end +if eq get Gh 4 2 +ghdetails +end +else +ghstatus +end +ghfooter +ret eq get Ghr 7 0 +end diff --git a/native/omega/allen/runtime.om b/native/omega/allen/runtime.om new file mode 100644 index 00000000..79f44bd6 --- /dev/null +++ b/native/omega/allen/runtime.om @@ -0,0 +1,145 @@ +note R: seq, active, kind (1 chat 2 code 3 more), asked, heard, slow, +note code-visible, prompt length, answer length, history count, session. +global R ulong 16 +global Prompt uchar 160 +global Answer uchar 160 +global Hist uchar 5120 +global Hlen ulong 32 +text Ack "I need to code that. Let me send it off to the Spark." +text Ackmore "Let me take that change to the Spark." +fn textok to bool +n = get Inlen 0 +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In i +if or lt c 32 gt c 126 +ret false +end +end +ret true +end +fn histadd which ulong to void +n = get R 9 +if eq n 32 +for i ulong 4960 +put Hist i get Hist add i 160 +end +for i ulong 31 +put Hlen i get Hlen add i 1 +end +n = 31 +end +size = get R add which 7 +for i ulong size +if eq which 0 +put Hist add mul n 160 i get Prompt i +else +put Hist add mul n 160 i get Answer i +end +end +put Hlen n size +put R 9 add n 1 +end +fn start kind ulong now ulong to bool +if or ne get R 1 0 ge get R 0 4294967295 +ret false +end +if or lt kind 1 gt kind 3 +ret false +end +if and eq kind 3 eq get R 6 0 +ret false +end +if not textok +ret false +end +for i ulong get Inlen 0 +put Prompt i get In i +end +put R 7 get Inlen 0 +put R 0 add get R 0 1 +put R 1 1 +put R 2 kind +put R 3 now +put R 4 now +put R 5 0 +put R 8 0 +put R 11 0 +put R 13 0 +if eq kind 2 +for i ulong len Ack +put Answer i get Ack i +end +put R 8 len Ack +end +if eq kind 3 +for i ulong len Ackmore +put Answer i get Ackmore i +end +put R 8 len Ackmore +end +histadd 0 +ret true +end +fn answer seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if or lt now get R 4 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +put R 4 now +put R 1 0 +histadd 1 +ret true +end +fn cancel to void +put R 1 0 +end +fn heard seq ulong now ulong to bool +if or eq get R 1 0 ne seq get R 0 +ret false +end +if lt now get R 4 +ret false +end +put R 4 now +ret true +end +fn tick now ulong to ulong +if or eq get R 1 0 lt now get R 4 +ret 0 +end +if ge sub now get R 4 30000 +cancel +ret 2 +end +if and eq get R 5 0 ge sub now get R 3 20000 +put R 5 1 +ret 1 +end +ret 0 +end +fn reset to void +for i ulong 9 +put R add i 1 0 +end +end +note Restore one externally decoded transcript line. No live job or ID reuse. +fn restore to bool +if or ne get R 1 0 not textok +ret false +end +for i ulong get Inlen 0 +put Answer i get In i +end +put R 8 get Inlen 0 +histadd 1 +ret true +end diff --git a/native/omega/allen/scene-input.om b/native/omega/allen/scene-input.om new file mode 100644 index 00000000..48c58ce8 --- /dev/null +++ b/native/omega/allen/scene-input.om @@ -0,0 +1,319 @@ +note Bounded model scene input. Existing scene stays the strict canonical parser. +note Nm thinking,normalized bytes,tidying count,hidden lines,line bytes,mood seen, +note invalid/overflow,plain candidate bytes,canonical line count. Input restored. +global Nm ulong 9 +global Nraw uchar 2048 +global Nline uchar 2048 +global Nnorm uchar 2048 +global Nplain uchar 160 +text Ntags "" +fn nlow c uchar to uchar +if and ge c 65 le c 90 +ret add sub c 65 97 +end +ret c +end +fn nalpha c uchar to bool +v = nlow c +ret and ge v 97 le v 122 +end +fn nmatch at ulong off ulong size ulong to bool +if gt add at size get Nm 4 +ret false +end +for i ulong size +if ne nlow get Nline add at i get Ntags add off i +ret false +end +end +ret true +end +fn nemit c uchar to void +n = get Nm 1 +if ge n 2048 +put Nm 6 1 +ret +end +put Nnorm n c +put Nm 1 add n 1 +end +fn nmark c uchar to bool +if or eq c 45 eq c 42 +ret true +end +if or eq c 35 eq c 62 +ret true +end +ret eq c 34 +end +fn nlead c uchar to bool +if or eq c 32 eq c 42 +ret true +end +if eq c 35 +ret true +end +ret nalpha c +end +fn ndigits p ulong to ulong +while lt p get Nm 4 +if not isdigit get Nline p +ret p +end +p = add p 1 +end +ret p +end +fn nspaces p ulong to ulong +while lt p get Nm 4 +if ne get Nline p 32 +ret p +end +p = add p 1 +end +ret p +end +fn npstep s ulong to ulong +n = get Nm 4 +c = get Nline s +if nmark c +if eq add s 1 n +ret n +end +if nlead get Nline add s 1 +ret add s 1 +end +ret s +end +if not isdigit c +ret s +end +p = ndigits s +if ge add p 1 n +ret s +end +if not or eq get Nline p 46 eq get Nline p 41 +ret s +end +if ne get Nline add p 1 32 +ret s +end +ret add p 2 +end +fn nprefix to ulong +s = ulong 0 +while lt s get Nm 4 +next = npstep s +if eq next s +ret s +end +put Nm 2 add get Nm 2 1 +s = nspaces next +end +ret s +end +fn nfinish to void +n = get Nm 4 +while gt n 0 +if eq get Nline sub n 1 32 +n = sub n 1 +else +nprocess n +ret +end +end +end +fn nprocess n ulong to void +put Nm 4 n +hide = ne get Nm 0 0 +for i ulong n +if nmatch i 0 7 +put Nm 0 1 +hide = true +end +if nmatch i 7 8 +put Nm 0 0 +hide = true +end +end +if hide +put Nm 3 add get Nm 3 1 +ret +end +if ge n 3 +if and eq get Nline 0 96 eq get Nline 1 96 +if eq get Nline 2 96 +put Nm 2 add get Nm 2 1 +ret +end +end +end +s = nprefix +if ge s n +ret +end +w = s +while lt w n +if nalpha get Nline w +w = add w 1 +else +nword s w n +ret +end +end +nword s w n +end +fn nword s ulong w ulong n ulong to void +for i ulong sub w s +put In add s i nlow get Nline add s i +end +word = scword s sub w s +if gt word 10 +word = 0 +end +r = w +while lt r n +c = get Nline r +if or eq c 42 eq c 34 +r = add r 1 +put Nm 2 add get Nm 2 1 +else +nappend s w r n word +ret +end +end +nappend s w r n word +end +fn nappend s ulong w ulong r ulong n ulong word ulong to void +if lt r n +if not or eq get Nline r 32 eq get Nline r 58 +word = 0 +end +end +if eq word 0 +size = sub n s +if and eq get Nm 7 0 le size 159 +if lt get Nm 8 12 +for i ulong size +put Nplain i get Nline add s i +end +put Nm 7 size +end +end +for i ulong size +nemit get Nline add s i +end +else +if eq word 1 +if lt get Nm 8 12 +put Nm 5 1 +end +end +for i ulong sub w s +nemit nlow get Nline add s i +end +head = ne word 2 +for i ulong sub n r +c = get Nline add r i +if eq c 58 +if ne word 1 +head = false +end +end +if head +c = nlow c +end +nemit c +end +end +nemit 10 +put Nm 8 add get Nm 8 1 +end +fn nclear to void +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +end +fn scdecode to bool +for i ulong 9 +put Nm i 0 +end +nclear +n = get Inlen 0 +if gt n 2048 +put Nm 6 1 +ret false +end +for i ulong n +if eq get In i 0 +put Nm 6 1 +ret false +end +put Nraw i get In i +end +for i ulong n +c = get Nraw i +if eq c 10 +nfinish +put Nm 4 0 +else +if eq c 9 +c = uchar 32 +put Nm 2 add get Nm 2 1 +end +if and ge c 32 le c 126 +p = get Nm 4 +keep = true +if eq c 32 +if eq p 0 +keep = false +else +if eq get Nline sub p 1 32 +keep = false +end +end +end +if keep +put Nline p c +put Nm 4 add p 1 +else +put Nm 2 add get Nm 2 1 +end +else +put Nm 2 add get Nm 2 1 +end +end +end +nfinish +ok = false +if eq get Nm 6 0 +for i ulong get Nm 1 +put In i get Nnorm i +end +put Inlen 0 get Nm 1 +ok = scene +if ne get Nm 5 0 +ok = true +end +if not ok +if gt get Nm 7 0 +for i ulong get Nm 7 +put In i get Nplain i +end +put Inlen 0 get Nm 7 +ok = scsay 0 get Nm 7 +end +end +else +nclear +end +for i ulong n +put In i get Nraw i +end +put Inlen 0 n +ret ok +end diff --git a/native/omega/allen/scene.om b/native/omega/allen/scene.om new file mode 100644 index 00000000..376fd361 --- /dev/null +++ b/native/omega/allen/scene.om @@ -0,0 +1,340 @@ +note Scene state: tone,water,has-say,nthings,used,lines,rejected,over. +global Sc ulong 8 +global Things ulong 64 +global Stext uchar 2304 +global Sw ulong 4 +global Fields uchar 1536 +global Flens ulong 6 +global Soffs ulong 6 +text Vocab "mood|say|note|list|number|quote|person|timer|picture|video|left|right|above|warm|quiet|bloom|rise|fade|to|from|night|dawn|deep|clear|slow|still|lively|" +fn scword beg ulong size ulong to ulong +s = ulong 0 +word = ulong 1 +for i ulong len Vocab +if eq get Vocab i 124 +if eq sub i s size +same = true +for j ulong size +if ne get In add beg j get Vocab add s j +same = false +end +end +if same +ret word +end +end +word = add word 1 +s = add i 1 +end +end +ret 0 +end +fn fieldcap kind ulong field ulong to ulong +if eq kind 2 +if eq field 0 +ret 48 +end +ret 64 +end +if eq kind 1 +if eq field 0 +ret 48 +end +ret 240 +end +if eq kind 3 +if eq field 0 +ret 16 +end +ret 64 +end +if eq kind 4 +if eq field 0 +ret 220 +end +ret 48 +end +if eq kind 5 +if eq field 0 +ret 32 +end +ret 200 +end +if eq kind 6 +if eq field 0 +ret 24 +end +ret 64 +end +if eq field 0 +ret 120 +end +ret 64 +end +fn scfield slot ulong beg ulong stop ulong kind ulong to bool +s = beg +e = stop +while lt s e +if eq get In s 32 +s = add s 1 +else +ret fieldend slot s e kind +end +end +put Flens slot 0 +ret true +end +fn fieldend slot ulong s ulong stop ulong kind ulong to bool +e = stop +while gt e s +if eq get In sub e 1 32 +e = sub e 1 +else +n = sub e s +if gt n fieldcap kind slot +ret false +end +for i ulong n +c = get In add s i +if or lt c 32 gt c 126 +ret false +end +put Fields add mul slot 256 i c +end +put Flens slot n +ret true +end +end +put Flens slot 0 +ret true +end +fn scfields beg ulong stop ulong kind ulong to ulong +slot = ulong 0 +s = beg +for i ulong sub stop beg +p = add beg i +if eq get In p 124 +if ge slot 5 +ret 0 +end +if not scfield slot s p kind +ret 0 +end +slot = add slot 1 +s = add p 1 +end +end +if not scfield slot s stop kind +ret 0 +end +n = add slot 1 +if and ne kind 2 gt n 2 +ret 0 +end +if eq get Flens 0 0 +ret 0 +end +if eq kind 5 +if or lt n 2 eq get Flens 1 0 +ret 0 +end +end +if eq kind 3 +hasdigit = false +for i ulong get Flens 0 +if isdigit get Fields i +hasdigit = true +end +end +if not hasdigit +ret 0 +end +end +ret n +end +fn scput slot ulong to ulong +off = get Sc 4 +n = get Flens slot +for i ulong n +put Stext add off i get Fields add mul slot 256 i +end +put Stext add off n 0 +put Sc 4 add add off n 1 +ret off +end +fn scmod word ulong base ulong to void +if and ge word 11 le word 13 +put Things add base 1 sub word 10 +end +if and ge word 16 le word 18 +put Things add base 2 sub word 16 +end +if and ge word 19 le word 20 +put Things add base 3 sub word 18 +end +if eq word 14 +put Things add base 4 1 +end +if eq word 15 +put Things add base 5 1 +end +end +fn scsay beg ulong stop ulong to bool +if ne get Sc 2 0 +ret false +end +n = sub stop beg +if or eq n 0 gt n 159 +ret false +end +for i ulong n +c = get In add beg i +if or lt c 32 gt c 126 +ret false +end +put Fields i c +end +put Flens 0 n +put Sc 2 1 +put Sw 3 scput 0 +ret true +end +fn scln beg ulong stop ulong to bool +p = beg +while lt p stop +if or eq get In p 32 eq get In p 58 +ret scbody beg p stop +end +p = add p 1 +end +ret false +end +fn scbody beg ulong wordend ulong stop ulong to bool +word = scword beg sub wordend beg +if eq word 2 +s = add wordend 1 +if lt s stop +if eq get In s 58 +s = add s 1 +end +end +while lt s stop +if eq get In s 32 +s = add s 1 +else +ret scsay s stop +end +end +ret false +end +if eq word 1 +s = add wordend 1 +for p ulong sub stop s +at = add add wordend 1 p +if eq get In at 32 +w = scword s sub at s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +s = add at 1 +end +end +w = scword s sub stop s +if and ge w 21 le w 24 +put Sc 0 sub w 21 +end +if and ge w 25 le w 27 +put Sc 1 sub w 25 +end +ret true +end +if or lt word 3 gt word 10 +ret false +end +if ge get Sc 3 4 +put Sc 7 add get Sc 7 1 +ret false +end +put Sw 0 sub word 2 +colon = wordend +while lt colon stop +if eq get In colon 58 +put Sw 1 wordend +put Sw 2 colon +ret scthing add colon 1 stop +end +colon = add colon 1 +end +ret false +end +fn scthing beg ulong stop ulong to bool +n = scfields beg stop get Sw 0 +if eq n 0 +ret false +end +need = n +for i ulong n +need = add need get Flens i +end +if gt add get Sc 4 need 2304 +ret false +end +base = mul get Sc 3 16 +put Things base get Sw 0 +put Things add base 6 n +s = get Sw 1 +for p ulong sub get Sw 2 s +at = add get Sw 1 p +if eq get In at 32 +w = scword s sub at s +scmod w base +s = add at 1 +end +end +w = scword s sub get Sw 2 s +scmod w base +for i ulong n +put Things add add base 7 i scput i +end +put Sc 3 add get Sc 3 1 +ret true +end +fn scene to bool +for i ulong 8 +put Sc i 0 +end +for i ulong 64 +put Things i 0 +end +put Sw 3 0 +n = get Inlen 0 +if gt n 2048 +n = 2048 +end +s = ulong 0 +for p ulong n +if eq get In p 10 +if gt p s +if lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s p +put Sc 6 add get Sc 6 1 +end +else +put Sc 7 add get Sc 7 1 +end +end +s = add p 1 +end +end +if and lt s n lt get Sc 5 12 +put Sc 5 add get Sc 5 1 +if not scln s n +put Sc 6 add get Sc 6 1 +end +end +ret or ne get Sc 2 0 ne get Sc 3 0 +end diff --git a/native/omega/allen/scheduler.om b/native/omega/allen/scheduler.om new file mode 100644 index 00000000..e06edb67 --- /dev/null +++ b/native/omega/allen/scheduler.om @@ -0,0 +1,229 @@ +note Courier client lifecycle; injected monotonic milliseconds, no host clock/socket. +note T lastclock, HIvalid, HIat, HELLOvalid, HELLOat, active, acked, jobat, +note joblength, cursor, pendingkind, pendingpart, reserved, GOTpart, reserved, reserved. +note Serialized API: qnext publishes one datagram; qsent records actual send result. +note Consume Outb before another serializer; failed sends leave retries due. +global T ulong 16 +global JobOut uchar 4096 +fn qstart run ulong now ulong to bool +if eq run 0 +ret false +end +qbegin run 0 +for i ulong 16 +put T i 0 +end +put T 0 now +ret true +end +fn qready now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if eq get T 1 0 +ret false +end +ret lt sub now get T 2 30000 +end +fn qsubmit now ulong to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +if and ne get T 5 0 eq get T 6 0 +ret false +end +n = get Inlen 0 +if or eq n 0 gt n 4096 +ret false +end +if ge get Q 1 4294967295 +ret false +end +seq = add get Q 1 1 +qbegin get Q 0 seq +for i ulong n +c = get In i +if or eq c 10 eq c 13 +c = uchar 32 +end +put JobOut i c +end +put T 0 now +put T 5 1 +put T 6 0 +put T 7 now +put T 8 n +put T 9 1 +put T 13 0 +ret true +end +fn qnext now ulong online bool to bool +if or eq get Q 0 0 lt now get T 0 +ret false +end +if ne get T 10 0 +ret false +end +put T 0 now +if not online +ret false +end +if ne get T 13 0 +put Inlen 0 0 +if not packet 3 get Q 1 get T 13 0 0 +ret false +end +put T 10 3 +put T 11 get T 13 +ret true +end +delay = ulong 2000 +if qready now +delay = ulong 10000 +end +if or eq get T 3 0 ge sub now get T 4 delay +put Inlen 0 0 +if not packet 5 0 0 0 0 +ret false +end +put T 10 5 +put T 11 0 +ret true +end +if or eq get T 5 0 ne get T 6 0 +ret false +end +part = get T 9 +if eq part 0 +if lt sub now get T 7 2000 +ret false +end +part = ulong 1 +end +n = get T 8 +total = div add n 999 1000 +off = mul sub part 1 1000 +size = sub n off +if gt size 1000 +size = ulong 1000 +end +for i ulong size +put In i get JobOut add off i +end +put Inlen 0 size +if not packet 1 get Q 1 part total n +ret false +end +put T 10 1 +put T 11 part +ret true +end +fn qsent now ulong ok bool to bool +if or eq get T 10 0 lt now get T 0 +ret false +end +kind = get T 10 +part = get T 11 +put T 0 now +put T 10 0 +put T 11 0 +if not ok +ret true +end +if eq kind 5 +put T 3 1 +put T 4 now +end +if eq kind 3 +if eq get T 13 part +put T 13 0 +end +end +if eq kind 1 +if or ne get T 6 0 ge part div add get T 8 999 1000 +put T 9 0 +put T 7 now +else +put T 9 add part 1 +end +end +ret true +end +fn qincoming now ulong to ulong +if or eq get Q 0 0 lt now get T 0 +ret 0 +end +if not pkparse +ret 0 +end +kind = get N 0 +if eq kind 6 +if or ne get N 1 0 ne get N 2 0 +ret 0 +end +if or ne get N 3 0 ne get N 4 0 +ret 0 +end +if ne get N 6 0 +ret 0 +end +put T 0 now +put T 1 1 +put T 2 now +ret 1 +end +if or eq get T 5 0 ne get N 1 get Q 1 +ret 0 +end +if eq kind 4 +if or ne get N 2 0 ne get N 3 0 +ret 0 +end +if or ne get N 4 0 ne get N 6 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +ret 1 +end +if ne kind 2 +ret 0 +end +note LINE total is 0; bytes is 0 (this line's tests) or the body length (the +note relay, allen-courier main.rs datagram(): bytes=body.len()). +if ne get N 3 0 +ret 0 +end +if ne get N 4 0 +if ne get N 4 get N 6 +ret 0 +end +end +if and ne get T 13 0 ne get T 13 get N 2 +ret 0 +end +result = qreceive +if eq result 0 +ret 0 +end +put T 0 now +put T 6 1 +put T 9 0 +put T 13 get N 2 +ret result +end +fn qcancel to void +put T 5 0 +put T 6 0 +put T 8 0 +put T 9 0 +put T 10 0 +put T 11 0 +put T 13 0 +put Q 3 0 +put Q 4 0 +end diff --git a/native/omega/allen/session.om b/native/omega/allen/session.om new file mode 100644 index 00000000..cca0dc22 --- /dev/null +++ b/native/omega/allen/session.om @@ -0,0 +1,187 @@ +note SPDX-License-Identifier: MIT +note One-request-per-connection GitHub driver over TCP, TLS 1.3 and HTTP framing. +note The platform supplies elapsed milliseconds, Unix time, packet results and 96 fresh +note random bytes in Gsrand before every gsstart: 64 for TLS, 32 for TCP/DHCP/DNS IDs. +global Gsrand uchar 96 +global Gsrandn ulong 1 +global Gs ulong 8 +note Gdiag: last failure code, TCP state, TCP error, TLS state, TLS error. Shown on screen. +global Gdiag ulong 5 +note Gs: state0 idle,1 connecting,2 TLS,3 HTTP,4 completed,5 failed; deadline; request kind; +note generation; send offset; failure code; pending close flag. +fn gsfail now ulong code ulong to void +if ne get Gs 0 0 +kind = get Gs 2 +gen = get Gs 3 +put Gs 0 5 +put Gs 5 code +put Gdiag 0 code +put Gdiag 1 get Tcpstate 0 +put Gdiag 2 get Tcpstate 1 +put Gdiag 3 get Ndrop 0 +put Gdiag 4 get Ndropw 0 +netclose now +tlsclose +tcwipe +ok = ghreply kind 0 0 gen +end +end +fn gsstart now ulong epoch ulong to bool +kind = get Ghreq 0 +if or eq kind 0 ne get Gs 0 0 +ret false +end +if ne get Gsrandn 0 len Gsrand +ok = ghreply kind 0 0 get Ghreq 2 +ret false +end +for i ulong 64 +put Tlsrand i get Gsrand i +end +for i ulong 32 +put Nrand i get Gsrand add i 64 +end +for i ulong len Gsrand +put Gsrand i 0 +end +put Gsrandn 0 0 +if not httpstart kind get Ghreq 2 get Ghreq 3 get Ghreq 4 get Ghreq 1 +ok = ghreply kind 0 0 get Ghreq 2 +ret false +end +for i ulong 8 +put Gs i 0 +end +put Gs 0 1 +put Gs 1 add now 120000 +put Gs 2 kind +put Gs 3 get Ghreq 2 +ghtime epoch +tlsinit epoch +if eq get Tlsstate 0 4 +gsfail now 9 +ret false +end +netconnect now +ret true +end +fn gstlsout now ulong to void +if eq get Tlsoutn 0 0 +ret +end +if gt get Tlsoutn 0 len Tcpout +gsfail now 2 +ret +end +for i ulong get Tlsoutn 0 +put Tcpout i get Tlsout i +end +if netwrite get Tlsoutn 0 now +tlssent +end +end +fn gstcpin now ulong to void +n = get Tcpn 0 +if eq n 0 +ret +end +if gt n len Tlsin +n = len Tlsin +end +for i ulong n +put Tlsin i get Tcpin i +end +tlsinput n +netconsume n +end +fn gshttp now ulong to void +while gt get Tlsappn 0 0 +n = get Tlsappn 0 +if gt n len Hchunk +n = len Hchunk +end +for i ulong n +put Hchunk i get Tlsapp i +end +if not httpfeed n +gsfail now 3 +ret +end +tlsconsume n +end +if eq get Hstate 0 2 +size = get Hstate 2 +status = get Hstate 1 +kind = get Gs 2 +gen = get Gs 3 +put Gs 0 4 +netclose now +tlsclose +tcwipe +ok = ghreply kind status size gen +end +end +fn gsrequest now ulong to void +if or ne get Gs 4 0 ne get Tlsstate 0 2 +ret +end +if gt get Httpreqn 0 len Tlsplain +gsfail now 4 +ret +end +for i ulong get Httpreqn 0 +put Tlsplain i get Httpreq i +end +if tlswrite get Httpreqn 0 +put Gs 4 1 +put Gs 0 3 +end +end +fn gspoll now ulong to void +state = get Gs 0 +if or eq state 0 ge state 4 +ret +end +if gt now get Gs 1 +gsfail now 5 +ret +end +netstep now +if eq get Tcpstate 0 6 +gsfail now 6 +ret +end +if eq get Tcpstate 0 4 +if eq state 1 +put Gs 0 2 +tlsinput 0 +end +end +gstcpin now +if eq get Tlsstate 0 4 +gsfail now 7 +ret +end +gstlsout now +gsrequest now +gstlsout now +gshttp now +if ne get Gs 0 3 +ret +end +if or eq get Tcpstate 0 5 eq get Tlsstate 0 3 +if httpend eq get Tlsstate 2 1 +gshttp now +else +gsfail now 8 +end +end +end +fn gsnext now ulong epoch ulong to void +if ge get Gs 0 4 +put Gs 0 0 +end +if and eq get Gs 0 0 ne get Ghreq 0 0 +ok = gsstart now epoch +end +end diff --git a/native/omega/allen/surface.om b/native/omega/allen/surface.om new file mode 100644 index 00000000..cfd687c0 --- /dev/null +++ b/native/omega/allen/surface.om @@ -0,0 +1,185 @@ +note Bounded text surface at native scale. See SURFACE.md. The screens lay out on a logical +note 768 x 384 grid (Cv); every glyph and fill lands in the native frame Nfrm (look-paint.om) at +note Cvs[0] native pixels per logical pixel, centred by Cvs[2], Cvs[3]. Glyphs are rasterised at +note the logical cap height times the scale, so type stays crisp on a 4K panel. +note Cvs: 0 scale, 1 logical cap, 2 x offset, 3 y offset, 4..7 the clip in native pixels. +global Canvas uchar 884736 +global Cv ulong 8 +global Cvs ulong 8 +global Cvpose long 2 +fn cvinit w ulong h ulong to bool +if or eq w 0 gt w 768 +ret false +end +if or eq h 0 gt h 384 +ret false +end +for i ulong 8 +put Cv i 0 +end +put Cv 0 w +put Cv 1 h +put Cv 4 w +put Cv 5 h +put Cv 6 1 +for i ulong 8 +put Cvs i 0 +end +put Cvs 0 1 +sw = ulong get Lg 0 +sh = ulong get Lg 1 +if and ge sw w ge sh h +s = div sw w +if lt div sh h s +s = div sh h +end +if eq s 0 +s = 1 +end +put Cvs 0 s +put Cvs 2 div sub sw mul w s 2 +put Cvs 3 div sub sh mul h s 2 +end +put Cvs 4 get Cvs 2 +put Cvs 5 get Cvs 3 +put Cvs 6 mul w get Cvs 0 +put Cvs 7 mul h get Cvs 0 +ret true +end +fn cvclip x ulong y ulong w ulong h ulong to bool +if eq get Cv 6 0 +ret false +end +if or gt x get Cv 0 gt y get Cv 1 +ret false +end +if gt w sub get Cv 0 x +ret false +end +if gt h sub get Cv 1 y +ret false +end +put Cv 2 x +put Cv 3 y +put Cv 4 w +put Cv 5 h +s = get Cvs 0 +put Cvs 4 add mul x s get Cvs 2 +put Cvs 5 add mul y s get Cvs 3 +put Cvs 6 mul w s +put Cvs 7 mul h s +ret true +end +fn cvfont cap ulong wt ulong to bool +note The face for the following glyphs: cap in logical pixels, rasterised at native size. +put Cvs 1 cap +n = mul cap get Cvs 0 +if gt n 64 +n = 64 +end +ret afinit n wt +end +fn cvblend bg ulong fg ulong a ulong to ulong +v = mul bg sub ulong 255 a +v = add v mul fg a +ret div v 255 +end +fn cvin x long y long to bool +if or lt x long get Cvs 4 lt y long get Cvs 5 +ret false +end +if ge x long add get Cvs 4 get Cvs 6 +ret false +end +ret lt y long add get Cvs 5 get Cvs 7 +end +fn cvmixat at ulong a ulong color ulong to void +note One native pixel of the frame toward color by a/255. +d = ulong get Nfrm at +r = cvblend and shr d 16 255 and shr color 16 255 a +g = cvblend and shr d 8 255 and shr color 8 255 a +b = cvblend and d 255 and color 255 a +put Nfrm at uint or or shl r 16 shl g 8 b +end +fn cvpixel x long y long a uchar color ulong to void +note Native coordinates, held inside the clip. +if not cvin x y +ret +end +at = add mul ulong y ulong get Lg 0 ulong x +cvmixat at ulong a color +end +fn cvrow yy ulong color ulong to void +y = add get Cvpose 1 long yy +at = mul yy get Af 3 +for x ulong get Af 3 +px = add get Cvpose 0 long x +cvpixel px y get Alpha add at x color +end +end +fn cvblit x long y long color ulong to void +note x, y: the glyph's logical origin and baseline; the mask offsets Ab are native already. +s = long get Cvs 0 +ox = add mul x s long get Cvs 2 +oy = add mul y s long get Cvs 3 +put Cvpose 0 add ox get Ab 0 +put Cvpose 1 add oy get Ab 1 +for yy ulong get Af 4 +cvrow yy color +end +end +fn cvargs x long y long color ulong to bool +if or eq get Cv 6 0 eq get Af 0 0 +ret false +end +if or lt x -4096 gt x 4096 +ret false +end +if or lt y -4096 gt y 4096 +ret false +end +ret le color 16777215 +end +fn cvglyph c uchar x long y long color ulong to bool +if not cvargs x y color +ret false +end +if not afglyph c +ret false +end +cvblit x y color +put Cv 7 div get Af 5 get Cvs 0 +ret true +end +fn cvfillrow y long x0 long n long a ulong color ulong to void +for k ulong ulong n +cvpixel add x0 long k y uchar a color +end +end +fn cvfill x ulong y ulong w ulong h ulong color ulong a ulong to void +note A logical rectangle mixed toward color by a/255 (255: solid), inside the clip. +if eq get Cv 6 0 +ret +end +if gt x get Cv 0 +ret +end +if gt y get Cv 1 +ret +end +if gt w sub get Cv 0 x +ret +end +if gt h sub get Cv 1 y +ret +end +if gt a 255 +a = 255 +end +s = get Cvs 0 +x0 = long add mul x s get Cvs 2 +y0 = long add mul y s get Cvs 3 +for yy ulong mul h s +cvfillrow add y0 long yy x0 long mul w s a color +end +end diff --git a/native/omega/allen/test-build.sh b/native/omega/allen/test-build.sh new file mode 100644 index 00000000..8418bb30 --- /dev/null +++ b/native/omega/allen/test-build.sh @@ -0,0 +1,47 @@ +#!/bin/sh +# Build orchestration tests. The actual program is compiled seeded Omega. +set -eu +[ "$#" = 2 ] || { echo 'usage: test-build.sh PINNED_COMPILER FRESH_OUTPUT' >&2; exit 64; } +root=$(CDPATH= cd -- "$(dirname "$0")/../../.." && pwd) +compiler=$1 +out=$2 +mkdir "$out" +out=$(CDPATH= cd -- "$out" && pwd) +cp "$compiler" "$out/compiler with spaces" +chmod u+w "$out/compiler with spaces" +export OMEGA_COMPILER="$out/compiler with spaces" +build="$root/native/omega/allen/build-one.sh" +probe="$root/native/omega/allen/tests/build-probe.om" +"$build" "$probe" "$out/program with spaces" +set +e +"$out/program with spaces" +rc=$? +set -e +[ "$rc" = 23 ] +echo 'PASS relocated compiler and actual native program' +before=$(sha256sum "$out/program with spaces") +if "$build" "$probe" "$out/program with spaces"; then exit 1; fi +[ "$(sha256sum "$out/program with spaces")" = "$before" ] +echo 'PASS existing output preserved' +ln -s "$out/missing-target" "$out/dangling" +if "$build" "$probe" "$out/dangling"; then exit 1; fi +[ -L "$out/dangling" ] && [ ! -e "$out/missing-target" ] +echo 'PASS dangling output link refused' +printf '\000' >> "$out/compiler with spaces" +if "$build" "$probe" "$out/wrong-compiler"; then exit 1; fi +[ ! -e "$out/wrong-compiler" ] +echo 'PASS changed compiler refused before output creation' +cp "$compiler" "$out/compiler with spaces" +printf 'fn main to int\nret\nend\n' > "$out/invalid.om" +if "$build" "$out/invalid.om" "$out/invalid-program"; then exit 1; fi +[ ! -e "$out/invalid-program" ] +echo 'PASS failed compilation publishes no executable' +if "$build" "$probe"; then exit 1; fi +OMEGA_COMPILER="$out/no-compiler" +export OMEGA_COMPILER +if "$build" "$probe" "$out/missing-compiler-output"; then exit 1; fi +[ ! -e "$out/missing-compiler-output" ] +echo 'PASS missing compiler and missing argument refused' +leftovers=$(find "$out" -name '*.build.*' -print) +[ -z "$leftovers" ] +echo 'PASS no temporary build files retained' diff --git a/native/omega/allen/tests/application.om b/native/omega/allen/tests/application.om new file mode 100644 index 00000000..f5c33eba --- /dev/null +++ b/native/omega/allen/tests/application.om @@ -0,0 +1,346 @@ +note End-to-end application core over real Omega protocol bytes; no socket simulation claim. +text Smallask "hello" +text Codeaskt "Please make me a calculator" +text Finaltxt " 1/1 Model answer." +text Codetxt " 1/1 9 3ce11e06 python print(1)\\n" +text Prefixes "SAY WAIT CODE " +text Againexp "AGAIN 2" +global SavedOut uchar 8192 +global Heldwire uchar 8192 +global Heldlen ulong 2 +fn holdwire to void +put Heldlen 0 get Outlen 0 +put Heldlen 1 get Err 0 +for i ulong get Outlen 0 +put Heldwire i get Outb i +end +end +fn unhold to void +for i ulong get Heldlen 0 +put Outb i get Heldwire i +end +put Outlen 0 get Heldlen 0 +put Err 0 get Heldlen 1 +end +fn samewire to bool +if ne get Outlen 0 get Heldlen 0 +ret false +end +for i ulong get Heldlen 0 +if ne get Outb i get Heldwire i +ret false +end +end +ret eq get Err 0 get Heldlen 1 +end +fn test ok bool to void +n = get Outlen 0 +e = get Err 0 +for i ulong n +put SavedOut i get Outb i +end +check ok add get Checks 0 1 +for i ulong n +put Outb i get SavedOut i +end +put Outlen 0 n +put Err 0 e +end +fn copyout to void +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +end +fn prompt code bool to void +if code +put Inlen 0 len Codeaskt +for i ulong len Codeaskt +put In i get Codeaskt i +end +else +put Inlen 0 len Smallask +for i ulong len Smallask +put In i get Smallask i +end +end +end +fn incoming part ulong seq ulong kind ulong to void +outreset +off = ulong 0 +size = ulong 4 +if eq kind 1 +off = ulong 4 +size = ulong 5 +end +if eq kind 2 +off = ulong 9 +size = ulong 5 +end +for i ulong size +emitb get Prefixes add off i +end +emitn seq +if eq kind 0 +for i ulong len Finaltxt +emitb get Finaltxt i +end +end +if eq kind 2 +for i ulong len Codetxt +emitb get Codetxt i +end +end +copyout +b = packet 2 get Q 1 part 0 0 +copyout +end +fn main to int +test not appinit 0 100 +test appinit 42 100 +test not appinit 43 100 +test eq get Q 0 42 +prompt false +test appask 100 +test eq get R 0 1 +test eq get Q 1 1 +test eq get R 9 1 +test eq get R 1 1 +test eq get A 2 0 +prompt false +test not appask 101 +test eq get R 9 1 +test apppoll 100 true +test eq get T 10 5 +test appsent 100 true +test apppoll 100 true +test eq get T 10 1 +copyout +test pkparse +test eq get N 1 1 +test eq get In get N 5 74 +test appsent 100 true +incoming 1 1 0 +test appreceive 101 +test eq get A 2 1 +test eq get R 1 0 +test eq get R 8 13 +test eq get R 9 2 +test eq get Answer 0 77 +prompt true +test not appask 102 +test eq get R 0 1 +test apppoll 102 true +test eq get T 10 3 +test appsent 102 true +note Code acknowledgement is visible immediately, but missing code requests AGAIN. +prompt true +test appask 103 +test eq get R 0 2 +test eq get Q 1 2 +test eq get R 2 2 +test eq get A 2 1 +test eq get R 8 len Ack +test apppoll 103 true +test appsent 103 false +test apppoll 104 true +test eq get T 10 1 +test appsent 104 true +incoming 1 2 0 +test appreceive 105 +test eq get A 2 2 +test eq get A 1 len Againexp +test eq get R 1 1 +test eq get R 13 1 +test apppoll 105 true +test eq get T 10 3 +test eq get Q 1 2 +test appsent 105 true +test apppoll 106 true +test eq get T 10 1 +test eq get Q 1 3 +test eq get R 0 2 +copyout +test pkparse +test eq get N 6 len Againexp +bad = ulong 0 +for i ulong len Againexp +if ne get In add get N 5 i get Againexp i +bad = add bad 1 +end +end +test eq bad 0 +test appsent 106 true +incoming 1 2 0 +test appreceive 107 +test eq get A 2 3 +test eq get R 1 0 +test eq get A 1 0 +note Reset cancels pending delivery without reusing either counter. +appreset +test eq get R 0 2 +test eq get Q 1 3 +test eq get R 9 0 +prompt false +test appask 108 +test eq get R 0 3 +test eq get Q 1 4 +test apppoll 108 true +test appsent 108 true +note Old CODE must not mutate the code buffer during a newer chat job. +incoming 1 2 2 +test appreceive 109 +test eq get A 2 4 +test eq get C 1 0 +test eq get C 2 0 +test eq get Code 0 0 +test apppoll 109 true +test appsent 109 true +incoming 2 2 0 +test appreceive 109 +test eq get A 2 4 +test eq get R 1 1 +test eq get R 8 0 +test apppoll 109 true +test appsent 109 true +incoming 3 3 0 +test appreceive 110 +test eq get A 2 1 +test eq get R 1 0 +test eq get R 9 2 +test apppoll 110 true +test appsent 110 true +note Cancellation drops an outstanding send and stale response safely. +prompt false +test appask 111 +test apppoll 111 true +appcancel +test eq get R 1 0 +test eq get T 5 0 +test not appsent 111 true +incoming 1 4 0 +test not appreceive 112 +note Complete CODE bytes must arrive before a code response becomes visible. +prompt true +test appask 113 +test eq get R 0 5 +test eq get Q 1 6 +test apppoll 113 true +test appsent 113 true +incoming 1 5 2 +test appreceive 114 +test eq get A 2 0 +test eq codestat 2 +test eq get R 6 0 +test apppoll 114 true +test appsent 114 true +incoming 2 5 0 +test appreceive 115 +test eq get A 2 1 +test eq get R 6 1 +test eq get R 1 0 +test eq get Code 6 49 +test apppoll 115 true +test appsent 115 true +note WAIT updates silence deadline, no answer; slow and timeout cancel both layers. +prompt false +test appask 116 +test eq get R 0 6 +test apppoll 116 true +test appsent 116 true +incoming 1 6 1 +test appreceive 117 +test eq get A 2 0 +test eq get R 4 117 +test apppoll 117 true +test appsent 117 true +v = apppoll 20116 true +test eq get A 2 5 +test eq get R 1 1 +if v +test appsent 20116 true +end +v = apppoll 30116 true +test eq get R 1 1 +if v +test appsent 30116 true +end +v = apppoll 30117 true +test eq get A 2 6 +test eq get R 1 0 +test eq get T 5 0 +test eq get A 1 0 +if v +test appsent 30117 true +end +n = get R 9 +prompt false +test not appask 30116 +test eq get R 9 n +test not apppoll 30116 true +note Invalid prompt never becomes a pending job or transcript line. +put Inlen 0 160 +test not appask 30118 +test eq get R 9 n +test eq get R 0 6 +test eq get Q 1 7 +note Receiving a code completion before send-result reporting cannot replace +note the pending datagram with the newly generated AGAIN text. +prompt true +test appask 30118 +test apppoll 30118 true +test eq get T 10 1 +holdwire +incoming 1 7 0 +unhold +test appreceive 30119 +test eq get A 2 2 +test samewire +test eq get T 10 1 +test appsent 30119 true +test apppoll 30120 true +test eq get T 10 3 +test appsent 30120 true +test apppoll 30121 true +test eq get Q 1 9 +test eq get R 0 7 +test appsent 30121 true +appcancel +note Idle runtime still refuses a new prompt while a HELLO send is outstanding. +test apppoll 32122 true +test eq get T 10 5 +holdwire +n = get R 9 +prompt false +test not appask 32122 +test samewire +test eq get R 9 n +test appsent 32122 true +note Late CODE may complete the original job before queued AGAIN is sent. +prompt true +test appask 32123 +test eq get R 0 8 +test eq get Q 1 10 +test apppoll 32123 true +test appsent 32123 true +incoming 1 8 0 +test appreceive 32124 +test gt get A 1 0 +test apppoll 32124 true +test appsent 32124 true +incoming 2 8 2 +test appreceive 32125 +test eq codestat 2 +test apppoll 32125 true +test appsent 32125 true +incoming 3 8 0 +test appreceive 32126 +test eq get A 2 1 +test eq get R 1 0 +test eq get A 1 0 +test apppoll 32126 true +test appsent 32126 true +test not apppoll 32127 true +test eq get Q 1 10 +ret int get Fails 0 +end diff --git a/native/omega/allen/tests/build-probe.om b/native/omega/allen/tests/build-probe.om new file mode 100644 index 00000000..7c339bd2 --- /dev/null +++ b/native/omega/allen/tests/build-probe.om @@ -0,0 +1,3 @@ +fn main to int +ret 23 +end diff --git a/native/omega/allen/tests/check.om b/native/omega/allen/tests/check.om new file mode 100644 index 00000000..ef085331 --- /dev/null +++ b/native/omega/allen/tests/check.om @@ -0,0 +1,17 @@ +global Fails ulong 1 +global Checks ulong 1 +fn check ok bool id ulong to void +put Checks 0 add get Checks 0 1 +outreset +emitn id +if ok +emitb 32 +emitb 48 +else +put Fails 0 add get Fails 0 1 +emitb 32 +emitb 49 +end +emitb 10 +w = write 1 Outb 0 get Outlen 0 +end diff --git a/native/omega/allen/tests/code.om b/native/omega/allen/tests/code.om new file mode 100644 index 00000000..a35ba47d --- /dev/null +++ b/native/omega/allen/tests/code.om @@ -0,0 +1,58 @@ +text Wire "CODE 7 1/1 9 3ce11e06 python print(1)\\n" +text Badwire "CODE 7 1/1 9 3ce11e06 python print(2)\\n" +text Wrongjob "CODE 8 1/1 9 3ce11e06 python print(1)\\n" +text Badnum "CODE 4294967296 1/1 9 3ce11e06 python print(1)\\n" +fn wireload to void +put Inlen 0 len Wire +for i ulong len Wire +put In i get Wire i +end +end +fn main to int +codebeg 7 +check eq codestat 0 101 +check eq missing 1 102 +wireload +check codetake 103 +check eq codestat 2 104 +check eq get C 4 1 105 +check codetake 106 +check eq get C 4 1 107 +check eq missing 0 108 +put R 0 7 +put R 1 1 +check codeshow 7 109 +check eq get R 6 1 110 +put Inlen 0 len Wrongjob +for i ulong len Wrongjob +put In i get Wrongjob i +end +check not codetake 111 +check eq codestat 2 112 +put Inlen 0 len Badwire +for i ulong len Badwire +put In i get Badwire i +end +check not codetake 113 +check eq get Code 6 49 114 +codebeg 7 +check codetake 115 +check eq codestat 3 116 +check not codeshow 7 117 +codebeg 7 +put Inlen 0 len Badnum +for i ulong len Badnum +put In i get Badnum i +end +check not codetake 118 +check eq get C 4 0 119 +wireload +put Inlen 0 sub len Wire 1 +check not codetake 120 +check eq get C 4 0 121 +wireload +check codetake 122 +put R 0 8 +check not codeshow 7 123 +ret int get Fails 0 +end diff --git a/native/omega/allen/tests/context.om b/native/omega/allen/tests/context.om new file mode 100644 index 00000000..6aeec5ec --- /dev/null +++ b/native/omega/allen/tests/context.om @@ -0,0 +1,359 @@ +text Who "Drake" +text Selfname "Allen" +text Fkey "gate code" +text Fval "4471" +text Note0 "Meet at noon." +text Note1 "Old private note." +text Note3 "Bring tools." +text MetaWant "\tself=Allen\tname=Drake\tstarts=7\tfact gate code is 4471\tnote Bring tools.\tnote Meet at noon." +text NewOnly "\tself=Allen\tname=Drake\tstarts=7\tfact gate code is 4471\tnote Bring tools." +text Emptyctx "\tself=Allen\tstarts=0" +text Lastsix "\tself=Allen\tstarts=0\tnote N9\tnote N8\tnote N7\tnote N6\tnote N5\tnote N4" +text Plural "\tself=Allen\tname=Drake\tstarts=4294967295\tfact gate code are 4471" +global Unitsave uchar 8192 +global Saveout uchar 8192 +global Saveos ulong 2 +fn test ok bool to void +put Saveos 0 get Outlen 0 +put Saveos 1 get Err 0 +for i ulong get Outlen 0 +put Saveout i get Outb i +end +check ok add get Checks 0 1 +for i ulong get Saveos 0 +put Outb i get Saveout i +end +put Outlen 0 get Saveos 0 +put Err 0 get Saveos 1 +end +fn fixture index ulong gone ulong to void +put Ns 0 len Note0 +put Ns 1 index +put Ns 2 7 +put Ns 3 gone +for i ulong len Note0 +put Note i get Note0 i +end +if eq index 1 +put Ns 0 len Note1 +for i ulong len Note1 +put Note i get Note1 i +end +end +if eq index 3 +put Ns 0 len Note3 +for i ulong len Note3 +put Note i get Note3 i +end +end +test noteenc +for i ulong 4096 +put Unit i get Enc i +end +end +fn memsetup to void +for i ulong 3692 +put Mem i 0 +end +mset32 0 7 +mset32 32 1 +mset32 36 4 +for i ulong len Who +put Mem add i 8 get Who i +end +for i ulong len Fkey +put Mem add i 40 get Fkey i +end +for i ulong len Fval +put Mem add i 88 get Fval i +end +for i ulong len Selfname +put Mem add i 153 get Selfname i +end +end +fn prompt to void +put Inlen 0 2 +put In 0 104 +put In 1 105 +end +fn main to int +test appinit 123 0 +test ctxmeta 6 +test eq get Mx 0 len Emptyctx +same = true +for i ulong len Emptyctx +if ne get Meta i get Emptyctx i +same = false +end +end +test same +memsetup +test memenc 100 +for i ulong 4096 +put Unit i get Enc i +end +loadbeg +test loadcopy 0 +test eq get St 0 100 +test ctxbegin +test eq get Cx 0 4 +test eq get Cx 1 0 +test eq get Cx 2 0 +test not ctxmeta 6 +prompt +test not appask 0 +test eq get R 0 0 +test eq get Q 1 0 +appcancel +fixture 3 0 +test eq ctxtake 3 1 +test eq get Ctxlen 3 len Note3 +test eq get Ctxstart 3 7 +test eq ctxtake 3 0 +test eq get Cx 1 1 +fixture 1 1 +test eq ctxtake 1 1 +test eq get Ctxgone 1 1 +fixture 2 0 +put Unit 64 33 +test eq ctxtake 2 2 +test eq get Cx 3 1 +test eq get Ctxgone 2 1 +test not ctxmeta 6 +fixture 0 0 +test eq ctxtake 0 1 +test eq get Cx 1 4 +test eq get Cx 2 1 +test eq get Cx 4 0 +test eq ctxtake 4 0 +test ctxmeta 6 +test eq get Mx 0 len MetaWant +same = true +for i ulong len MetaWant +if ne get Meta i get MetaWant i +same = false +end +end +test same +test ctxmeta 1 +test eq get Mx 0 len NewOnly +same = true +for i ulong len NewOnly +if ne get Meta i get NewOnly i +same = false +end +end +test same +test not ctxmeta 513 +test not ctxappend +test ctxmeta 6 +outreset +emitb 120 +test ctxappend +test eq get Outlen 0 add 1 len MetaWant +test eq get Outb 0 120 +same = true +for i ulong len MetaWant +if ne get Outb add i 1 get MetaWant i +same = false +end +end +test same +note Exercise the actual appask -> qsubmit job snapshot, not only metadata helpers. +prompt +test appask 1 +test eq get R 0 1 +test eq get Q 1 1 +test eq get R 9 1 +n = get T 8 +test ge n len MetaWant +same = ge n len MetaWant +if same +for i ulong len MetaWant +if ne get JobOut add sub n len MetaWant i get MetaWant i +same = false +end +end +end +test same +test not ctxbegin +test eq ctxtake 0 0 +appcancel +note Exact append capacity and one byte above, preserving Outb/length/error on refusal. +test ctxmeta 6 +n = sub ulong 4096 get Mx 0 +put Outlen 0 n +for i ulong n +put Outb i 90 +end +test ctxappend +test eq get Outlen 0 4096 +put Outlen 0 add n 1 +put Outb n 88 +test not ctxappend +test eq get Outlen 0 add n 1 +test eq get Outb n 88 +put Err 0 5 +test not ctxappend +test eq get Err 0 5 +outreset +mset32 36 5 +test not ctxmeta 6 +mset32 36 4 +mset32 32 33 +prompt +test not appask 2 +test eq get R 0 1 +test eq get Q 1 1 +mset32 32 1 +note Deliberately full valid facts make metadata fit but the whole JOB exceed4096. +for i ulong 3692 +put Mem i 0 +end +mset32 32 32 +for k ulong 32 +off = add 40 mul k 113 +for i ulong 47 +put Mem add off i 107 +end +for i ulong 63 +put Mem add add off 48 i 118 +end +end +test ctxmeta 6 +test le get Mx 0 4096 +prompt +test not appask 2 +test eq get R 0 1 +test eq get Q 1 1 +test eq get R 9 1 +note Catalog capacity and transaction exclusion. +mset32 36 512 +test ctxbegin +test eq get Cx 0 512 +test eq ctxtake 512 0 +fixture 511 0 +test eq ctxtake 511 1 +test eq get Ctxlen 511 len Note0 +test not ctxmeta 6 +put Tx 0 1 +test not ctxbegin +test eq ctxtake 0 0 +put Tx 0 0 +put Nt 0 1 +test not ctxbegin +test eq ctxtake 0 0 +put Nt 0 0 +mset32 36 513 +test not ctxbegin +test eq get Cx 0 512 +note Load ten real records, select exactly the newest six, and allow zero selected. +for i ulong 3692 +put Mem i 0 +end +mset32 36 10 +test ctxbegin +for k ulong 10 +put Ns 0 2 +put Ns 1 k +put Ns 2 7 +put Ns 3 0 +put Note 0 78 +put Note 1 uchar add 48 k +test noteenc +for i ulong 4096 +put Unit i get Enc i +end +test eq ctxtake k 1 +end +test ctxmeta 6 +test eq get Mx 0 len Lastsix +same = true +for i ulong len Lastsix +if ne get Meta i get Lastsix i +same = false +end +end +test same +test ctxmeta 0 +test eq get Mx 0 len Emptyctx +note Context construction cannot overwrite a staged memory/note transaction image. +for i ulong 4096 +put Unitsave i get Unit i +put Unitsave add i 4096 get Enc i +end +test ctxmeta 6 +same = true +for i ulong 4096 +if ne get Unit i get Unitsave i +same = false +end +if ne get Enc i get Unitsave add i 4096 +same = false +end +end +test same +memsetup +mset32 36 0 +mset32 0 4294967295 +put Mem 152 1 +test ctxmeta 6 +test eq get Mx 0 len Plural +same = true +for i ulong len Plural +if ne get Meta i get Plural i +same = false +end +end +test same +put Mem 40 9 +test not ctxmeta 6 +test not ctxappend +put Mem 40 103 +for i ulong 48 +put Mem add i 40 107 +end +test not ctxmeta 6 +note Thirty-two full facts and six full notes overflow metadata itself, not only JOB. +for i ulong 3692 +put Mem i 0 +end +mset32 32 32 +mset32 36 6 +for k ulong 32 +off = add 40 mul k 113 +for i ulong 47 +put Mem add off i 107 +end +for i ulong 63 +put Mem add add off 48 i 118 +end +end +test ctxbegin +for k ulong 6 +put Ns 0 127 +put Ns 1 k +put Ns 2 7 +put Ns 3 0 +for i ulong 127 +put Note i 110 +end +test noteenc +for i ulong 4096 +put Unit i get Enc i +end +test eq ctxtake k 1 +end +test not ctxmeta 6 +test eq get Mx 1 1 +outreset +emitb 90 +test not ctxappend +test eq get Outlen 0 1 +test eq get Outb 0 90 +prompt +test not appask 2 +test eq get R 0 1 +test eq get Q 1 1 +ret int get Fails 0 +end diff --git a/native/omega/allen/tests/courier.om b/native/omega/allen/tests/courier.om new file mode 100644 index 00000000..ea62f5fe --- /dev/null +++ b/native/omega/allen/tests/courier.om @@ -0,0 +1,63 @@ +text Pkt "ALLEN-COURIER v=1 run=0123456789abcdef kind=LINE seq=7 part=1/0 bytes=0\nSAY 7 1/1 Model words." +fn pktload to void +put Inlen 0 len Pkt +for i ulong len Pkt +put In i get Pkt i +end +end +fn outin to void +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +end +fn main to int +qbegin 81985529216486895 7 +pktload +check eq qreceive 1 201 +check eq get Q 4 1 202 +check eq qreceive 2 203 +check eq get Q 4 1 204 +check qtake 205 +check eq get Inlen 0 22 206 +check not qtake 207 +pktload +put In 22 uchar 49 +check eq qreceive 0 208 +check eq get Q 2 1 209 +pktload +put In 53 uchar 56 +check eq qreceive 0 210 +qbegin 81985529216486895 7 +put Inlen 0 1 +put In 0 uchar 120 +b = packet 1 7 1 1 1 +outin +check b 211 +check eq qreceive 1 212 +check eq get J 2 1 213 +check eq get Jbuf 0 120 214 +check eq qreceive 2 215 +put In sub get Inlen 0 1 uchar 121 +check eq qreceive 0 216 +check eq get Jbuf 0 120 217 +qbegin 81985529216486895 7 +put Inlen 0 1 +put In 0 uchar 122 +b = packet 1 7 2 2 1001 +outin +check b 218 +check eq qreceive 1 219 +check eq get J 2 1 220 +put Inlen 0 1000 +for i ulong 1000 +put In i uchar 120 +end +b = packet 1 7 1 2 1001 +outin +check b 221 +check eq qreceive 1 222 +check eq get J 2 2 223 +check eq get Jbuf 1000 122 224 +ret int get Fails 0 +end diff --git a/native/omega/allen/tests/edges.om b/native/omega/allen/tests/edges.om new file mode 100644 index 00000000..bf8541fa --- /dev/null +++ b/native/omega/allen/tests/edges.om @@ -0,0 +1,157 @@ +note Boundary and recovery gates. Test input construction is handwritten Omega. +fn rt_edges to void +reset +put R 0 100 +put Inlen 0 159 +for i ulong 159 +put In i uchar 120 +end +check start 1 0 1201 +check eq get R 7 159 1202 +cancel +put Inlen 0 160 +check not start 1 0 1203 +check eq get R 0 101 1204 +put Inlen 0 1 +put In 0 uchar 9 +check not start 1 0 1205 +check eq classify 0 1206 +put In 0 uchar 120 +check start 1 10 1207 +check heard get R 0 25000 1208 +check eq tick 30010 1 1209 +check eq get R 1 1 1210 +check eq tick 54999 0 1211 +check eq tick 55000 2 1212 +check not heard get R 0 55001 1213 +check restore 1214 +for i ulong 40 +check restore add 1220 i +end +check eq get R 9 32 1260 +check eq get Hlen 31 1 1261 +check eq get Hist 4960 120 1262 +end +fn codeinput part ulong total ulong bytes ulong crcval ulong count ulong to void +outreset +emitb 67 +emitb 79 +emitb 68 +emitb 69 +emitb 32 +emitn 1 +emitb 32 +emitn part +emitb 47 +emitn total +emitb 32 +emitn bytes +emitb 32 +for i ulong 8 +emitb get Digits and shr crcval mul sub 7 i 4 15 +end +emitb 32 +emitb 45 +emitb 32 +for i ulong count +emitb 120 +end +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +end +fn code_edges to void +codebeg 1 +codeinput 1 1 128 0 127 +check not codetake 1301 +check eq get C 4 0 1302 +codeinput 1 1 128 0 129 +check not codetake 1303 +codeinput 0 1 128 0 128 +check not codetake 1304 +codeinput 1 257 32769 0 128 +check not codetake 1305 +check eq get C 1 0 1306 +for i ulong 256 +codeinput add i 1 256 32768 3124632513 128 +check codetake add 1310 i +end +check eq get C 4 256 1570 +check eq missing 0 1571 +check eq codestat 2 1572 +put C 3 0 +check eq codestat 3 1575 +put C 3 3124632513 +check eq codestat 2 1573 +put R 0 1 +put R 1 1 +cancel +check not codeshow 1 1574 +end +fn lineinput part ulong bytes ulong to void +put Inlen 0 bytes +for i ulong bytes +put In i uchar 120 +end +b = packet 2 1 part 0 0 +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +end +fn q_edges to void +qbegin 1 1 +for i ulong 8 +lineinput add i 1 1 +check eq qreceive 1 add 1600 i +end +lineinput 9 1 +check eq qreceive 0 1610 +check eq get Q 4 8 1611 +check qtake 1612 +lineinput 9 1 +check eq qreceive 1 1613 +check eq get Q 4 8 1614 +lineinput 10 320 +check eq qreceive 0 1615 +check eq get Q 2 9 1616 +put Inlen 0 1001 +check not packet 1 1 1 1 1001 1617 +end +fn mem_edges to void +for i ulong 3692 +put Mem i 0 +end +mset32 32 32 +mset32 36 512 +for i ulong 32 +off = add 40 mul i 113 +put Mem off uchar 107 +put Mem add off 48 uchar 118 +end +check memenc 10 1701 +check eq get32 12 3692 1702 +check memdec 1703 +mset32 32 33 +check not memenc 11 1704 +check eq get Enc 16 10 1705 +mset32 32 32 +mset32 36 513 +check not memenc 11 1706 +mset32 36 512 +check memenc 11 1707 +put Unit 4095 uchar 1 +check not memdec 1708 +check eq get Md 0 10 1709 +check not txflush true 1710 +check not txread true 1711 +end +fn main to int +constants +rt_edges +code_edges +q_edges +mem_edges +ret int get Fails 0 +end diff --git a/native/omega/allen/tests/fixture.om b/native/omega/allen/tests/fixture.om new file mode 100644 index 00000000..c455ae27 --- /dev/null +++ b/native/omega/allen/tests/fixture.om @@ -0,0 +1,67 @@ +note Native acceptance of frozen existing courier --split fixtures, reversed. +global Stream uchar 65536 +global Starts ulong 257 +global Sizes ulong 257 +global Count ulong 1 +fn partload slot ulong to void +n = get Sizes slot +put Inlen 0 n +for i ulong n +put In i get Stream add get Starts slot i +end +end +fn main to int +n = read 0 Stream 0 len Stream +if le n 0 +ret 90 +end +used = ulong n +while gt n 0 +if eq used len Stream +ret 91 +end +n = read 0 Stream used sub len Stream used +if lt n 0 +ret 92 +end +used = add used ulong n +end +startpos = ulong 0 +for i ulong used +if eq get Stream i 10 +if eq get Stream startpos 67 +slot = get Count 0 +if ge slot 256 +ret 93 +end +put Starts slot startpos +put Sizes slot sub i startpos +put Count 0 add slot 1 +end +startpos = add i 1 +end +end +codebeg 1 +parts = get Count 0 +check gt parts 1 401 +for i ulong sub parts 1 +partload sub sub parts 1 i +check codetake add 410 i +end +check eq codestat 1 402 +check eq missing 1 403 +partload 0 +check codetake 404 +check eq codestat 2 405 +check eq get C 4 parts 406 +for i ulong parts +partload i +check codetake add 700 i +end +check eq get C 4 parts 407 +check eq codestat 2 408 +partload 0 +put In 5 uchar 50 +check not codetake 409 +ret int get Fails 0 +end diff --git a/native/omega/allen/tests/font-mutants.om b/native/omega/allen/tests/font-mutants.om new file mode 100644 index 00000000..feee03fd --- /dev/null +++ b/native/omega/allen/tests/font-mutants.om @@ -0,0 +1,101 @@ +note Reuse native mutation builder; selector0 square-root,1 full-coverage. +global Mutbuf uchar 262144 +global Mutrep uchar 128 +global Mutmode uchar 1 +text Mutold0 "\nr = add shr r 1 bit\n" +text Mutnew0 "\nr = shr r 1\n" +text Mutold1 "\nif ge cov 256\nret 255\nend\n" +text Mutnew1 "\nif ge cov 256\nret 254\nend\n" +fn mutmatch at ulong mode uchar to bool +if eq mode 48 +for i ulong len Mutold0 +if ne get Mutbuf add at i get Mutold0 i +ret false +end +end +else +for i ulong len Mutold1 +if ne get Mutbuf add at i get Mutold1 i +ret false +end +end +end +ret true +end +fn mutwrite at ulong size ulong to bool +p = ulong 0 +while lt p size +n = write 1 Mutbuf add at p sub size p +if le n 0 +ret false +end +p = add p ulong n +end +ret true +end +fn mutout n ulong mode uchar to int +old = len Mutold0 +size = len Mutnew0 +if eq mode 49 +old = len Mutold1 +size = len Mutnew1 +end +if lt n old +ret 65 +end +found = ulong 0 +at = ulong 0 +for i ulong add sub n old 1 +if mutmatch i mode +found = add found 1 +at = i +end +end +if ne found 1 +ret 65 +end +for i ulong size +if eq mode 48 +put Mutrep i get Mutnew0 i +else +put Mutrep i get Mutnew1 i +end +end +if not mutwrite 0 at +ret 74 +end +p = ulong 0 +while lt p size +r = write 1 Mutrep p sub size p +if le r 0 +ret 74 +end +p = add p ulong r +end +if not mutwrite add at old sub n add at old +ret 74 +end +ret 0 +end +fn main to int +r = read 0 Mutmode 0 1 +if ne r 1 +ret 65 +end +mode = get Mutmode 0 +if and ne mode 48 ne mode 49 +ret 65 +end +n = ulong 0 +while lt n len Mutbuf +r = read 0 Mutbuf n sub len Mutbuf n +if lt r 0 +ret 74 +end +if eq r 0 +ret mutout n mode +end +n = add n ulong r +end +ret 65 +end diff --git a/native/omega/allen/tests/font-output.om b/native/omega/allen/tests/font-output.om new file mode 100644 index 00000000..e51f7d5f --- /dev/null +++ b/native/omega/allen/tests/font-output.om @@ -0,0 +1,83 @@ +note Native glyph stream for byte comparison with the external legacy oracle. +fn afword v ulong to void +for i ulong 8 +emitb uchar and shr v mul i 8 255 +end +end +fn afsigned v long to void +if lt v 0 +afword xor ulong 18446744073709551615 ulong sub neg v 1 +else +afword ulong v +end +end +fn afhead to bool +p = ulong 0 +while lt p get Outlen 0 +n = write 1 Outb p sub get Outlen 0 p +if le n 0 +ret false +end +p = add p ulong n +end +ret true +end +fn afemit cap ulong wt ulong c uchar to bool +if not afglyph c +ret false +end +outreset +afword cap +afword wt +afword ulong c +afword get Af 3 +afword get Af 4 +afsigned get Ab 0 +afsigned get Ab 1 +afword get Af 5 +if not afhead +ret false +end +size = mul get Af 3 get Af 4 +p = ulong 0 +while lt p size +n = write 1 Alpha p sub size p +if le n 0 +ret false +end +p = add p ulong n +end +ret true +end +fn main to int +for mode ulong 3 +cap = ulong 14 +wt = ulong 900 +if eq mode 1 +cap = 30 +wt = 1250 +end +if eq mode 2 +cap = 64 +wt = 2500 +end +if not afinit cap wt +ret 1 +end +for i ulong 95 +if not afemit cap wt uchar add i 32 +ret 1 +end +end +if not afemit cap wt 0 +ret 1 +end +if not afemit cap wt 127 +ret 1 +end +if not afemit cap wt 255 +ret 1 +end +end +ret 0 +end diff --git a/native/omega/allen/tests/font-render.om b/native/omega/allen/tests/font-render.om new file mode 100644 index 00000000..9e898738 --- /dev/null +++ b/native/omega/allen/tests/font-render.om @@ -0,0 +1,79 @@ +note Actual native 768x384 printable-ASCII specimen; no image generator. +note Uses the shared bounded RGB surface storage. +global Fpose long 2 +text Fontppm "P6\n768 384\n255\n" +fn fblend bg ulong fg ulong a ulong to uchar +n = mul bg sub ulong 255 a +n = add n mul fg a +ret uchar div n 255 +end +fn fpixel x long y long a uchar to void +if or lt x 0 ge x 768 +ret +end +if or lt y 0 ge y 384 +ret +end +at = mul add mul ulong y 768 ulong x 3 +alpha = ulong a +put Canvas at fblend 6 236 alpha +put Canvas add at 1 fblend 8 240 alpha +put Canvas add at 2 fblend 18 252 alpha +end +fn frow yy ulong to void +y = add get Fpose 1 long yy +at = mul yy get Af 3 +for x ulong get Af 3 +px = add get Fpose 0 long x +a = get Alpha add at x +fpixel px y a +end +end +fn fdraw px long py long to void +put Fpose 0 add px get Ab 0 +put Fpose 1 add py get Ab 1 +for y ulong get Af 4 +frow y +end +end +fn foutput to bool +p = ulong 0 +while lt p len Fontppm +n = write 1 Fontppm p sub len Fontppm p +if le n 0 +ret false +end +p = add p ulong n +end +p = 0 +while lt p len Canvas +n = write 1 Canvas p sub len Canvas p +if le n 0 +ret false +end +p = add p ulong n +end +ret true +end +fn main to int +if not afinit 30 1250 +ret 1 +end +for i ulong mul ulong 768 384 +put Canvas mul i 3 6 +put Canvas add mul i 3 1 8 +put Canvas add mul i 3 2 18 +end +for i ulong 95 +if not afglyph uchar add i 32 +ret 1 +end +x = long add mul rem i 16 48 8 +y = long add mul div i 16 64 45 +fdraw x y +end +if not foutput +ret 74 +end +ret 0 +end diff --git a/native/omega/allen/tests/font.om b/native/omega/allen/tests/font.om new file mode 100644 index 00000000..325ce60f --- /dev/null +++ b/native/omega/allen/tests/font.om @@ -0,0 +1,114 @@ +global Oldmask uchar 65536 +global Oldmeta ulong 6 +fn test ok bool to void +check ok add get Checks 0 1 +end +fn asym to bool +w = get Af 3 +for y ulong get Af 4 +at = mul y w +for x ulong w +a = long get Alpha add at x +mirror = add at sub sub w 1 x +b = long get Alpha mirror +d = sub a b +if gt d 40 +ret false +end +if lt d -40 +ret false +end +end +end +ret true +end +fn main to int +test not afglyph 65 +test not afinit 0 1250 +test not afinit 65 1250 +test not afinit 30 0 +test not afinit 30 2501 +test afinit 30 1250 +test eq get Af 0 384 +test eq get Af 1 480 +test eq afsqrt 0 0 +test eq afsqrt 15 3 +test eq afsqrt 16 4 +test eq afsqrt 18446744073709551615 4294967295 +test eq afsqrt mul ulong 1000000007 1000000007 1000000007 +test eq afsin 0 0 +test eq afsin 90 16384 +test eq afsin -90 -16384 +test eq afsin 450 16384 +test eq afcos 180 -16384 +for c ulong 95 +test afglyph uchar add c 32 +test gt get Af 5 0 +test le mul get Af 3 get Af 4 len Alpha +if eq c 0 +test eq get Af 3 0 +test eq get Af 4 1 +else +ink = ulong 0 +for i ulong mul get Af 3 get Af 4 +if gt get Alpha i 128 +ink = add ink 1 +end +end +test ge ink 4 +end +end +test afglyph 111 +test asym +test afglyph 63 +for i ulong mul get Af 3 get Af 4 +put Oldmask i get Alpha i +end +for i ulong 6 +put Oldmeta i get Af i +end +test afglyph 0 +same = true +for i ulong 6 +if ne get Oldmeta i get Af i +same = false +end +end +for i ulong mul get Af 3 get Af 4 +if ne get Oldmask i get Alpha i +same = false +end +end +test same +test not afinit 999 1250 +test eq get Af 0 get Oldmeta 0 +test eq get Af 3 get Oldmeta 3 +test afinit 64 2500 +test afglyph 87 +test le mul get Af 3 get Af 4 len Alpha +test afinit 1 1 +test afglyph 65 +note Independent analytic coverage for round-capped strokes and zero-length dots. +put Af 2 1 +put Af 1 128 +put Ag 0 0 +put Ag 1 0 +put Ag 2 512 +put Ag 3 0 +test eq afalpha 256 0 255 +test eq afalpha 256 128 127 +test eq afalpha 256 256 0 +test eq afalpha 768 0 0 +test eq afalpha -128 0 127 +put Ag 0 512 +put Ag 2 0 +test eq afalpha 256 128 127 +put Ag 0 0 +test eq afalpha 0 0 255 +test eq afalpha 0 128 127 +test eq afalpha 0 256 0 +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/native/omega/allen/tests/github-fixtures.om b/native/omega/allen/tests/github-fixtures.om new file mode 100644 index 00000000..a74f8725 --- /dev/null +++ b/native/omega/allen/tests/github-fixtures.om @@ -0,0 +1,8 @@ +note SPDX-License-Identifier: AGPL-3.0-only +note TEST ONLY: real API response fixtures captured 2026-10-25, not runtime fallback. +note Metadata https://api.github.com/repos/aien-dev/allen +note Commit and contents pin e97222eb82f1ec56e852ba9571786db9ccc5c97a. +note Source JSON formatting follows the read tool; field bodies are preserved. +text Gxmeta "{\n \"id\": 1427000265,\n \"node_id\": \"R_kgDOVQ5LyQ\",\n \"name\": \"allen\",\n \"full_name\": \"aien-dev/allen\",\n \"private\": false,\n \"owner\": {\n \"login\": \"aien-dev\",\n \"id\": 342055988,\n \"node_id\": \"O_kgDOFGNcNA\",\n \"avatar_url\": \"https://avatars.githubusercontent.com/u/342055988?v=4\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/aien-dev\",\n \"html_url\": \"https://github.com/aien-dev\",\n \"followers_url\": \"https://api.github.com/users/aien-dev/followers\",\n \"following_url\": \"https://api.github.com/users/aien-dev/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/aien-dev/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/aien-dev/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/aien-dev/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/aien-dev/orgs\",\n \"repos_url\": \"https://api.github.com/users/aien-dev/repos\",\n \"events_url\": \"https://api.github.com/users/aien-dev/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/aien-dev/received_events\",\n \"type\": \"Organization\",\n \"user_view_type\": \"public\",\n \"site_admin\": false\n },\n \"html_url\": \"https://github.com/aien-dev/allen\",\n \"description\": \"Allen: AIEN's persistent subject, one identity across the iMac, Pi, Spark and MacBook. Project home for the Allen programme (P0 to P7), B0 acceptance contract, data contracts, evaluation harness. Pre-alpha.\",\n \"fork\": false,\n \"url\": \"https://api.github.com/repos/aien-dev/allen\",\n \"forks_url\": \"https://api.github.com/repos/aien-dev/allen/forks\",\n \"keys_url\": \"https://api.github.com/repos/aien-dev/allen/keys{/key_id}\",\n \"collaborators_url\": \"https://api.github.com/repos/aien-dev/allen/collaborators{/collaborator}\",\n \"teams_url\": \"https://api.github.com/repos/aien-dev/allen/teams\",\n \"hooks_url\": \"https://api.github.com/repos/aien-dev/allen/hooks\",\n \"issue_events_url\": \"https://api.github.com/repos/aien-dev/allen/issues/events{/number}\",\n \"events_url\": \"https://api.github.com/repos/aien-dev/allen/events\",\n \"assignees_url\": \"https://api.github.com/repos/aien-dev/allen/assignees{/user}\",\n \"branches_url\": \"https://api.github.com/repos/aien-dev/allen/branches{/branch}\",\n \"tags_url\": \"https://api.github.com/repos/aien-dev/allen/tags\",\n \"blobs_url\": \"https://api.github.com/repos/aien-dev/allen/git/blobs{/sha}\",\n \"git_tags_url\": \"https://api.github.com/repos/aien-dev/allen/git/tags{/sha}\",\n \"git_refs_url\": \"https://api.github.com/repos/aien-dev/allen/git/refs{/sha}\",\n \"trees_url\": \"https://api.github.com/repos/aien-dev/allen/git/trees{/sha}\",\n \"statuses_url\": \"https://api.github.com/repos/aien-dev/allen/statuses/{sha}\",\n \"languages_url\": \"https://api.github.com/repos/aien-dev/allen/languages\",\n \"stargazers_url\": \"https://api.github.com/repos/aien-dev/allen/stargazers\",\n \"contributors_url\": \"https://api.github.com/repos/aien-dev/allen/contributors\",\n \"subscribers_url\": \"https://api.github.com/repos/aien-dev/allen/subscribers\",\n \"subscription_url\": \"https://api.github.com/repos/aien-dev/allen/subscription\",\n \"commits_url\": \"https://api.github.com/repos/aien-dev/allen/commits{/sha}\",\n \"git_commits_url\": \"https://api.github.com/repos/aien-dev/allen/git/commits{/sha}\",\n \"comments_url\": \"https://api.github.com/repos/aien-dev/allen/comments{/number}\",\n \"issue_comment_url\": \"https://api.github.com/repos/aien-dev/allen/issues/comments{/number}\",\n \"contents_url\": \"https://api.github.com/repos/aien-dev/allen/contents/{+path}\",\n \"compare_url\": \"https://api.github.com/repos/aien-dev/allen/compare/{base}...{head}\",\n \"merges_url\": \"https://api.github.com/repos/aien-dev/allen/merges\",\n \"archive_url\": \"https://api.github.com/repos/aien-dev/allen/{archive_format}{/ref}\",\n \"downloads_url\": \"https://api.github.com/repos/aien-dev/allen/downloads\",\n \"issues_url\": \"https://api.github.com/repos/aien-dev/allen/issues{/number}\",\n \"pulls_url\": \"https://api.github.com/repos/aien-dev/allen/pulls{/number}\",\n \"milestones_url\": \"https://api.github.com/repos/aien-dev/allen/milestones{/number}\",\n \"notifications_url\": \"https://api.github.com/repos/aien-dev/allen/notifications{?since,all,participating}\",\n \"labels_url\": \"https://api.github.com/repos/aien-dev/allen/labels{/name}\",\n \"releases_url\": \"https://api.github.com/repos/aien-dev/allen/releases{/id}\",\n \"deployments_url\": \"https://api.github.com/repos/aien-dev/allen/deployments\",\n \"created_at\": \"2026-10-20T12:33:56Z\",\n \"updated_at\": \"2026-10-23T15:27:04Z\",\n \"pushed_at\": \"2026-10-24T18:38:09Z\",\n \"git_url\": \"git://github.com/aien-dev/allen.git\",\n \"ssh_url\": \"git@github.com:aien-dev/allen.git\",\n \"clone_url\": \"https://github.com/aien-dev/allen.git\",\n \"svn_url\": \"https://github.com/aien-dev/allen\",\n \"homepage\": null,\n \"size\": 268,\n \"stargazers_count\": 0,\n \"watchers_count\": 0,\n \"language\": null,\n \"has_issues\": true,\n \"has_projects\": true,\n \"has_downloads\": false,\n \"has_wiki\": false,\n \"has_pages\": false,\n \"has_discussions\": false,\n \"forks_count\": 0,\n \"mirror_url\": null,\n \"archived\": false,\n \"disabled\": false,\n \"open_issues_count\": 14,\n \"license\": {\n \"key\": \"agpl-3.0\",\n \"name\": \"GNU Affero General Public License v3.0\",\n \"spdx_id\": \"AGPL-3.0\",\n \"url\": \"https://api.github.com/licenses/agpl-3.0\",\n \"node_id\": \"MDc6TGljZW5zZTE=\"\n },\n \"allow_forking\": true,\n \"is_template\": false,\n \"web_commit_signoff_required\": false,\n \"has_pull_requests\": true,\n \"pull_request_creation_policy\": \"all\",\n \"topics\": [],\n \"visibility\": \"public\",\n \"forks\": 0,\n \"open_issues\": 14,\n \"watchers\": 0,\n \"default_branch\": \"main\",\n \"temp_clone_token\": null,\n \"custom_properties\": {},\n \"organization\": {\n \"login\": \"aien-dev\",\n \"id\": 342055988,\n \"node_id\": \"O_kgDOFGNcNA\",\n \"avatar_url\": \"https://avatars.githubusercontent.com/u/342055988?v=4\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/aien-dev\",\n \"html_url\": \"https://github.com/aien-dev\",\n \"followers_url\": \"https://api.github.com/users/aien-dev/followers\",\n \"following_url\": \"https://api.github.com/users/aien-dev/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/aien-dev/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/aien-dev/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/aien-dev/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/aien-dev/orgs\",\n \"repos_url\": \"https://api.github.com/users/aien-dev/repos\",\n \"events_url\": \"https://api.github.com/users/aien-dev/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/aien-dev/received_events\",\n \"type\": \"Organization\",\n \"user_view_type\": \"public\",\n \"site_admin\": false\n },\n \"network_count\": 0,\n \"subscribers_count\": 0\n}" +text Gxcommit "{\n \"sha\": \"e97222eb82f1ec56e852ba9571786db9ccc5c97a\",\n \"node_id\": \"C_kwDOVQ5LydoAKGU5NzIyMmViODJmMWVjNTZlODUyYmE5NTcxNzg2ZGI5Y2NjNWM5N2E\",\n \"commit\": {\n \"author\": {\n \"name\": \"Drake Stapleton\",\n \"email\": \"drake@aienos.com\",\n \"date\": \"2026-10-20T12:35:09Z\"\n },\n \"committer\": {\n \"name\": \"Drake Stapleton\",\n \"email\": \"drake@aienos.com\",\n \"date\": \"2026-10-20T12:35:09Z\"\n },\n \"message\": \"P0: phase ledger with transferred issue numbers (#1 programme, #2..#9 = P0..P7)\",\n \"tree\": {\n \"sha\": \"2a83aef799f4c3c3585c2e29277cadc2f86c5b51\",\n \"url\": \"https://api.github.com/repos/aien-dev/allen/git/trees/2a83aef799f4c3c3585c2e29277cadc2f86c5b51\"\n },\n \"url\": \"https://api.github.com/repos/aien-dev/allen/git/commits/e97222eb82f1ec56e852ba9571786db9ccc5c97a\",\n \"comment_count\": 0,\n \"verification\": {\n \"verified\": false,\n \"reason\": \"unsigned\",\n \"signature\": null,\n \"payload\": null,\n \"verified_at\": null\n }\n },\n \"url\": \"https://api.github.com/repos/aien-dev/allen/commits/e97222eb82f1ec56e852ba9571786db9ccc5c97a\",\n \"html_url\": \"https://github.com/aien-dev/allen/commit/e97222eb82f1ec56e852ba9571786db9ccc5c97a\",\n \"comments_url\": \"https://api.github.com/repos/aien-dev/allen/commits/e97222eb82f1ec56e852ba9571786db9ccc5c97a/comments\",\n \"author\": {\n \"login\": \"drakestapleton\",\n \"id\": 213298340,\n \"node_id\": \"U_kgDODLaspA\",\n \"avatar_url\": \"https://avatars.githubusercontent.com/u/213298340?v=4\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/drakestapleton\",\n \"html_url\": \"https://github.com/drakestapleton\",\n \"followers_url\": \"https://api.github.com/users/drakestapleton/followers\",\n \"following_url\": \"https://api.github.com/users/drakestapleton/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/drakestapleton/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/drakestapleton/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/drakestapleton/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/drakestapleton/orgs\",\n \"repos_url\": \"https://api.github.com/users/drakestapleton/repos\",\n \"events_url\": \"https://api.github.com/users/drakestapleton/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/drakestapleton/received_events\",\n \"type\": \"User\",\n \"user_view_type\": \"public\",\n \"site_admin\": false\n },\n \"committer\": {\n \"login\": \"drakestapleton\",\n \"id\": 213298340,\n \"node_id\": \"U_kgDODLaspA\",\n \"avatar_url\": \"https://avatars.githubusercontent.com/u/213298340?v=4\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/drakestapleton\",\n \"html_url\": \"https://github.com/drakestapleton\",\n \"followers_url\": \"https://api.github.com/users/drakestapleton/followers\",\n \"following_url\": \"https://api.github.com/users/drakestapleton/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/drakestapleton/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/drakestapleton/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/drakestapleton/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/drakestapleton/orgs\",\n \"repos_url\": \"https://api.github.com/users/drakestapleton/repos\",\n \"events_url\": \"https://api.github.com/users/drakestapleton/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/drakestapleton/received_events\",\n \"type\": \"User\",\n \"user_view_type\": \"public\",\n \"site_admin\": false\n },\n \"parents\": [\n {\n \"sha\": \"2949450005a2df34e48da90bd40037841d49b3da\",\n \"url\": \"https://api.github.com/repos/aien-dev/allen/commits/2949450005a2df34e48da90bd40037841d49b3da\",\n \"html_url\": \"https://github.com/aien-dev/allen/commit/2949450005a2df34e48da90bd40037841d49b3da\"\n }\n ],\n \"stats\": {\n \"total\": 30,\n \"additions\": 29,\n \"deletions\": 1\n },\n \"files\": [\n {\n \"sha\": \"d42f5dea4ca628f6ee539da8d2b732b52faf03ec\",\n \"filename\": \"docs/PHASES.md\",\n \"status\": \"modified\",\n \"additions\": 29,\n \"deletions\": 1,\n \"changes\": 30,\n \"blob_url\": \"https://github.com/aien-dev/allen/blob/e97222eb82f1ec56e852ba9571786db9ccc5c97a/docs%2FPHASES.md\",\n \"raw_url\": \"https://github.com/aien-dev/allen/raw/e97222eb82f1ec56e852ba9571786db9ccc5c97a/docs%2FPHASES.md\",\n \"contents_url\": \"https://api.github.com/repos/aien-dev/allen/contents/docs%2FPHASES.md?ref=e97222eb82f1ec56e852ba9571786db9ccc5c97a\",\n \"patch\": \"@@ -1,3 +1,31 @@\\n # Phase ledger\\n \\n-Filled after the issue transfer (coordinator).\\n+Programme issue: [aien-dev/allen#1](https://github.com/aien-dev/allen/issues/1) (transferred 2026-10-20 from aien-architecture-mv#278; the old URL redirects, comments and history preserved).\\n+\\n+Phase numbers are sequence, not priority. Progress status words: PROPOSED, SCOPED, ACTIVE, IN_REVIEW, COMPLETE. Qualification verdicts are separate: PASS, FAIL, INCONCLUSIVE, NOT_RUN. A phase closes only with its acceptance evidence; the programme close guard (`guard/`) reopens the programme otherwise.\\n+\\n+| Phase | Issue here | Former issue | Title | Status | Qualification |\\n+|---|---|---|---|---|---|\\n+| P0 | [#2](https://github.com/aien-dev/allen/issues/2) | arch#279 | Establish Allen's own repository, mission and B0 acceptance contract | ACTIVE (2026-10-20) | NOT_RUN |\\n+| P1 | [#3](https://github.com/aien-dev/allen/issues/3) | arch#280 | Build reproducible training episodes from the existing conversation archive | PROPOSED | NOT_RUN |\\n+| P2 | [#4](https://github.com/aien-dev/allen/issues/4) | arch#281 | Label human intent, corrections, successes and failures with evidence | PROPOSED | NOT_RUN |\\n+| P3 | [#5](https://github.com/aien-dev/allen/issues/5) | arch#282 | Freeze leakage-resistant evaluations and measure the baseline | PROPOSED | NOT_RUN |\\n+| P4 | [#6](https://github.com/aien-dev/allen/issues/6) | arch#283 | Train and compare a bounded first personal Allen candidate | PROPOSED | NOT_RUN |\\n+| P5 | [#7](https://github.com/aien-dev/allen/issues/7) | arch#284 | Qualify Allen B0 through one complete personal-assistance experience | PROPOSED | NOT_RUN |\\n+| P6 | [#8](https://github.com/aien-dev/allen/issues/8) | arch#285 | Keep one Allen continuous across iMac, Pi, Spark and MacBook | PROPOSED | NOT_RUN |\\n+| P7 | [#9](https://github.com/aien-dev/allen/issues/9) | arch#286 | Learn continually and anticipate useful help under bounded exploration | PROPOSED | NOT_RUN |\\n+\\n+Order: P0 -> P1 -> P2 -> P3 -> P4 -> P5 produces B0 only if its gates pass; P6 extends continuity to the four devices; P7 adds evaluated continual learning. P3's evaluation schema may be drafted during P1/P2, but evaluation data is isolated before any fitting, retrieval indexing or preference extraction.\\n+\\n+## Mandatory external prerequisites (programme cannot close while any is open)\\n+\\n+Verified OPEN when the gate was written (2026-10-20). The close guard reads this list from `guard/policy.toml`; keep both in step.\\n+\\n+| Area | Issues |\\n+|---|---|\\n+| Identity, persona, experience, release | aien-architecture-mv #159, #269, #190 |\\n+| Physical Pi to Spark execution and independent acceptance | aien-architecture-mv #231, #232; aienos-mv #396, #398, #399; aien-protocols-mv #27; aien-sovereign-core-mv #586; omega-mv #505; aegis-runtime-mv #53 |\\n+| Native Spark model path | aienos-mv #286, #327 (evaluated under aien-architecture-mv #190) |\\n+| Learning economics and out-of-sample evidence | aien-architecture-mv #246, #262, #263, #276; omega-mv #583, #584, #600 |\\n+\\n+P6 owns the remaining iMac and MacBook physical qualification if no existing issue owns it.\"\n }\n ]\n}" +text Gxfiles "[\n {\n \"name\": \".gitignore\",\n \"path\": \".gitignore\",\n \"sha\": \"390c8e3273edabcd8e2c1578fa34c90724dce7d0\",\n \"size\": 197,\n \"url\": \"https://api.github.com/repos/aien-dev/allen/contents/.gitignore?ref=e97222eb82f1ec56e852ba9571786db9ccc5c97a\",\n \"html_url\": \"https://github.com/aien-dev/allen/blob/e97222eb82f1ec56e852ba9571786db9ccc5c97a/.gitignore\",\n \"git_url\": \"https://api.github.com/repos/aien-dev/allen/git/blobs/390c8e3273edabcd8e2c1578fa34c90724dce7d0\",\n \"download_url\": \"https://raw.githubusercontent.com/aien-dev/allen/e97222eb82f1ec56e852ba9571786db9ccc5c97a/.gitignore\",\n \"type\": \"file\",\n \"_links\": {\n \"self\": \"https://api.github.com/repos/aien-dev/allen/contents/.gitignore?ref=e97222eb82f1ec56e852ba9571786db9ccc5c97a\",\n \"git\": \"https://api.github.com/repos/aien-dev/allen/git/blobs/390c8e3273edabcd8e2c1578fa34c90724dce7d0\",\n \"html\": \"https://github.com/aien-dev/allen/blob/e97222eb82f1ec56e852ba9571786db9ccc5c97a/.gitignore\"\n }\n },\n {\n \"name\": \"AGENTS.md\",\n \"path\": \"AGENTS.md\",\n \"sha\": \"be2dc5881948cb8140a5e500ce71e45b5a34f88b\",\n \"size\": 1985,\n \"url\": \"https://api.github.com/repos/aien-dev/allen/contents/AGENTS.md?ref=e97222eb82f1ec56e852ba9571786db9ccc5c97a\",\n \"html_url\": \"https://github.com/aien-dev/allen/blob/e97222eb82f1ec56e852ba9571786db9ccc5c97a/AGENTS.md\",\n \"git_url\": \"https://api.github.com/repos/aien-dev/allen/git/blobs/be2dc5881948cb8140a5e500ce71e45b5a34f88b\",\n \"download_url\": \"https://raw.githubusercontent.com/aien-dev/allen/e97222eb82f1ec56e852ba9571786db9ccc5c97a/AGENTS.md\",\n \"type\": \"file\",\n \"_links\": {\n \"self\": \"https://api.github.com/repos/aien-dev/allen/contents/AGENTS.md?ref=e97222eb82f1ec56e852ba9571786db9ccc5c97a\",\n \"git\": \"https://api.github.com/repos/aien-dev/allen/git/blobs/be2dc5881948cb8140a5e500ce71e45b5a34f88b\",\n \"html\": \"https://github.com/aien-dev/allen/blob/e97222eb82f1ec56e852ba9571786db9ccc5c97a/AGENTS.md\"\n }\n },\n {\n \"name\": \"LICENSE\",\n \"path\": \"LICENSE\",\n \"sha\": \"be3f7b28e564e7dd05eaf59d64adba1a4065ac0e\",\n \"size\": 34523,\n \"url\": \"https://api.github.com/repos/aien-dev/allen/contents/LICENSE?ref=e97222eb82f1ec56e852ba9571786db9ccc5c97a\",\n \"html_url\": \"https://github.com/aien-dev/allen/blob/e97222eb82f1ec56e852ba9571786db9ccc5c97a/LICENSE\",\n \"git_url\": \"https://api.github.com/repos/aien-dev/allen/git/blobs/be3f7b28e564e7dd05eaf59d64adba1a4065ac0e\",\n \"download_url\": \"https://raw.githubusercontent.com/aien-dev/allen/e97222eb82f1ec56e852ba9571786db9ccc5c97a/LICENSE\",\n \"type\": \"file\",\n \"_links\": {\n \"self\": \"https://api.github.com/repos/aien-dev/allen/contents/LICENSE?ref=e97222eb82f1ec56e852ba9571786db9ccc5c97a\",\n \"git\": \"https://api.github.com/repos/aien-dev/allen/git/blobs/be3f7b28e564e7dd05eaf59d64adba1a4065ac0e\",\n \"html\": \"https://github.com/aien-dev/allen/blob/e97222eb82f1ec56e852ba9571786db9ccc5c97a/LICENSE\"\n }\n },\n {\n \"name\": \"README.md\",\n \"path\": \"README.md\",\n \"sha\": \"b6d15246083290c3c4a0d4acf8e6e4bfd1fd6116\",\n \"size\": 2720,\n \"url\": \"https://api.github.com/repos/aien-dev/allen/contents/README.md?ref=e97222eb82f1ec56e852ba9571786db9ccc5c97a\",\n \"html_url\": \"https://github.com/aien-dev/allen/blob/e97222eb82f1ec56e852ba9571786db9ccc5c97a/README.md\",\n \"git_url\": \"https://api.github.com/repos/aien-dev/allen/git/blobs/b6d15246083290c3c4a0d4acf8e6e4bfd1fd6116\",\n \"download_url\": \"https://raw.githubusercontent.com/aien-dev/allen/e97222eb82f1ec56e852ba9571786db9ccc5c97a/README.md\",\n \"type\": \"file\",\n \"_links\": {\n \"self\": \"https://api.github.com/repos/aien-dev/allen/contents/README.md?ref=e97222eb82f1ec56e852ba9571786db9ccc5c97a\",\n \"git\": \"https://api.github.com/repos/aien-dev/allen/git/blobs/b6d15246083290c3c4a0d4acf8e6e4bfd1fd6116\",\n \"html\": \"https://github.com/aien-dev/allen/blob/e97222eb82f1ec56e852ba9571786db9ccc5c97a/README.md\"\n }\n },\n {\n \"name\": \"docs\",\n \"path\": \"docs\",\n \"sha\": \"d8aaf6c45adb0d7df2a30f67d227b54a5314b460\",\n \"size\": 0,\n \"url\": \"https://api.github.com/repos/aien-dev/allen/contents/docs?ref=e97222eb82f1ec56e852ba9571786db9ccc5c97a\",\n \"html_url\": \"https://github.com/aien-dev/allen/tree/e97222eb82f1ec56e852ba9571786db9ccc5c97a/docs\",\n \"git_url\": \"https://api.github.com/repos/aien-dev/allen/git/trees/d8aaf6c45adb0d7df2a30f67d227b54a5314b460\",\n \"download_url\": null,\n \"type\": \"dir\",\n \"_links\": {\n \"self\": \"https://api.github.com/repos/aien-dev/allen/contents/docs?ref=e97222eb82f1ec56e852ba9571786db9ccc5c97a\",\n \"git\": \"https://api.github.com/repos/aien-dev/allen/git/trees/d8aaf6c45adb0d7df2a30f67d227b54a5314b460\",\n \"html\": \"https://github.com/aien-dev/allen/tree/e97222eb82f1ec56e852ba9571786db9ccc5c97a/docs\"\n }\n },\n {\n \"name\": \"evidence\",\n \"path\": \"evidence\",\n \"sha\": \"d564d0bc3dd917926892c55e3706cc116d5b165e\",\n \"size\": 0,\n \"url\": \"https://api.github.com/repos/aien-dev/allen/contents/evidence?ref=e97222eb82f1ec56e852ba9571786db9ccc5c97a\",\n \"html_url\": \"https://github.com/aien-dev/allen/tree/e97222eb82f1ec56e852ba9571786db9ccc5c97a/evidence\",\n \"git_url\": \"https://api.github.com/repos/aien-dev/allen/git/trees/d564d0bc3dd917926892c55e3706cc116d5b165e\",\n \"download_url\": null,\n \"type\": \"dir\",\n \"_links\": {\n \"self\": \"https://api.github.com/repos/aien-dev/allen/contents/evidence?ref=e97222eb82f1ec56e852ba9571786db9ccc5c97a\",\n \"git\": \"https://api.github.com/repos/aien-dev/allen/git/trees/d564d0bc3dd917926892c55e3706cc116d5b165e\",\n \"html\": \"https://github.com/aien-dev/allen/tree/e97222eb82f1ec56e852ba9571786db9ccc5c97a/evidence\"\n }\n },\n {\n \"name\": \"guard\",\n \"path\": \"guard\",\n \"sha\": \"d564d0bc3dd917926892c55e3706cc116d5b165e\",\n \"size\": 0,\n \"url\": \"https://api.github.com/repos/aien-dev/allen/contents/guard?ref=e97222eb82f1ec56e852ba9571786db9ccc5c97a\",\n \"html_url\": \"https://github.com/aien-dev/allen/tree/e97222eb82f1ec56e852ba9571786db9ccc5c97a/guard\",\n \"git_url\": \"https://api.github.com/repos/aien-dev/allen/git/trees/d564d0bc3dd917926892c55e3706cc116d5b165e\",\n \"download_url\": null,\n \"type\": \"dir\",\n \"_links\": {\n \"self\": \"https://api.github.com/repos/aien-dev/allen/contents/guard?ref=e97222eb82f1ec56e852ba9571786db9ccc5c97a\",\n \"git\": \"https://api.github.com/repos/aien-dev/allen/git/trees/d564d0bc3dd917926892c55e3706cc116d5b165e\",\n \"html\": \"https://github.com/aien-dev/allen/tree/e97222eb82f1ec56e852ba9571786db9ccc5c97a/guard\"\n }\n },\n {\n \"name\": \"inventory\",\n \"path\": \"inventory\",\n \"sha\": \"d564d0bc3dd917926892c55e3706cc116d5b165e\",\n \"size\": 0,\n \"url\": \"https://api.github.com/repos/aien-dev/allen/contents/inventory?ref=e97222eb82f1ec56e852ba9571786db9ccc5c97a\",\n \"html_url\": \"https://github.com/aien-dev/allen/tree/e97222eb82f1ec56e852ba9571786db9ccc5c97a/inventory\",\n \"git_url\": \"https://api.github.com/repos/aien-dev/allen/git/trees/d564d0bc3dd917926892c55e3706cc116d5b165e\",\n \"download_url\": null,\n \"type\": \"dir\",\n \"_links\": {\n \"self\": \"https://api.github.com/repos/aien-dev/allen/contents/inventory?ref=e97222eb82f1ec56e852ba9571786db9ccc5c97a\",\n \"git\": \"https://api.github.com/repos/aien-dev/allen/git/trees/d564d0bc3dd917926892c55e3706cc116d5b165e\",\n \"html\": \"https://github.com/aien-dev/allen/tree/e97222eb82f1ec56e852ba9571786db9ccc5c97a/inventory\"\n }\n },\n {\n \"name\": \"scripts\",\n \"path\": \"scripts\",\n \"sha\": \"d564d0bc3dd917926892c55e3706cc116d5b165e\",\n \"size\": 0,\n \"url\": \"https://api.github.com/repos/aien-dev/allen/contents/scripts?ref=e97222eb82f1ec56e852ba9571786db9ccc5c97a\",\n \"html_url\": \"https://github.com/aien-dev/allen/tree/e97222eb82f1ec56e852ba9571786db9ccc5c97a/scripts\",\n \"git_url\": \"https://api.github.com/repos/aien-dev/allen/git/trees/d564d0bc3dd917926892c55e3706cc116d5b165e\",\n \"download_url\": null,\n \"type\": \"dir\",\n \"_links\": {\n \"self\": \"https://api.github.com/repos/aien-dev/allen/contents/scripts?ref=e97222eb82f1ec56e852ba9571786db9ccc5c97a\",\n \"git\": \"https://api.github.com/repos/aien-dev/allen/git/trees/d564d0bc3dd917926892c55e3706cc116d5b165e\",\n \"html\": \"https://github.com/aien-dev/allen/tree/e97222eb82f1ec56e852ba9571786db9ccc5c97a/scripts\"\n }\n }\n]" diff --git a/native/omega/allen/tests/github.om b/native/omega/allen/tests/github.om new file mode 100644 index 00000000..be1b4dc9 --- /dev/null +++ b/native/omega/allen/tests/github.om @@ -0,0 +1,413 @@ +note SPDX-License-Identifier: AGPL-3.0-only +note Compose committed gate core + github.om + repository-screen.om + check.om +note + github-fixtures.om + this file. Exit0 means every behavioral assertion passed. +note Fixtures never enter production composition. Network/TLS are not tested here. +text Gxask "Please find your current Git repo" +text Gxask2 "Allen, could you open the GitHub repository?" +text Gxno "Create a repository for another project" +text Gxesc "{\"full_name\":\"aien-dev/allen\",\"private\":false,\"html_url\":\"https://github.com/aien-dev/allen\",\"default_branch\":\"feature/demo\",\"description\":\"say \\\"hi\\\" \\\\ \\u00e9 \\ud83d\\ude00\"}" +text Gxdup "{\"full_name\":\"aien-dev/allen\",\"private\":false,\"html_url\":\"https://github.com/aien-dev/allen\",\"default_branch\":\"main\",\"default_\\u0062ranch\":\"evil\",\"description\":null}" +text Gxwrong "{\"full_name\":\"aien-dev/not-allen\",\"private\":false,\"html_url\":\"https://github.com/aien-dev/allen\",\"default_branch\":\"main\",\"description\":null}" +text Gxbad "{\"a\":1,}\n{\"x\":\"\\q\"}\n{\"x\":\"\\ud800\"}\n[01]\n{}{}\n{\"x\":1e}\n{\"x\":true false}\n" +text Gxdirbad "[{\"path\":\"../escape\",\"type\":\"file\",\"size\":0,\"sha\":\"e97222eb82f1ec56e852ba9571786db9ccc5c97a\"}]" +text Gxchild "[{\"path\":\"docs/PHASES.md\",\"type\":\"file\",\"size\":2345,\"sha\":\"d42f5dea4ca628f6ee539da8d2b732b52faf03ec\"}]" +text Gxpath "/repos/aien-dev/allen/commits/feature%2Fdemo" +text Gxroot "/repos/aien-dev/allen/contents?ref=e97222eb82f1ec56e852ba9571786db9ccc5c97a" +text Gxdocs "/repos/aien-dev/allen/contents/docs?ref=e97222eb82f1ec56e852ba9571786db9ccc5c97a" +text Gxpre "{\"full_name\":\"aien-dev/allen\",\"private\":false,\"html_url\":\"https://github.com/aien-dev/allen\",\"default_branch\":\"main\",\"description\":\"" +text Gxpost "\"}" +text Gxlist "[{\"id\":1427000265,\"full_name\":\"aien-dev/allen\",\"private\":false,\"owner\":{\"login\":\"aien-dev\",\"full_name\":\"x/y\"},\"created_at\":\"2026-10-20T12:35:09Z\"}]" +text Gxlowner "[{\"full_name\":\"someone/allen\",\"created_at\":\"2026-10-20T12:35:09Z\"}]" +text Gxldot "[{\"full_name\":\"aien-dev/.allen\",\"created_at\":\"2026-10-20T12:35:09Z\"}]" +text Gxlslash "[{\"full_name\":\"aien-dev/allen/x\",\"created_at\":\"2026-10-20T12:35:09Z\"}]" +text Gxlbare "[{\"full_name\":\"aien-dev/\",\"created_at\":\"2026-10-20T12:35:09Z\"}]" +text Gxldate "[{\"full_name\":\"aien-dev/allen\",\"created_at\":\"2026-10-20 12:35:09Z\"}]" +text Gxlnod "[{\"full_name\":\"aien-dev/allen\"}]" +text Gxldup "[{\"full_name\":\"aien-dev/allen\",\"full_\\u006eame\":\"aien-dev/evil\",\"created_at\":\"2026-10-20T12:35:09Z\"}]" +text Gxlempty "[]" +text Gxlobj "{\"full_name\":\"aien-dev/allen\",\"created_at\":\"2026-10-20T12:35:09Z\"}" +text Gxlbase "/repos/aien-dev/allen" +fn gxmeta to void +for i ulong len Gxmeta +put Ghbody i get Gxmeta i +end +check ghreply 1 200 len Gxmeta get Ghreq 2 100 +end +fn gxcommit to void +for i ulong len Gxcommit +put Ghbody i get Gxcommit i +end +check ghreply 2 200 len Gxcommit get Ghreq 2 101 +end +fn gxfiles to void +for i ulong len Gxfiles +put Ghbody i get Gxfiles i +end +check ghreply 4 200 len Gxfiles get Ghreq 2 102 +end +fn gxread to void +note Enough actual input rows to exercise paging, not a pre-rendered card. +for i ulong 200 +put Ghbody mul i 2 65 +put Ghbody add mul i 2 1 10 +end +check ghreply 3 200 400 get Ghreq 2 103 +end +fn gxlist to void +for i ulong len Gxlist +put Ghbody i get Gxlist i +end +check ghreply 5 200 len Gxlist get Ghreq 2 150 +end +note Every live session starts with discovery; gxfind is refresh plus a valid listing. +fn gxfind to void +ghrefresh +gxlist +check eq get Ghreq 0 1 151 +end +fn gxlfail n ulong id ulong to void +ghrefresh +check eq get Ghreq 0 5 id +check ghreply 5 200 n get Ghreq 2 add id 1 +check eq get Gh 0 3 add id 2 +check eq get Gh 2 3 add id 3 +check eq get Ghreq 0 0 add id 4 +check eq get Ghlen 5 0 add id 5 +end +fn gxdiscover to void +ghinit +gxfind +check eq get Ghlen 5 14 160 +check eq get Ghlen 6 20 161 +check eq get Ghreq 1 len Gxlbase 162 +for i ulong len Gxlbase +check eq get Ghpath i get Gxlbase i 163 +end +check eq get Ghmeta 784 50 164 +gxmeta +check eq get Ghreq 0 2 165 +for i ulong len Gxlowner +put Ghbody i get Gxlowner i +end +gxlfail len Gxlowner 170 +for i ulong len Gxldot +put Ghbody i get Gxldot i +end +gxlfail len Gxldot 176 +for i ulong len Gxlslash +put Ghbody i get Gxlslash i +end +gxlfail len Gxlslash 182 +for i ulong len Gxlbare +put Ghbody i get Gxlbare i +end +gxlfail len Gxlbare 188 +for i ulong len Gxldate +put Ghbody i get Gxldate i +end +gxlfail len Gxldate 194 +for i ulong len Gxlnod +put Ghbody i get Gxlnod i +end +gxlfail len Gxlnod 200 +for i ulong len Gxldup +put Ghbody i get Gxldup i +end +gxlfail len Gxldup 206 +for i ulong len Gxlempty +put Ghbody i get Gxlempty i +end +gxlfail len Gxlempty 212 +for i ulong len Gxlobj +put Ghbody i get Gxlobj i +end +gxlfail len Gxlobj 218 +ghrefresh +check ghreply 5 429 0 get Ghreq 2 224 +check eq get Gh 2 4 225 +check eq get Ghlen 5 0 226 +end +fn gxready to void +gxfind +gxmeta +gxcommit +gxread +gxfiles +check eq get Gh 0 2 104 +end +fn gxintent to void +ghinit +for i ulong len Gxask +put In i get Gxask i +end +put Inlen 0 len Gxask +check ghask 1 +check eq get Ghreq 0 5 2 +check eq get Ghreq 1 len Ghlst 3 +for i ulong len Ghlst +check eq get Ghpath i get Ghlst i 4 +end +for i ulong len Gxask2 +put In i get Gxask2 i +end +put Inlen 0 len Gxask2 +check ghask 5 +for i ulong len Gxno +put In i get Gxno i +end +put Inlen 0 len Gxno +check not ghask 6 +check eq get Gh 0 4 7 +check eq get Ghreq 0 0 8 +end +fn gxlive to void +ghrefresh +old = get Ghreq 2 +gxfind +check not ghreply 1 200 len Gxmeta old 10 +check eq get Ghreq 0 1 11 +check not ghreply 2 200 len Gxmeta get Ghreq 2 12 +ghtime 1792886400 +gxmeta +check eq get Ghreq 0 2 13 +check eq get Ghlen 1 4 14 +check eq get Ghmeta 64 109 15 +check eq get Ghmeta 67 110 16 +check eq get Ghat 0 1792886400 17 +gxcommit +check eq get Ghlen 3 40 18 +check eq get Ghlen 4 20 19 +check eq get Ghreq 3 1 20 +check eq get Ghreq 0 3 21 +gxread +check eq get Ghreq 0 4 22 +check eq get Ghreq 1 len Gxroot 23 +for i ulong len Gxroot +check eq get Ghpath i get Gxroot i 24 +end +gxfiles +check eq get Gh 0 2 25 +check eq get Ghreq 0 0 26 +check eq get Gh 8 9 27 +check eq get Ghfiles 1 10 28 +check eq get Ghfiles 3 197 29 +check not ghreply 4 200 len Gxfiles get Ghreq 2 30 +end +fn gxescape to void +gxfind +for i ulong len Gxesc +put Ghbody i get Gxesc i +end +check ghreply 1 200 len Gxesc get Ghreq 2 40 +check eq get Ghreq 0 2 41 +check eq get Ghreq 1 len Gxpath 42 +for i ulong len Gxpath +check eq get Ghpath i get Gxpath i 43 +end +check eq get Ghmeta 324 34 44 +check eq get Ghmeta 329 92 45 +check eq get Ghmeta 331 195 46 +check eq get Ghmeta 332 169 47 +check eq get Ghmeta 334 240 48 +end +fn gxmalformed to void +n = ulong 0 +for i ulong len Gxbad +c = get Gxbad i +if eq c 10 +gxfind +check ghreply 1 200 n get Ghreq 2 50 +check eq get Gh 0 3 51 +check eq get Gh 2 3 52 +check eq get jcnt 0 0 53 +n = 0 +else +put Ghbody n c +n = add n 1 +end +end +gxfind +for i ulong len Gxdup +put Ghbody i get Gxdup i +end +check ghreply 1 200 len Gxdup get Ghreq 2 54 +check eq get Gh 0 3 55 +gxfind +for i ulong len Gxwrong +put Ghbody i get Gxwrong i +end +check ghreply 1 200 len Gxwrong get Ghreq 2 56 +check eq get Gh 0 3 57 +gxfind +check ghreply 1 200 65537 get Ghreq 2 58 +check eq get Gh 2 2 59 +gxfind +for i ulong len Gxpre +put Ghbody i get Gxpre i +end +for i ulong 513 +put Ghbody add len Gxpre i 65 +end +for i ulong len Gxpost +put Ghbody add add len Gxpre 513 i get Gxpost i +end +n = add add len Gxpre 513 len Gxpost +check ghreply 1 200 n get Ghreq 2 60 +check eq get Gh 0 3 61 +end +fn gxerrors to void +gxfind +check ghreply 1 429 0 get Ghreq 2 70 +check eq get Gh 2 4 71 +check eq get Gh 3 429 72 +gxfind +check ghreply 1 0 0 get Ghreq 2 73 +check eq get Gh 2 1 74 +gxfind +gxmeta +gxcommit +put Ghbody 0 192 +put Ghbody 1 128 +check ghreply 3 200 2 get Ghreq 2 75 +check eq get Gh 0 3 76 +gxfind +gxmeta +gxcommit +put Ghbody 0 0 +check ghreply 3 200 1 get Ghreq 2 77 +check eq get Gh 0 3 78 +gxfind +gxmeta +gxcommit +check ghreply 3 404 0 get Ghreq 2 79 +check eq get Gh 13 1 80 +check eq get Ghreq 0 4 81 +gxfiles +check eq get Gh 0 2 82 +end +fn gxnavigation to void +gxready +check cvinit 768 384 90 +ghmeasure +check eq get Ghr 2 201 91 +ghscroll 9223372036854775807 +check eq get Gh 5 ghlimit 92 +ghscroll -9223372036854775808 +check eq get Gh 5 0 93 +ghkey 259 +check eq get Gh 5 get Ghr 1 94 +ghkey 258 +check eq get Gh 5 0 95 +ghkey 9 +check eq get Gh 4 1 96 +for i ulong 4 +ghkey 257 +end +check eq get Gh 6 4 97 +ghkey 13 +check eq get Ghreq 0 4 98 +check eq get Ghreq 1 len Gxdocs 99 +for i ulong len Gxdocs +check eq get Ghpath i get Gxdocs i 105 +end +for i ulong len Gxchild +put Ghbody i get Gxchild i +end +check ghreply 4 200 len Gxchild get Ghreq 2 106 +check eq get Gh 8 1 107 +ghkey 13 +check eq get Gh 4 2 108 +ghkey 98 +check eq get Gh 4 1 109 +ghkey 98 +check eq get Gh 10 0 110 +check eq get Ghreq 1 len Gxroot 111 +gxfiles +ghpointer 20 150 1 +check eq get Gh 4 0 112 +ghswipe 20 +check eq get Gh 5 20 113 +ghpointer -1 150 1 +check eq get Gh 4 0 114 +check ghrender 115 +ghkey 114 +check eq get Gh 0 1 116 +check eq get Gh 7 0 117 +check eq get Ghlen 3 0 118 +end +fn gxpathbad to void +gxfind +gxmeta +gxcommit +gxread +for i ulong len Gxdirbad +put Ghbody i get Gxdirbad i +end +check ghreply 4 200 len Gxdirbad get Ghreq 2 120 +check eq get Gh 0 3 121 +gxfind +gxmeta +gxcommit +gxread +for i ulong len Gxchild +put Ghbody i get Gxchild i +end +note Root listing cannot inject a nested child path. +check ghreply 4 200 len Gxchild get Ghreq 2 122 +check eq get Gh 0 3 123 +end +fn gxbounds to void +gxfind +gxmeta +gxcommit +put Ghbody 0 195 +put Ghbody 1 169 +put Ghbody 2 10 +check ghreply 3 200 3 get Ghreq 2 130 +old = get Ghreq 2 +gxfind +check not ghreply 4 200 len Gxfiles old 131 +check eq get Ghreq 0 1 132 +gxmeta +gxcommit +put Ghbody 0 240 +put Ghbody 1 159 +check ghreply 3 200 2 get Ghreq 2 133 +check eq get Gh 0 3 134 +gxfind +for i ulong 33 +put Ghbody i 91 +put Ghbody add 34 i 93 +end +put Ghbody 33 48 +check ghreply 1 200 67 get Ghreq 2 135 +check eq get Gh 0 3 136 +gxfind +gxmeta +gxcommit +for i ulong 148 +put Ghbody i 65 +end +check ghreply 3 200 148 get Ghreq 2 137 +gxfiles +ghmeasure +check eq get Ghr 2 3 138 +check eq get Ghlines 1 73 139 +check eq get Ghlines 2 146 140 +check eq get Ghat 3 0 141 +put Inlen 0 160 +check not ghask 142 +check eq get Gh 0 4 143 +end +fn main to int +gxdiscover +gxintent +gxlive +gxescape +gxmalformed +gxerrors +gxnavigation +gxpathbad +gxbounds +ret int get Fails 0 +end diff --git a/native/omega/allen/tests/golden.om b/native/omega/allen/tests/golden.om new file mode 100644 index 00000000..7669e60f --- /dev/null +++ b/native/omega/allen/tests/golden.om @@ -0,0 +1,16 @@ +text Gname "Allen" +fn main to int +constants +mset32 0 3 +for i ulong len Gname +put Mem add i 40 get Gname i +end +if not memenc 1 +ret 1 +end +n = write 1 Enc 0 4096 +if ne n 4096 +ret 2 +end +ret 0 +end diff --git a/native/omega/allen/tests/http.om b/native/omega/allen/tests/http.om new file mode 100644 index 00000000..5776e357 --- /dev/null +++ b/native/omega/allen/tests/http.om @@ -0,0 +1,105 @@ +note HTTP response boundary tests; concatenate after base.om, github.om, http.om, tests/check.om. +note Fixtures are protocol data only. This gate makes no network or TLS qualification claim. +text Hcases "HTTP/1.1 200 OK\nContent-Length: 5\n\nhello|HTTP/1.1 200 OK\nTransfer-Encoding: chunked\n\n2;ext=yes\nhe\n3\nllo\n0\nX-Trace: safe\n\n|HTTP/1.1 200 OK\nContent-Length: 5\nContent-Length: 5\n\nhello|HTTP/1.1 200 OK\nContent-Length: 5\nTransfer-Encoding: chunked\n\n|HTTP/1.1 200 OK\nContent-Encoding: gzip\nContent-Length: 5\n\nhello|HTTP/1.1 200 OK\nContent-Length: 9999999999999999999999999\n\n|HTTP/1.1 200 OK\n\nhello|HTTP/1.1 200 OK\nContent-Length: 5\n\nhell|HTTP/1.1 200 OK\nTransfer-Encoding: chunked\n\n1\nh\n0\nContent-Length: 0\n\n|HTTP/1.1 103 Early Hints\nLink: x\n\nHTTP/1.1 200 OK\nContent-Length: 5\n\nhello|HTTP/1.1 200 OK\nContent-Length: 0\n\nx|HTTP/1.1 200 OK\nTransfer-Encoding: chunked\n\n6\nhello!\n0\n\n|HTTP/1.1 204 No Content\nContent-Length: 4\n\n|HTTP/1.1 403 Forbidden\nContent-Length: 2\n\n{}|HTTP/1.1 200 OK\nTransfer-Encoding: chunked, gzip\n\n|HTTP/1.1 200 OK\nBad Header: x\n\n|" +text Hpath "/repos/aien-dev/allen" +text Hhello "hello" +fn htbegin cap ulong to void +for i ulong len Hpath +put Ghpath i get Hpath i +end +check httpstart 1 42 0 cap len Hpath 1 +end +fn htpush c uchar to void +put Hchunk 0 c +ok = httpfeed 1 +end +fn htcase wanted ulong to void +index = ulong 0 +for i ulong len Hcases +c = get Hcases i +if eq c 124 +if eq index wanted +ret +end +index = add index 1 +else +if eq index wanted +if eq c 10 +htpush 13 +end +htpush c +end +end +end +end +fn htgood id ulong to void +check eq get Hstate 0 2 id +check eq get Hstate 2 5 add id 1 +ok = true +for i ulong 5 +if ne get Ghbody i get Hhello i +ok = false +end +end +check ok add id 2 +check eq get Hstate 3 42 add id 3 +end +fn main to int +htbegin 5 +htcase 0 +htgood 10 +htbegin 5 +htcase 1 +htgood 20 +for i ulong 4 +htbegin 5 +htcase add i 2 +check eq get Hstate 0 3 add 30 i +end +htbegin 5 +htcase 6 +check eq get Hstate 0 1 40 +check httpend true 41 +htgood 42 +htbegin 5 +htcase 6 +check not httpend false 46 +check eq get Hstate 0 3 47 +htbegin 5 +htcase 7 +check not httpend true 50 +check eq get Hstate 0 3 51 +htbegin 5 +htcase 8 +check eq get Hstate 0 3 52 +htbegin 5 +htcase 9 +htgood 60 +for i ulong 3 +htbegin 5 +htcase add i 10 +check eq get Hstate 0 3 add 70 i +end +htbegin 5 +htcase 13 +check eq get Hstate 0 2 80 +check eq get Hstate 1 403 81 +check eq get Hstate 2 2 82 +for i ulong 2 +htbegin 5 +htcase add i 14 +check eq get Hstate 0 3 add 85 i +end +htbegin 5 +htpush 10 +check eq get Hstate 0 3 90 +htbegin 5 +put Ghpath 1 13 +check not httpstart 1 43 0 5 len Hpath 91 +check eq get Httpreqn 0 0 92 +htbegin 5 +put Ghpath 1 35 +check not httpstart 1 43 0 5 len Hpath 93 +check eq get Httpreqn 0 0 94 +ret int get Fails 0 +end diff --git a/native/omega/allen/tests/https-live.om b/native/omega/allen/tests/https-live.om new file mode 100644 index 00000000..e83b6620 --- /dev/null +++ b/native/omega/allen/tests/https-live.om @@ -0,0 +1,186 @@ +note SPDX-License-Identifier: MIT +note Qualification only: real Omega TLS/HTTP client on Linux AArch64. +note Argument1 is a DNS-resolved IPv4 address supplied by the external test orchestrator. +note Production firmware build uses net.om DNS instead; this harness is not the deployed network provider. +global Laddr uchar 16 +global Lip uchar 32 +global Lfd int 1 +global Lstate ulong 4 +text Lpath "/repos/aien-dev/allen" +fn laddress to bool +n = argread 1 Lip 0 len Lip +if or le n 0 gt n 15 +ret false +end +put Laddr 0 2 +put Laddr 2 1 +put Laddr 3 187 +part = ulong 0 +value = ulong 0 +digits = ulong 0 +for i ulong add ulong n 1 +c = uchar 46 +if lt i ulong n +c = get Lip i +end +if eq c 46 +if or or eq digits 0 gt value 255 ge part 4 +ret false +end +put Laddr add 4 part uchar value +part = add part 1 +value = 0 +digits = 0 +else +if or lt c 48 gt c 57 +ret false +end +digits = add digits 1 +if gt digits 3 +ret false +end +value = add mul value 10 sub ulong c 48 +end +end +ret eq part 4 +end +fn lflush to bool +off = ulong 0 +while lt off get Tlsoutn 0 +n = send get Lfd 0 Tlsout off sub get Tlsoutn 0 off 0 +if gt n 0 +off = add off ulong n +else +if ne n -11 +ret false +end +r = waitio get Lfd 0 4 10000000000 +if le r 0 +ret false +end +end +end +tlssent +ret true +end +fn lhttp to bool +while gt get Tlsappn 0 0 +n = get Tlsappn 0 +if gt n len Hchunk +n = len Hchunk +end +for i ulong n +put Hchunk i get Tlsapp i +end +if not httpfeed n +ret false +end +tlsconsume n +end +ret true +end +fn ldrive to int +start = monons +sent = false +while eq get Hstate 0 1 +if gt sub monons start 120000000000 +ret 71 +end +if eq get Tlsstate 0 4 +ret 72 +end +if gt get Tlsoutn 0 0 +if not lflush +ret 73 +end +end +if and eq get Tlsstate 0 2 not sent +for i ulong get Httpreqn 0 +put Tlsplain i get Httpreq i +end +if tlswrite get Httpreqn 0 +sent = true +end +end +if not lhttp +ret 74 +end +if eq get Hstate 0 2 +break +end +if eq get Tlsstate 0 3 +if not httpend eq get Tlsstate 2 1 +ret 75 +end +break +end +if eq get Tlsoutn 0 0 +r = waitio get Lfd 0 1 1000000000 +if lt r 0 +ret 76 +end +if gt r 0 +n = recv get Lfd 0 Tlsin 0 len Tlsin 0 +if gt n 0 +tlsinput ulong n +else +if eq n 0 +ret 77 +end +if ne n -11 +ret 78 +end +end +end +end +end +if ne get Hstate 1 200 +ret 79 +end +n = write 1 Ghbody 0 get Hstate 2 +if ne n long get Hstate 2 +ret 80 +end +ret 0 +end +fn main to int +if ne argcnt 2 +ret 64 +end +if not laddress +ret 65 +end +for i ulong len Lpath +put Ghpath i get Lpath i +end +if not httpstart 1 1 0 65536 len Lpath +ret 66 +end +off = ulong 0 +while lt off len Tlsrand +n = random Tlsrand off sub len Tlsrand off 0 +if le n 0 +ret 67 +end +off = add off ulong n +end +now = realns +if le now 0 +ret 68 +end +tlsinit ulong div now 1000000000 +fd = socknew 2 526337 0 +if lt fd 0 +ret 69 +end +put Lfd 0 int fd +r = connect int fd Laddr 0 len Laddr +if and ne r 0 ne r -115 +r = fclose int fd +ret 70 +end +rc = ldrive +r = fclose int fd +tcwipe +ret rc +end diff --git a/native/omega/allen/tests/intent.om b/native/omega/allen/tests/intent.om new file mode 100644 index 00000000..836320f8 --- /dev/null +++ b/native/omega/allen/tests/intent.om @@ -0,0 +1,41 @@ +text Askcode "Please make me a calculator" +text Askpoem "Write a poem about python" +text Askmore "Now add a square root key" +text Expected "JOB 9 code the person asked Allen for code.\tPlease make me a calculator" +text Nscript "script a poem" +fn main to int +put Inlen 0 len Askcode +for i ulong len Askcode +put In i get Askcode i +end +check eq classify 2 501 +b = jobbuild 2 9 +same = eq get Outlen 0 len Expected +for i ulong len Expected +if ne get Outb i get Expected i +same = false +end +end +check b 502 +check same 503 +put Inlen 0 len Askpoem +for i ulong len Askpoem +put In i get Askpoem i +end +check eq classify 1 504 +check eq jobwant 1 505 +put Inlen 0 len Askmore +for i ulong len Askmore +put In i get Askmore i +end +check eq classify 1 506 +put R 6 1 +check eq classify 3 507 +put R 6 0 +put Inlen 0 len Nscript +for i ulong len Nscript +put In i get Nscript i +end +check eq classify 1 508 +ret int get Fails 0 +end diff --git a/native/omega/allen/tests/look-chat.om b/native/omega/allen/tests/look-chat.om new file mode 100644 index 00000000..73396126 --- /dev/null +++ b/native/omega/allen/tests/look-chat.om @@ -0,0 +1,313 @@ +note Courier over UDP 47033 on net.om: concatenate after platform.om, the gate.sh +note core list, net.om, look-chat.om and tests/check.om. Host-only fixtures: HI, +note ACK and LINE datagrams are built by courier.om's own serializer in the live +note relay's form (allen-courier main.rs datagram(): HI/ACK part=0/0 bytes=0, +note LINE part=i/0 bytes=), wrapped in Ethernet/IPv4/UDP frames with +note an independent checksum, and fed through netinput; outgoing frames are +note checked against the same rules. The first HELLO frame is written raw to +note fd 2 for an outside checksum check. check prints through Outb, so every +note fixture is delivered before its packet result is checked. +text Cvline " 1/1 Model answer." +text Cvsay "SAY " +text Cvask "hello" +global Cvdst ulong 1 +fn cvw16 p ulong v ulong to void +put Nrx p uchar and shr v 8 255 +put Nrx add p 1 uchar and v 255 +end +fn cvw32 p ulong v ulong to void +cvw16 p shr v 16 +cvw16 add p 2 and v 65535 +end +fn cvt16 p ulong to ulong +ret add shl ulong get Ntx p 8 ulong get Ntx add p 1 +end +fn cvt32 p ulong to ulong +ret add shl cvt16 p 16 cvt16 add p 2 +end +note Independent one's-complement sum over Nrx (tx false) or Ntx (tx true). +fn cvsum tx bool p ulong n ulong to ulong +s = ulong 0 +for i ulong n +v = ulong 0 +if tx +v = ulong get Ntx add p i +else +v = ulong get Nrx add p i +end +if eq rem i 2 0 +s = add s shl v 8 +else +s = add s v +end +end +ret s +end +fn cvcpl s ulong to ulong +while gt s 65535 bound 8 +s = add shr s 16 and s 65535 +end +ret xor s 65535 +end +fn cvpseudo a ulong b ulong n ulong to ulong +s = add add shr a 16 and a 65535 add shr b 16 and b 65535 +ret add s add 17 n +end +fn cvip4 a ulong b ulong c ulong d ulong to ulong +ret add add shl a 24 shl b 16 add shl c 8 d +end +note Wrap Outb[0..Outlen) in a frame from 192.168.1.10:sp to Cvdst:dp and feed it in. +fn cvdeliver sp ulong dp ulong now ulong to void +n = get Outlen 0 +for i ulong 2048 +put Nrx i uchar 0 +end +for i ulong 6 +put Nrx i uchar 255 +put Nrx add i 6 uchar 0 +end +put Nrx 6 uchar 2 +put Nrx 11 uchar 170 +cvw16 12 2048 +put Nrx 14 uchar 69 +cvw16 16 add n 28 +cvw16 20 16384 +put Nrx 22 uchar 64 +put Nrx 23 uchar 17 +src = cvip4 192 168 1 10 +cvw32 26 src +cvw32 30 get Cvdst 0 +cvw16 24 cvcpl cvsum false 14 20 +cvw16 34 sp +cvw16 36 dp +cvw16 38 add n 8 +for i ulong n +put Nrx add 42 i get Outb i +end +c = cvcpl add cvpseudo src get Cvdst 0 add n 8 cvsum false 34 add n 8 +if eq c 0 +c = 65535 +end +cvw16 40 c +if lt n 18 +n = 18 +end +netinput add 42 n now +end +note A 20-byte TCP segment from 192.168.1.10:443 to Cvdst:Ncfg21 (session port). +fn cvtcp now ulong to void +for i ulong 2048 +put Nrx i uchar 0 +end +for i ulong 6 +put Nrx i uchar 255 +put Nrx add i 6 uchar 0 +end +put Nrx 6 uchar 2 +put Nrx 11 uchar 170 +cvw16 12 2048 +put Nrx 14 uchar 69 +cvw16 16 40 +cvw16 20 16384 +put Nrx 22 uchar 64 +put Nrx 23 uchar 6 +cvw32 26 cvip4 192 168 1 10 +cvw32 30 get Cvdst 0 +cvw16 24 cvcpl cvsum false 14 20 +cvw16 34 443 +cvw16 36 get Ncfg 21 +put Nrx 46 uchar 80 +netinput 54 now +end +note Outgoing courier frame: broadcast, IPv4/UDP 47033 both ways, valid checksums. +fn cvtxok to bool +if eq get Ntxlen 0 0 +ret false +end +for i ulong 6 +if ne get Ntx i 255 +ret false +end +end +if or ne cvt16 12 2048 ne get Ntx 23 17 +ret false +end +if ne cvcpl cvsum true 14 20 0 +ret false +end +if or ne cvt16 34 47033 ne cvt16 36 47033 +ret false +end +n = sub cvt16 16 20 +if or ne n cvt16 38 gt add n 34 get Ntxlen 0 +ret false +end +if ne cvt32 30 4294967295 +ret false +end +s = cvpseudo cvt32 26 cvt32 30 n +ret eq cvcpl add s cvsum true 34 n 0 +end +fn cvkind c uchar to bool +note The kind field starts at offset 22+16+6 of the head (ALLEN-COURIER v=1 run=<16> kind=). +ret eq ulong get Ntx 86 ulong c +end +fn cvbody seq ulong to void +outreset +for i ulong len Cvsay +emitb get Cvsay i +end +emitn seq +for i ulong len Cvline +emitb get Cvline i +end +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +end +fn main to int +put Cvdst 0 4294967295 +put Nmac 0 uchar 2 +for i ulong 4 +put Nmac add i 1 uchar 0 +end +put Nmac 5 uchar 1 +netinit 5000 +netsent true 5000 +check eq get Ntxlen 0 0 7 +check not chbusy 1 +check chinit 5000 0 2 +check ne get Q 0 0 3 +check eq get Q 0 chrun 5000 4 +check not chinit 5000 0 5 +check eq get Ncfg 2 0 6 +chstep 5000 true +check cvtxok 10 +check eq cvt32 26 0 11 +check cvkind 72 12 +check eq get Ch 2 1 13 +check not netudpsend 10 14 +w = write 2 Ntx 0 get Ntxlen 0 +netsent true 5000 +check eq get Ntxlen 0 0 15 +put Inlen 0 0 +ok = packet 6 0 0 0 0 +n = get Outlen 0 +cvdeliver 47033 47033 5001 +check ok 16 +check eq get Chrxn 0 n 17 +chstep 5001 true +check eq get Chrxn 0 0 18 +check eq get T 1 1 19 +check eq get Ch 3 1 20 +check eq get Ntxlen 0 0 21 +put Dprmn 0 len Cvask +for i ulong len Cvask +put Dprm i get Cvask i +end +check chask 5002 30 +check chbusy 31 +check not chask 5003 32 +chstep 5003 true +check cvtxok 33 +check cvkind 74 34 +netsent true 5003 +put Inlen 0 0 +ok = packet 4 get Q 1 0 0 0 +cvdeliver 47033 47033 5004 +check ok 35 +chstep 5004 true +check eq get T 6 1 36 +check eq get Ntxlen 0 0 37 +note Negative control: a LINE whose bytes= is neither 0 nor the body length is refused. +cvbody get Q 1 +ok = packet 2 get Q 1 1 0 add get Inlen 0 1 +cvdeliver 47033 47033 5005 +chstep 5005 true +check and ok and eq get Chevent 0 0 eq get Ntxlen 0 0 39 +cvbody get Q 1 +ok = packet 2 get Q 1 1 0 get Inlen 0 +cvdeliver 47033 47033 5005 +n = get Chdrop 0 +cvdeliver 47033 47033 5005 +check ok 40 +check eq n 0 41 +check eq get Chdrop 0 1 42 +chstep 5005 true +check eq get Chevent 0 1 43 +check eq get Chsayn 0 13 44 +check eq get Chsay 0 77 45 +check eq get Ch 5 1 46 +check cvtxok 47 +check cvkind 71 48 +check not chbusy 49 +netsent true 5005 +note Like the C kernel, ours by Ethernet destination and port alone: other ports +note never reach the courier slot; any IPv4 destination does, so the relay's +note --udp-answer 192.168.1.255 is heard without a lease. +cvdeliver 47033 47034 5006 +check eq get Chrxn 0 0 50 +cvdeliver 1234 47033 5006 +check ne get Chrxn 0 0 51 +put Chrxn 0 0 +put Cvdst 0 cvip4 192 168 1 255 +cvdeliver 47033 47033 5007 +check ne get Chrxn 0 0 52 +put Chrxn 0 0 +put Ncfg 2 cvip4 192 168 1 20 +put Ncfg 3 cvip4 255 255 255 0 +put Cvdst 0 cvip4 192 168 1 20 +cvdeliver 47033 47033 5007 +check ne get Chrxn 0 0 53 +put Chrxn 0 0 +put Cvdst 0 cvip4 192 168 1 21 +cvdeliver 47033 47033 5007 +check ne get Chrxn 0 0 54 +put Chrxn 0 0 +put Chevent 0 1 +chcancel +check eq get Chevent 0 0 55 +check not chbusy 56 +note With a lease the frame leaves from our address and the relay's subnet +note broadcast answer (--udp-answer 192.168.1.255) is still heard. +put Dprmn 0 len Cvask +check chask 5008 60 +chstep 5008 true +check cvtxok 61 +check eq cvt32 26 cvip4 192 168 1 20 62 +netsent true 5008 +put Cvdst 0 cvip4 192 168 1 255 +put Inlen 0 0 +ok = packet 4 get Q 1 0 0 0 +cvdeliver 47033 47033 5009 +chstep 5009 true +check and ok eq get T 6 1 63 +note Error state 6 after a failed repository session: the courier still hears a +note LINE and sends its GOT, while a TCP segment for the dead session is frozen +note (Ndrop 12 is ntcpin's first verdict for a segment from the wrong peer). +put Tcpstate 0 6 +cvbody get Q 1 +ok = packet 2 get Q 1 1 0 get Inlen 0 +cvdeliver 47033 47033 5010 +check and ok ne get Chrxn 0 0 64 +r = get Ch 4 +chstep 5010 true +check eq get Chevent 0 1 65 +check and cvtxok cvkind 71 66 +check eq get Ch 4 r 67 +netsent true 5010 +put Cvdst 0 cvip4 192 168 1 20 +put Ncfg 1 4 +put Ncfg 21 40000 +put Tcpstate 2 cvip4 10 0 0 1 +put Tcpstate 0 5 +put Ndrop 0 0 +cvtcp 5011 +check eq get Ndrop 0 12 68 +put Ndrop 0 0 +put Tcpstate 0 6 +cvtcp 5011 +check eq get Ndrop 0 0 69 +ret int get Fails 0 +end diff --git a/native/omega/allen/tests/look-home.om b/native/omega/allen/tests/look-home.om new file mode 100644 index 00000000..a05d6c3e --- /dev/null +++ b/native/omega/allen/tests/look-home.om @@ -0,0 +1,197 @@ +note tests/look-home.om: drives look-home.om on the C harness's schedule (~/work/IMacLook/home/harness.c) and writes +note the same regions as P6 PPMs to fd 1, in the harness's order: flashA flashB barA barB wordsC barC wordsD barD. +note NIGHT's hole radius at the two flash frames is taken from the C harness log (346/417 at 1280, 1066/1285 at 3840). +note stdin: the harness's -night.ppm files, in that order (the bare night each frame is drawn on). +note Unit: font-data.om font.om look-paint.om look-night.om look-mind.om look-home.om tio.om tests/look-home.om. +global Tbg uchar 16384 +global Thead ulong 4 +global Tnow long 1 +text Tsay "Opening the Allen repository on GitHub, aien-dev/aienux. The same code runs on the Spark, so ask me about any file." +text Ttyped "open allen github repository" +note reads exactly n bytes from fd 0 into Tbg +fn tfill n ulong to void +got = ulong 0 +while lt got n +r = read 0 Tbg got sub n got +if le r 0 +trap 2 +end +got = add got ulong r +end +end +note one P6 header: "P6\n \n255\n" read byte by byte; Thead 1 2 = w h +fn thead to void +nl = ulong 0 +v = ulong 0 +k = ulong 0 +while lt nl 4 +tfill 1 +c = get Tbg 0 +if or eq c 10 eq c 32 +if ne k 0 +put Thead nl v +nl = add nl 1 +end +v = 0 +k = 0 +else +if ge c 48 +v = add mul v 10 sub ulong c 48 +k = add k 1 +end +end +end +end +note one P6 from fd 0 into Nfrm (the frame's size must match Lg 0 1) +fn tpx p ulong to ulong +c = shl ulong get Tbg p 16 +c = or c shl ulong get Tbg add p 1 8 +ret or c ulong get Tbg add p 2 +end +fn trow at ulong w ulong to void +for i ulong w +put Nfrm add at i uint tpx mul i 3 +end +end +fn tload to void +thead +w = get Thead 1 +for j ulong get Thead 2 +tfill mul w 3 +trow mul j w w +end +end +fn tpix c ulong to void +tc uchar and shr c 16 255 +tc uchar and shr c 8 255 +tc uchar and c 255 +end +fn tprow at ulong w ulong to void +for i ulong w +tpix ulong get Nfrm add at i +end +end +fn tppm x long y long w long h long to void +tc 80 +tc 54 +tc 10 +tu ulong w +tc 32 +tu ulong h +tc 10 +tu 255 +tc 10 +at = add mul ulong y ulong get Lg 0 ulong x +for j ulong ulong h +tprow at ulong w +at = add at ulong get Lg 0 +end +end +fn trun upto long to void +while le get Tnow 0 upto +hmstep get Tnow 0 +put Tnow 0 add get Tnow 0 16 +end +end +note draws the frame last stepped on the bare night from stdin, and writes the region +fn tdump x long y long w long h long to void +tload +hmflash 0 0 get Lg 0 get Lg 1 +hmtext 0 0 get Lg 0 get Lg 1 +tppm x y w h +end +note the regions the C harness dumps: the flash box, the bar box (Hm 28..31) and the words box of lay_out +fn tflash to void +r = add shr hmfrad get Hm 12 4 2 +x = sub get Lg 3 r +y = sub get Lg 4 r +r = add mul 2 r 1 +tppm x y r r +end +fn tbar to void +tppm get Hm 28 get Hm 29 get Hm 30 get Hm 31 +end +fn twords to void +x = sub sub get Lg 3 hms 450 hms 8 +y = sub add get Lg 4 hms 250 hms 34 +w = add hms 900 hms 16 +h = add mul 5 hms 40 hms 30 +tppm x y w h +end +fn tdraw to void +hmflash 0 0 get Lg 0 get Lg 1 +hmtext 0 0 get Lg 0 get Lg 1 +end +fn main to long +note the first night file gives the size (all frames share it): Lg 0 1 are only placeholders for its load +put Lg 0 1280 +put Lg 1 800 +tload +put Lg 0 long get Thead 1 +put Lg 1 long get Thead 2 +kw = div mul get Lg 0 256 1920 +kh = div mul get Lg 1 256 1080 +put Lg 2 pkmin kw kh +put Lg 3 div get Lg 0 2 +put Lg 4 div mul get Lg 1 40 100 +pkinit +hminit +put Tnow 0 0 +put Nthol 0 1 +put Nthole 0 add mul get Lg 3 16 8 +put Nthole 1 add mul get Lg 4 16 8 +trun 12100 +put Nthole 3 346 +if ne get Lg 0 1280 +put Nthole 3 1066 +end +tdraw +tflash +trun 12290 +put Nthole 3 417 +if ne get Lg 0 1280 +put Nthole 3 1285 +end +tload +tdraw +tflash +put Nthol 0 0 +trun 16500 +tload +tdraw +tbar +for i ulong len Ttyped +hmkey ulong get Ttyped i +trun add get Tnow 0 120 +end +tload +tdraw +tbar +trun 20500 +hmkey 13 +hmthink 1 +trun 23500 +for i ulong len Tsay +put Hmsay i get Tsay i +end +put Hmsayn 0 len Tsay +hmsaid +speak = add get Tnow 0 400 +n = long len Tsay +trun add speak div mul n 35 2 +tload +tdraw +twords +tload +tdraw +tbar +trun add add speak mul n 35 500 +tload +tdraw +twords +tload +tdraw +tbar +tflush +ret 0 +end diff --git a/native/omega/allen/tests/look-mind.om b/native/omega/allen/tests/look-mind.om new file mode 100644 index 00000000..fbc2af25 --- /dev/null +++ b/native/omega/allen/tests/look-mind.om @@ -0,0 +1,156 @@ +note tests/look-mind.om: Allen's presence alone on a black frame, as mindref.c / oracle.c layer 8. +note stdin: W H T REPS N then N events "ms op arg" (op 0 mode(arg) 1 word 2 key 3 voice(arg)), +note applied before the first 16 ms step s >= ms. The mind is stepped every 16 ms from 0 to T, +note then at T, drawn REPS times over the full frame, and written as a P6 PPM to fd 1. +note fd 2 gets "box x y w h dirty x y w h nspark n" like mindref.c. +global Tin uchar 65536 +global Tinn ulong 2 +global Tev long 192 +global Terr uchar 256 +global Terrn ulong 1 +fn tnum to long +n = get Tinn 0 +end0 = get Tinn 1 +while lt n end0 bound 65536 +if gt get Tin n 32 +break +end +n = add n 1 +end +v = long 0 +while lt n end0 bound 65536 +c = get Tin n +if le c 32 +break +end +v = add mul v 10 sub long c 48 +n = add n 1 +end +put Tinn 0 n +ret v +end +fn tec c uchar to void +put Terr get Terrn 0 c +put Terrn 0 add get Terrn 0 1 +end +fn teu v ulong to void +if ge v 10 +teu div v 10 +end +tec uchar add 48 rem v 10 +end +fn tel v long to void +if lt v 0 +tec 45 +teu bitcast ulong neg v +ret +end +teu ulong v +end +fn tesp to void +tec 32 +end +fn terr to void +w = write 2 Terr 0 get Terrn 0 +end +fn tprow n ulong w ulong to void +for x ulong w +p = get Nfrm n +tc uchar and shr p 16 255 +tc uchar and shr p 8 255 +tc uchar and p 255 +n = add n 1 +end +end +fn tppm w long h long to void +tc 80 +tc 54 +tc 10 +tu ulong w +tc 32 +tu ulong h +tc 10 +tu 255 +tc 10 +for y ulong ulong h +tprow mul y ulong w ulong w +end +tflush +end +fn tevent j long s long to void +op = get Tev add mul j 3 1 +arg = get Tev add mul j 3 2 +if eq op 0 +mdmode arg s +end +if eq op 1 +mdword s +end +if eq op 2 +mdkey s +end +if eq op 3 +mdvoice arg +end +end +fn main to int +r = read 0 Tin 0 65536 +if le r 0 +ret 2 +end +put Tinn 1 ulong r +w = tnum +h = tnum +t = tnum +reps = tnum +n = tnum +for i ulong ulong n +put Tev mul i 3 tnum +put Tev add mul i 3 1 tnum +put Tev add mul i 3 2 tnum +end +pkinit +put Lg 0 w +put Lg 1 h +put Lg 2 pkmin div mul w 256 1920 div mul h 256 1080 +put Lg 3 div w 2 +put Lg 4 div mul h 40 100 +pkclip 0 0 w h +mdinit 12300 +j = long 0 +s = long 0 +note (T / 16) + 1 steps +while le s t bound 999999 +while lt j n bound 64 +if gt get Tev mul j 3 s +break +end +tevent j s +j = add j 1 +end +mdat s +s = add s 16 +end +mdat t +for k ulong ulong reps +mddraw 0 0 w h +end +mddirty +tec 98 +tesp +for i ulong 4 +tel get Mdnow i +tesp +end +tec 100 +tesp +for i ulong 4 +tel get Mdbox i +tesp +end +tel get Mdv 15 +tec 10 +terr +tppm w h +ret 0 +end diff --git a/native/omega/allen/tests/look-night.om b/native/omega/allen/tests/look-night.om new file mode 100644 index 00000000..23ca20ac --- /dev/null +++ b/native/omega/allen/tests/look-night.om @@ -0,0 +1,104 @@ +global Tb uchar 4194304 +global Tn ulong 1 +fn tflush to void +n = ulong 0 +while lt n get Tn 0 +w = write 1 Tb n sub get Tn 0 n +if le w 0 +ret +end +n = add n ulong w +end +put Tn 0 0 +end +fn tc c uchar to void +if ge get Tn 0 4194000 +tflush +end +put Tb get Tn 0 c +put Tn 0 add get Tn 0 1 +end +fn tu v ulong to void +if ge v 10 +tu div v 10 +end +tc uchar add 48 rem v 10 +end +fn tl v long to void +if lt v 0 +tc 45 +tu bitcast ulong neg v +ret +end +tu ulong v +end +fn tnl to void +tc 10 +end +note tests/look-night.om: argv W H T [shim voice]; writes Nfrm after ntinit, ntat T, ntbase, ntlights as P6 to fd 1, +note ntbase and ntlights microseconds to fd 2. Compare with cref2 oracle W H T 6 (host-only). +note Unit: font-data font look-paint look-skydata look-sky look-night + this file. +global Dargs uchar 32 +fn darg i ulong to long +n = argread i Dargs 0 32 +v = long 0 +for k ulong ulong n +v = add mul v 10 long sub get Dargs k 48 +end +ret v +end +fn dppm to void +w = ulong get Lg 0 +h = ulong get Lg 1 +tc 80 +tc 54 +tnl +tu w +tc 32 +tu h +tnl +tu 255 +tnl +for y ulong h +for x ulong w +c = ulong get Nfrm add mul y w x +tc uchar and shr c 16 255 +tc uchar and shr c 8 255 +tc uchar and c 255 +end +end +tflush +end +fn main to int +w = darg 1 +h = darg 2 +t = ulong darg 3 +put Lg 0 w +put Lg 1 h +put Lg 2 pkmin div mul w 256 1920 div mul h 256 1080 +put Lg 3 div w 2 +put Lg 4 div mul h 40 100 +pkinit +pkclip 0 0 w h +ntinit +ntat t +t0 = monons +ntbase 0 0 w h +t1 = monons +sh = ulong 0 +vo = ulong 0 +if gt argcnt 5 +sh = ulong darg 4 +vo = ulong darg 5 +end +ntlights 0 0 w h sh vo +t2 = monons +dppm +put Tn 0 0 +tu ulong div sub t1 t0 1000 +tc 32 +tu ulong div sub t2 t1 1000 +tnl +n = write 2 Tb 0 get Tn 0 +ret 0 +end diff --git a/native/omega/allen/tests/look-paint.om b/native/omega/allen/tests/look-paint.om new file mode 100644 index 00000000..22b020d5 --- /dev/null +++ b/native/omega/allen/tests/look-paint.om @@ -0,0 +1,243 @@ +note tests/look-paint.om: prints the drawing kit's values in the same order as the C harness +note (~/work/IMacLook/paint/ptest.c over aienux 4b24df65 paint.c); the two outputs must cmp equal. +note Unit: font-data.om font.om look-paint.om tio.om tests/look-paint.om. +global Tcs ulong 12 +fn tdump to void +for i ulong 3072 +tu ulong get Nfrm i +tnl +end +end +fn tword pen ulong y long c uchar color ulong a ulong plus bool to ulong +pen = pkletter pen y c color a plus +tu pen +tnl +ret pen +end +fn tblend to void +put Tcs 0 0 +put Tcs 1 1052688 +put Tcs 2 1193046 +put Tcs 3 16777215 +put Tcs 4 13158655 +put Tcs 5 4227327 +put Tcs 6 16711680 +put Tcs 7 65280 +put Tcs 8 255 +put Tcs 9 8355711 +put Tcs 10 66051 +put Tcs 11 16711422 +for i ulong 12 +for j ulong 12 +a = ulong 0 +while le a 256 +tu pkadd get Tcs i get Tcs j a +tc 32 +tu pkmix get Tcs i get Tcs j a +tc 32 +tu pkscale get Tcs i a +tnl +a = add a 19 +end +end +end +for i ulong 12 +j = rem add i 1 12 +tu pkadd get Tcs i get Tcs j 256 +tc 32 +tu pkmix get Tcs i get Tcs j 256 +tc 32 +tu pkscale get Tcs i 256 +tnl +end +end +fn tthread x0 long y0 long x1 long y1 long color ulong w long to void +put Pa 0 w +pkthread x0 y0 x1 y1 color 0 +end +fn tshapes to void +for i ulong 3072 +put Nfrm i 1052688 +end +pkclip 0 0 64 48 +pkglow 500 400 300 13158655 200 +pkglow -40 700 160 16777215 256 +put Pa 1 200 +put Pa 2 60 +tthread 30 40 900 600 16762368 16 +put Pa 1 30 +put Pa 2 255 +tthread 800 20 100 700 4227327 40 +put Pa 1 255 +put Pa 2 255 +tthread 100 100 110 700 16777215 24 +put Pa 1 0 +put Pa 2 256 +tthread 50 650 950 660 16746496 8 +put Pa 1 100 +put Pa 2 100 +tthread 300 300 300 300 16777215 16 +tthread 300 300 500 500 16777215 0 +put Pa 1 256 +put Pa 2 0 +tthread -200 -100 1200 900 8454016 50 +pkclip 10 5 30 30 +pkglow 300 300 400 16711680 128 +pkclip -5 -5 20 20 +put Pa 1 200 +put Pa 2 200 +tthread 0 0 500 120 16777215 12 +tdump +end +fn trrect to void +put Lg 9 6 +for j ulong 48 +for i ulong 64 +tl pksdrrect long i long j 8 6 40 30 +tc 32 +end +tnl +end +put Lg 9 0 +for j ulong 48 +for i ulong 64 +tl pksdrrect long i long j -3 10 70 15 +tc 32 +end +tnl +end +end +fn tletters to void +if not afinit 14 1250 +trap 9 +end +for i ulong 3072 +if eq and i 1 1 +put Nfrm i 2105408 +else +put Nfrm i 0 +end +end +pkclip 0 0 64 48 +pen = ulong 868 +pen = tword pen 20 65 16769184 230 false +pen = tword pen 20 103 16769184 230 false +pen = tword pen 20 63 16769184 230 false +pen = tword pen 20 106 16769184 230 false +pen = tword pen 20 32 16769184 230 false +pen = tword pen 20 44 16769184 230 false +pen = tword pen 20 87 16769184 230 false +pen = 256 +pen = tword pen 38 105 8438015 256 true +pen = tword pen 38 77 8438015 256 true +pen = tword pen 38 97 8438015 256 true +pen = tword pen 38 99 8438015 256 true +pkclip 10 5 30 30 +pen = 256 +pen = tword pen 30 88 16728128 120 true +pen = tword pen 30 121 16728128 120 true +pkclip 0 0 64 48 +pen = 256 +pen = tword pen 30 81 16728128 0 false +tdump +end +fn main to int +pkinit +for i ulong 677 +a = mul i 97 +tl pksin a +tc 32 +tl pkcos a +tnl +end +y = long -50000 +while le y 50000 +x = long -50000 +while le x 50000 +tu pkatan2 y x +tnl +x = add x 3331 +end +y = add y 2917 +end +tu pkatan2 3 0 +tnl +tu pkatan2 -7 0 +tnl +for i ulong 600 +tu pkexpneg mul i 7 +tnl +end +for i ulong 257 +tu get Plog i +tnl +end +v = ulong 1 +while lt v 4611686018427387904 +tu pklog2q16 v +tc 32 +tu pkisqrt v +tnl +v = add mul v 3 1 +end +tu pklog2q16 0 +tc 32 +tu pkisqrt 0 +tnl +y = long -2000 +while le y 2000 +x = long -3000 +while le x 3000 +tu pkhash x y 909 +tc 32 +tu pknoise x y 909 +tc 32 +tu pkfbm x y 909 4 +tnl +x = add x 413 +end +y = add y 377 +end +t = long -20 +while le t 280 +tu pksmooth t +tc 32 +tu pkeaseout t +tc 32 +tl pkprog ulong add 1000 t 990 1200 +tnl +t = add t 7 +end +tl pkprog 5 9 20 +tc 32 +tl pkprog 50 9 20 +tc 32 +tl pkprog 20 9 20 +tnl +t = long -40 +while le t 40 +tu pkcover t +tnl +t = add t 3 +end +l = ulong 0 +while lt l 40000 +tu pklenc l +tnl +l = add l 61 +end +for i ulong 256 +tu ulong get Slin i +tc 32 +tu ulong get Ssrgb add mul i 16 1 +tnl +end +tblend +put Lg 0 64 +put Lg 1 48 +tshapes +trrect +tletters +tflush +ret 0 +end diff --git a/native/omega/allen/tests/look-sky.om b/native/omega/allen/tests/look-sky.om new file mode 100644 index 00000000..5df46de1 --- /dev/null +++ b/native/omega/allen/tests/look-sky.om @@ -0,0 +1,121 @@ +note tests/look-sky.om: the sky as the C oracle (layer 1, cref2/oracle W H 0 1) draws it, as a P6 PPM on +note stdout: argv 1 W, argv 2 H. k and the centre as allen_ui.c sets them: k = min(w*4/30, h*4/25) +note rounded to 2 (ck_night_init's caller), cx = w/2, cy = h*2/5. Then one twinkle check (argv 3 = "tw"): +note Nfrm black, clip (100, 100, w-200, h-200), sktwink of every listed star with amount 96, PPM of Nfrm. +global Targ uchar 16 +fn targ i ulong to long +n = argread i Targ 0 16 +if lt n 0 +ret -1 +end +v = long 0 +for j ulong ulong n +v = add mul v 10 long sub ulong get Targ j 48 +end +ret v +end +fn tppm to void +w = ulong get Lg 0 +h = ulong get Lg 1 +tc 80 +tc 54 +tc 10 +tu w +tc 32 +tu h +tc 10 +tu 255 +tc 10 +tflush +for y ulong h +r = mul y w +for x ulong w +c = ulong 0 +if eq get Sktgt 0 0 +c = ulong get Nsky add r x +else +c = ulong get Nfrm add r x +end +tc uchar and shr c 16 255 +tc uchar and shr c 8 255 +tc uchar and c 255 +end +tflush +end +end +fn tgsum i ulong to void +b = mul i 4 +n = mul ulong get Skgbox add b 2 ulong get Skgbox add b 3 +o = get Skgoff i +sl = ulong 0 +sp = ulong 0 +for k ulong n +b = add o k +sl = add sl mul ulong get Skglit b add rem k 1000 1 +sp = add sp mul ulong get Skgpha b add rem k 997 1 +end +tu sl +tc 32 +tu sp +end +fn main to int +w = targ 1 +h = targ 2 +if lt w 1 +ret 2 +end +if lt h 1 +ret 2 +end +put Lg 0 w +put Lg 1 h +k = pkmin div mul w 4 30 div mul h 4 25 +put Lg 2 and k -2 +put Lg 3 div w 2 +put Lg 4 div mul h 2 5 +pkinit +skmake +if eq argcnt 3 +tppm +ret 0 +end +n = argread 3 Targ 0 16 +if eq get Targ 0 103 +note argv 3 "gal": per galaxy i box tint period and weighted sums of light and phase, then ntw +for i ulong 6 +b = mul i 4 +tu i +tc 32 +tl get Skgbox b +tc 32 +tl get Skgbox add b 1 +tc 32 +tl get Skgbox add b 2 +tc 32 +tl get Skgbox add b 3 +tc 32 +tu ulong get Skgtint i +tc 32 +tu get Skgper i +tc 32 +tgsum i +tnl +end +tu 103 +tc 32 +tu get Sktwn 0 +tnl +tflush +ret 0 +end +put Lg 5 100 +put Lg 6 100 +put Lg 7 sub w 200 +put Lg 8 sub h 200 +for i ulong get Sktwn 0 +sktwink i 96 +end +put Sktgt 0 1 +tppm +ret 0 +end diff --git a/native/omega/allen/tests/memory.om b/native/omega/allen/tests/memory.om new file mode 100644 index 00000000..06d02bdb --- /dev/null +++ b/native/omega/allen/tests/memory.om @@ -0,0 +1,146 @@ +global Disk uchar 8192 +text Name "Allen" +text Ntext "Meet at noon." +fn enctounit to void +for i ulong 4096 +put Unit i get Enc i +end +end +fn diskput slot ulong count ulong to void +for i ulong count +put Disk add mul slot 4096 i get Enc i +end +end +fn diskget slot ulong to void +for i ulong 4096 +put Unit i get Disk add mul slot 4096 i +end +end +fn main to int +constants +mset32 0 3 +for i ulong len Name +put Mem add i 40 get Name i +end +check memenc 1 301 +check eq get32 12 76 302 +check memdec 303 +check eq get Md 0 1 304 +check eq get Mem 40 65 305 +put Unit 24 uchar 1 +check not memdec 306 +check eq get Md 0 1 307 +check eq get Mem 40 65 308 +enctounit +put Unit 64 uchar 4 +check not memdec 309 +check eq get Mem 0 3 310 +enctounit +put32 8 3 +put32 12 64 +seal 64 +check memdec 311 +check eq get Md 1 3 312 +check eq get Mem 40 65 313 +put32 8 2 +put32 12 40 +for i ulong 24 +put Unit add i 104 0 +end +seal 40 +check memdec 314 +check eq get Md 1 2 315 +check eq get Mem 40 0 316 +put Mem 40 uchar 65 +check memenc 1 317 +check txbegin 318 +check eq get Tx 1 0 319 +diskput 0 4096 +check txwrite true 320 +check txflush true 321 +diskget 0 +check txread true 322 +check eq get St 0 1 323 +check eq get St 1 0 324 +mset32 0 4 +check txbegin 325 +check eq get Tx 1 1 326 +diskput 1 512 +check not txwrite false 327 +check eq get St 0 1 328 +diskget 0 +check memdec 329 +check eq get Mem 0 3 330 +mset32 0 4 +check txbegin 331 +diskput 1 4096 +check txwrite true 332 +check not txflush false 333 +check eq get St 0 1 334 +check txbegin 335 +check txwrite true 336 +check txflush true 337 +diskget 1 +put Unit 200 uchar 1 +check not txread true 338 +check eq get St 0 1 339 +check txbegin 340 +check txwrite true 341 +check txflush true 342 +check not txread false 343 +check eq get St 0 1 344 +check txbegin 345 +diskput 1 4096 +check txwrite true 346 +check txflush true 347 +diskget 1 +check txread true 348 +check eq get St 0 2 349 +check eq get St 1 1 350 +for i ulong 3 +put St i 0 +end +diskget 1 +check loadcopy 1 351 +diskget 0 +check loadcopy 0 352 +check not loadcopy 0 362 +check eq get St 2 2 363 +check eq get St 0 2 353 +check eq get Mem 0 4 354 +put Ns 0 len Ntext +put Ns 1 2 +put Ns 2 3 +for i ulong len Ntext +put Note i get Ntext i +end +check noteenc 355 +check notedec 2 356 +check eq get Ns 0 len Ntext 357 +check not notedec 3 358 +put Unit 28 uchar 1 +check not notedec 2 359 +check eq get Ns 1 2 360 +check nbegin 364 +check not txbegin 365 +check not nwrite false 366 +check eq get Nt 0 0 367 +check nbegin 368 +check nwrite true 369 +check not nflush false 370 +check nbegin 371 +check nwrite true 372 +check nflush true 373 +enctounit +put Unit 300 uchar 1 +check not nread true 374 +check nbegin 375 +check nwrite true 376 +check nflush true 377 +enctounit +check nread true 378 +check eq get St 0 2 379 +put St 0 18446744073709551615 +check not txbegin 361 +ret int get Fails 0 +end diff --git a/native/omega/allen/tests/net.om b/native/omega/allen/tests/net.om new file mode 100644 index 00000000..a0ef90eb --- /dev/null +++ b/native/omega/allen/tests/net.om @@ -0,0 +1,722 @@ +note Packet stack behavior; concatenate after base.om, net.om, tests/check.om. +note Frames are built here from RFC791/768/826/2131/1035/9293 layouts with an +note independent checksum; outgoing frames are checked against the same rules. +note Host-only protocol fixtures: no live network, firmware or peer qualification. +global Vnow ulong 1 +global Vpeer uchar 6 +global Vip ulong 1 +global Vxid ulong 1 +global Vport ulong 1 +global Viss ulong 1 +global Vdport ulong 1 +global Vdid ulong 1 +text Vq "apigithubcom" +text Vqmix "ApIgithubCOM" +text Vget "GEThello" +fn nvip4 a ulong b ulong c ulong d ulong to ulong +ret add add shl a 24 shl b 16 add shl c 8 d +end +fn nvsrv to ulong +ret nvip4 10 9 8 1 +end +fn nvdns to ulong +ret nvip4 10 9 8 53 +end +fn nvgh to ulong +ret nvip4 140 82 112 6 +end +fn nvsseq to ulong +ret 3000000000 +end +fn nvw16 p ulong v ulong to void +put Nrx p uchar and shr v 8 255 +put Nrx add p 1 uchar and v 255 +end +fn nvw32 p ulong v ulong to void +nvw16 p shr v 16 +nvw16 add p 2 and v 65535 +end +fn nvt16 p ulong to ulong +ret add shl ulong get Ntx p 8 ulong get Ntx add p 1 +end +fn nvt32 p ulong to ulong +ret add shl nvt16 p 16 nvt16 add p 2 +end +note Independent one's-complement sum: byte pairs, odd tail as high octet. +fn nvsum tx bool p ulong n ulong to ulong +s = ulong 0 +for i ulong n +v = ulong 0 +if tx +v = ulong get Ntx add p i +else +v = ulong get Nrx add p i +end +if eq rem i 2 0 +s = add s shl v 8 +else +s = add s v +end +end +ret s +end +fn nvcpl s ulong to ulong +while gt s 65535 bound 8 +s = add shr s 16 and s 65535 +end +ret xor s 65535 +end +fn nvpseudo a ulong b ulong pr ulong n ulong to ulong +s = add add shr a 16 and a 65535 add shr b 16 and b 65535 +ret add s add pr n +end +fn nvsetmac p ulong last ulong to void +for i ulong 5 +put Vpeer i uchar 0 +end +put Vpeer 0 uchar 2 +put Vpeer 5 uchar last +put Vpeer 4 uchar p +end +fn nvclr to void +for i ulong 2048 +put Nrx i uchar 0 +end +end +fn nveth typ ulong to void +for i ulong 6 +put Nrx i get Nmac i +put Nrx add i 6 get Vpeer i +end +nvw16 12 typ +end +fn nvip src ulong dst ulong pr ulong l4 ulong to void +nveth 2048 +put Nrx 14 uchar 69 +nvw16 16 add l4 20 +nvw16 20 16384 +put Nrx 22 uchar 64 +put Nrx 23 uchar pr +nvw32 26 src +nvw32 30 dst +nvw16 24 0 +nvw16 24 nvcpl nvsum false 14 20 +end +fn nvudp src ulong dst ulong sp ulong dp ulong n ulong to ulong +nvw16 34 sp +nvw16 36 dp +nvw16 38 add n 8 +s = nvpseudo src dst 17 add n 8 +c = nvcpl add s nvsum false 34 add n 8 +if eq c 0 +c = 65535 +end +nvw16 40 c +nvip src dst 17 add n 8 +ret add 42 n +end +fn nvtcp src ulong seq ulong ack ulong fl ulong hl ulong dl ulong to ulong +nvw16 34 443 +nvw16 36 get Vport 0 +nvw32 38 seq +nvw32 42 ack +put Nrx 46 uchar mul div hl 4 16 +put Nrx 47 uchar fl +nvw16 48 65535 +nvw16 50 0 +s = nvpseudo src get Vip 0 6 add hl dl +nvw16 50 nvcpl add s nvsum false 34 add hl dl +nvip src get Vip 0 6 add hl dl +ret add 34 add hl dl +end +fn nvin n ulong to void +if lt n 60 +n = 60 +end +netinput n get Vnow 0 +end +note Each outgoing IPv4 frame: header checksum, UDP/TCP pseudo-header checksum. +fn nvtxok to bool +if ne nvt16 12 2048 +ret false +end +if ne nvcpl nvsum true 14 20 0 +ret false +end +n = sub nvt16 16 20 +if gt add n 34 get Ntxlen 0 +ret false +end +s = nvpseudo nvt32 26 nvt32 30 ulong get Ntx 23 n +ret eq nvcpl add s nvsum true 34 n 0 +end +fn nvnext to bool +for i ulong 400 +netstep get Vnow 0 +if ne get Ntxlen 0 0 +ret true +end +put Vnow 0 add get Vnow 0 250 +end +ret false +end +fn nvsent to void +netsent true get Vnow 0 +end +fn nvstart to bool +put Vnow 0 5000 +put Nmac 0 uchar 2 +for i ulong 4 +put Nmac add i 1 uchar 0 +end +put Nmac 5 uchar 1 +netinit get Vnow 0 +for i ulong 32 +put Nrand i uchar add i 1 +end +put Vip 0 nvip4 10 9 8 20 +netconnect get Vnow 0 +for i ulong 32 +if ne get Nrand i 0 +ret false +end +end +ret eq get Tcpstate 0 1 +end +fn nvdisc to bool +if not nvnext +ret false +end +for i ulong 6 +if ne get Ntx i 255 +ret false +end +end +if or ne nvt16 34 68 ne nvt16 36 67 +ret false +end +if or ne get Ntx 42 1 ne nvt32 278 1669485411 +ret false +end +put Vxid 0 nvt32 46 +if ne get Vxid 0 nvip4 1 2 3 4 +ret false +end +if or ne get Ntx 282 53 ne get Ntx 284 1 +ret false +end +ret nvtxok +end +fn nvopt p ulong code ulong v ulong to void +put Nrx p uchar code +put Nrx add p 1 uchar 4 +nvw32 add p 2 v +end +fn nvdhcp typ ulong xid ulong to ulong +nvclr +nvsetmac 0 170 +put Nrx 42 uchar 2 +put Nrx 43 uchar 1 +put Nrx 44 uchar 6 +nvw32 46 xid +nvw32 58 get Vip 0 +for i ulong 6 +put Nrx add i 70 get Nmac i +end +nvw32 278 1669485411 +put Nrx 282 uchar 53 +put Nrx 283 uchar 1 +put Nrx 284 uchar typ +nvopt 285 54 nvsrv +nvopt 291 1 nvip4 255 255 255 0 +nvopt 297 3 nvsrv +nvopt 303 6 nvdns +nvopt 309 51 3600 +put Nrx 315 uchar 255 +ret nvudp nvsrv 4294967295 67 68 274 +end +fn nvreq to bool +if not nvnext +ret false +end +if or ne get Ntx 284 3 ne get Ntx 285 50 +ret false +end +if or ne nvt32 287 get Vip 0 ne nvt32 293 nvsrv +ret false +end +if ne nvt32 46 get Vxid 0 +ret false +end +ret nvtxok +end +fn nvarpq spa ulong tpa ulong to bool +if not nvnext +ret false +end +if or ne nvt16 12 2054 ne nvt16 20 1 +ret false +end +for i ulong 6 +if or ne get Ntx add i 6 get Nmac i ne get Ntx add i 22 get Nmac i +ret false +end +end +ret and eq nvt32 28 spa eq nvt32 38 tpa +end +fn nvarp op ulong spa ulong tpa ulong to ulong +nvclr +nveth 2054 +nvw16 14 1 +nvw16 16 2048 +put Nrx 18 uchar 6 +put Nrx 19 uchar 4 +nvw16 20 op +for i ulong 6 +put Nrx add i 22 get Vpeer i +put Nrx add i 32 get Nmac i +end +nvw32 28 spa +nvw32 38 tpa +ret 60 +end +fn nvdnsq to bool +if not nvnext +ret false +end +for i ulong 6 +if ne get Ntx i get Vpeer i +ret false +end +end +if or ne nvt32 30 nvdns ne nvt16 36 53 +ret false +end +put Vdport 0 nvt16 34 +put Vdid 0 nvt16 42 +if ne get Vdport 0 add 49152 rem nvip4 9 10 11 12 16384 +ret false +end +if or ne get Vdid 0 and nvip4 5 6 7 8 65535 ne nvt16 44 256 +ret false +end +if or ne get Ntx 54 3 ne get Ntx 58 6 +ret false +end +if or ne get Ntx 65 3 ne get Ntx 69 0 +ret false +end +for i ulong 3 +if or ne get Ntx add i 55 get Vq i ne get Ntx add i 66 get Vq add i 9 +ret false +end +end +for i ulong 6 +if ne get Ntx add i 59 get Vq add i 3 +ret false +end +end +if or ne nvt16 70 1 ne nvt16 72 1 +ret false +end +ret nvtxok +end +fn nvboot to bool +if not nvstart +ret false +end +if not nvdisc +ret false +end +nvsent +nvin nvdhcp 2 add get Vxid 0 1 +netstep get Vnow 0 +if ne get Ntxlen 0 0 +ret false +end +n = nvdhcp 2 get Vxid 0 +put Nrx 100 uchar 1 +nvin n +netstep get Vnow 0 +if ne get Ntxlen 0 0 +ret false +end +nvin nvdhcp 2 get Vxid 0 +if not nvreq +ret false +end +nvsent +nvin nvdhcp 5 get Vxid 0 +for k ulong 3 +if not nvarpq 0 get Vip 0 +ret false +end +nvsent +end +for k ulong 2 +if not nvarpq get Vip 0 get Vip 0 +ret false +end +nvsent +end +if not nvarpq get Vip 0 nvdns +ret false +end +nvsent +if ne get Tcpstate 0 2 +ret false +end +nvsetmac 0 187 +nvin nvarp 2 nvdns get Vip 0 +if not nvdnsq +ret false +end +nvsent +ret true +end +note DNS question in mixed case; CNAME via compression to the question, A via +note compression to the CNAME rdata. mode 1 forward pointer, 2 TC, 3 wrong id. +fn nvqname p ulong to void +put Nrx p uchar 3 +put Nrx add p 4 uchar 6 +put Nrx add p 11 uchar 3 +for i ulong 3 +put Nrx add add p 1 i get Vqmix i +put Nrx add add p 12 i get Vqmix add i 9 +end +for i ulong 6 +put Nrx add add p 5 i get Vqmix add i 3 +end +end +fn nvrr p ulong name ulong typ ulong n ulong to void +nvw16 p name +nvw16 add p 2 typ +nvw16 add p 4 1 +nvw32 add p 6 60 +nvw16 add p 10 n +end +fn nvdnsr mode ulong to ulong +nvclr +nvsetmac 0 187 +id = get Vdid 0 +if eq mode 3 +id = xor id 1 +end +nvw16 42 id +if eq mode 2 +nvw16 44 33664 +else +nvw16 44 33152 +end +nvw16 46 1 +nvw16 48 2 +nvqname 54 +nvw16 70 1 +nvw16 72 1 +nvrr 74 49164 5 7 +put Nrx 86 uchar 4 +put Nrx 87 uchar 101 +put Nrx 88 uchar 100 +put Nrx 89 uchar 103 +put Nrx 90 uchar 101 +nvw16 91 49168 +if eq mode 1 +nvrr 93 49232 1 4 +else +nvrr 93 49196 1 4 +end +nvw32 105 nvgh +src = nvdns +if eq mode 6 +src = add src 1 +end +dp = get Vdport 0 +if eq mode 4 +dp = add dp 1 +end +n = nvudp src get Vip 0 53 dp 67 +if eq mode 5 +put Nrx 108 xor get Nrx 108 1 +end +ret n +end +fn nvsyn to bool +if not nvnext +ret false +end +for i ulong 6 +if ne get Ntx i get Vpeer i +ret false +end +end +if or ne nvt32 30 nvgh ne get Ntx 23 6 +ret false +end +if or ne get Ntx 47 2 ne get Ntx 46 96 +ret false +end +if or ne nvt16 54 516 ne nvt16 56 1460 +ret false +end +put Viss 0 nvt32 38 +put Vport 0 nvt16 34 +if ne get Viss 0 nvip4 13 14 15 16 +ret false +end +if ne get Vport 0 add 49152 rem nvip4 17 18 19 20 16384 +ret false +end +if ne nvt16 36 443 +ret false +end +ret nvtxok +end +fn nvsynack bad ulong to ulong +nvclr +nvsetmac 0 170 +put Nrx 54 uchar 2 +put Nrx 55 uchar 4 +nvw16 56 1400 +src = nvgh +ack = nadd get Viss 0 1 +if eq bad 2 +ack = nadd ack 1 +end +if eq bad 3 +src = add src 1 +end +n = nvtcp src nvsseq ack 18 24 0 +if eq bad 1 +put Nrx 51 xor get Nrx 51 1 +end +ret n +end +fn nvisack seq ulong ack ulong fl ulong dl ulong to bool +if not nvtxok +ret false +end +if or ne nvt32 38 seq ne nvt32 42 ack +ret false +end +if or ne get Ntx 47 uchar fl ne nvt16 16 add 40 dl +ret false +end +ret and eq nvt16 34 get Vport 0 eq nvt16 36 443 +end +fn nvopen hard bool to bool +if not nvboot +ret false +end +if hard +for m ulong 4 +nvin nvdnsr add m 3 +end +if ne get Tcpstate 0 2 +ret false +end +end +nvin nvdnsr 0 +if or ne get Tcpstate 0 3 ne get Tcpstate 2 nvgh +ret false +end +if not nvarpq get Vip 0 nvsrv +ret false +end +nvsent +nvsetmac 0 170 +nvin nvarp 2 nvsrv get Vip 0 +if not nvsyn +ret false +end +nvsent +if hard +for b ulong 3 +nvin nvsynack add b 1 +if ne get Tcpstate 0 3 +ret false +end +end +end +nvin nvsynack 0 +if ne get Tcpstate 0 4 +ret false +end +if not nvnext +ret false +end +if not nvisack nadd get Viss 0 1 nadd nvsseq 1 16 0 +ret false +end +nvsent +ret true +end +fn nvinj off ulong n ulong fl ulong src ulong ack ulong to ulong +note Inject a TCP segment at a stream offset with a repeated payload byte; no golden bytes needed. +nvclr +nvsetmac 0 170 +for i ulong n +put Nrx add 54 i uchar and i 255 +end +ret nvtcp src nadd nvsseq add 1 off ack fl 20 n +end +fn nvdata off ulong n ulong fl ulong src ulong ack ulong dat ulong to ulong +nvclr +nvsetmac 0 170 +for i ulong n +put Nrx add 54 i get Vget add dat i +end +ret nvtcp src nadd nvsseq add 1 off ack fl 20 n +end +fn nvwire to void +note RFC1071/791 header example with known checksum b861. +for i ulong 20 +put Ntx i uchar 0 +end +put Ntx 0 uchar 69 +put Ntx 3 uchar 115 +put Ntx 6 uchar 64 +put Ntx 8 uchar 64 +put Ntx 9 uchar 17 +put Ntx 12 uchar 192 +put Ntx 13 uchar 168 +put Ntx 15 uchar 1 +put Ntx 16 uchar 192 +put Ntx 17 uchar 168 +put Ntx 19 uchar 199 +check eq nfold ntsum 0 20 47201 1 +check eq nvcpl nvsum true 0 20 47201 2 +put Nrx 0 uchar 1 +put Nrx 1 uchar 2 +put Nrx 2 uchar 3 +check eq nrsum 0 3 1026 3 +check nlt 4294967295 0 4 +check not nlt 0 4294967295 5 +check eq nadd 4294967295 2 1 6 +check eq ndiff 1 4294967295 2 7 +end +fn nvfail code ulong id ulong to void +check eq get Tcpstate 0 6 id +check eq get Tcpstate 1 code add id 1 +check eq get Ntxlen 0 0 add id 2 +end +fn main to int +nvwire +check nvopen true 10 +put Tcpout 0 uchar 71 +put Tcpout 1 uchar 69 +put Tcpout 2 uchar 84 +check netwrite 3 get Vnow 0 11 +check not netwrite 1 get Vnow 0 12 +check nvnext 13 +a = nadd nvsseq 1 +check nvisack nadd get Viss 0 1 a 24 3 14 +check eq get Ntx 54 71 15 +netstep get Vnow 0 +check eq get Ntx 54 71 16 +netsent false get Vnow 0 +check ne get Ntxlen 0 0 17 +nvsent +check nvnext 18 +check nvisack nadd get Viss 0 1 a 24 3 19 +nvsent +s = nadd get Viss 0 4 +nvin nvdata 3 2 24 nvgh s 6 +check eq get Tcpn 0 0 20 +nvin nvdata 0 3 24 nvgh s 3 +check eq get Tcpn 0 5 21 +for i ulong 5 +check eq get Tcpin i get Vget add i 3 add 22 i +end +check netwrite 1 get Vnow 0 27 +nvin nvdata 0 3 24 nvgh s 3 +check eq get Tcpn 0 5 28 +nvin nvdata 5 1 24 add nvgh 1 s 3 +check eq get Tcpn 0 5 29 +nvin nvdata 5 0 17 nvgh s 3 +check eq get Tcpstate 0 5 30 +check eq get Tcpn 0 5 31 +netconsume 5 +check eq get Tcpn 0 0 32 +netconsume 1 +nvfail 17 33 +check nvopen false 40 +nvin nvtcp nvgh nadd nvsseq 101 nadd get Viss 0 1 4 20 0 +check eq get Tcpstate 0 4 41 +check nvnext 42 +nvin nvtcp nvgh nadd nvsseq 1 nadd get Viss 0 1 4 20 0 +nvfail 12 43 +check nvopen false 50 +s = nadd get Viss 0 1 +nvin nvdata 10 2 24 nvgh s 3 +check eq get Tcpn 0 0 51 +nvin nvdata 10 2 24 nvgh s 5 +nvfail 13 52 +check nvopen false 60 +check not netwrite 65537 get Vnow 0 61 +nvfail 17 62 +check nvboot 70 +nvin nvdnsr 1 +nvfail 10 71 +check nvboot 80 +nvin nvdnsr 2 +nvfail 9 81 +check nvstart 90 +netstep 1 +nvfail 1 91 +put Vnow 0 5000 +netinit get Vnow 0 +netconnect get Vnow 0 +nvfail 2 92 +check nvstart 100 +check nvdisc 101 +nvsent +nvin nvdhcp 2 get Vxid 0 +check nvreq 102 +nvsent +nvin nvdhcp 5 get Vxid 0 +check nvarpq 0 get Vip 0 103 +nvsent +nvsetmac 0 204 +nvin nvarp 1 get Vip 0 nvsrv +check nvnext 104 +check eq get Ntx 284 4 105 +nvsent +nvfail 6 106 +note aienux#454: three in-order 1440-byte segments after the app consumed the previous record. +check nvopen false 200 +ok = netwrite 3 get Vnow 0 +ok = nvnext +nvsent +a = nadd nvsseq 4 +b = nadd nvsseq 1 +put Ndrop 0 0 +nvin nvinj 0 1440 24 nvgh a +nvin nvinj 1440 1440 24 nvgh a +nvin nvinj 2880 1440 24 nvgh a +check eq get Tcpn 0 4320 201 +check eq ndiff get Nct 2 b 4320 202 +check eq get Ndrop 0 0 203 +netconsume 4320 +note aienux#454: a long transfer must not die on the mode-3 idle cap while frames keep arriving. +put Ncfg 1 3 +put Ncfg 9 5000 +t = get Vnow 0 +put Vnow 0 add t 4000 +nvin nvinj 4320 0 16 nvgh a +put Vnow 0 add t 6000 +netstep get Vnow 0 +check ne get Tcpstate 0 6 204 +put Ncfg 1 2 +note aienux#454: an in-order peer FIN completes the stream instead of being ignored. +check nvopen false 205 +ok = netwrite 3 get Vnow 0 +ok = nvnext +nvsent +c = nadd nvsseq 4 +nvin nvinj 0 3 24 nvgh c +netconsume 3 +nvin nvinj 3 0 17 nvgh c +check eq get Tcpstate 0 5 206 +check eq get Tcpn 0 0 207 +ret int get Fails 0 +end diff --git a/native/omega/allen/tests/paint.om b/native/omega/allen/tests/paint.om new file mode 100644 index 00000000..f45320ab --- /dev/null +++ b/native/omega/allen/tests/paint.om @@ -0,0 +1,16 @@ +fn main to int +check eq addcolor 0 16777215 256 16777215 1101 +check eq addcolor 16777215 16777215 256 16777215 1102 +check eq mix 0 16777215 256 16777215 1103 +check eq mix 0 16777215 0 0 1104 +check eq scale 16777215 128 8355711 1105 +check not glow 0 0 0 0 1 1106 +render +check eq get Frame 0 0 1107 +check gt get Frame 12384 0 1108 +check eq get Frame 24575 0 1109 +old = get Frame 12384 +check not glow 9000 0 16 1 1 1110 +check eq get Frame 12384 old 1111 +ret int get Fails 0 +end diff --git a/native/omega/allen/tests/presentation-mutants.om b/native/omega/allen/tests/presentation-mutants.om new file mode 100644 index 00000000..479516ff --- /dev/null +++ b/native/omega/allen/tests/presentation-mutants.om @@ -0,0 +1,101 @@ +note Reuses L748 native mutation builder; selector0 stale-event,1 input-tail. +global Mutbuf uchar 262144 +global Mutrep uchar 128 +global Mutmode uchar 1 +text Mutold0 "\nif not appreceive now\nret false\nend\nb = dpresent\n" +text Mutnew0 "\nb = appreceive now\nb = dpresent\n" +text Mutold1 "\nfor i ulong 8192\nput In i get Din i\nend\n" +text Mutnew1 "\nfor i ulong n\nput In i get Din i\nend\n" +fn mutmatch at ulong mode uchar to bool +if eq mode 48 +for i ulong len Mutold0 +if ne get Mutbuf add at i get Mutold0 i +ret false +end +end +else +for i ulong len Mutold1 +if ne get Mutbuf add at i get Mutold1 i +ret false +end +end +end +ret true +end +fn mutwrite at ulong size ulong to bool +p = ulong 0 +while lt p size +n = write 1 Mutbuf add at p sub size p +if le n 0 +ret false +end +p = add p ulong n +end +ret true +end +fn mutout n ulong mode uchar to int +old = len Mutold0 +size = len Mutnew0 +if eq mode 49 +old = len Mutold1 +size = len Mutnew1 +end +if lt n old +ret 65 +end +found = ulong 0 +at = ulong 0 +for i ulong add sub n old 1 +if mutmatch i mode +found = add found 1 +at = i +end +end +if ne found 1 +ret 65 +end +for i ulong size +if eq mode 48 +put Mutrep i get Mutnew0 i +else +put Mutrep i get Mutnew1 i +end +end +if not mutwrite 0 at +ret 74 +end +p = ulong 0 +while lt p size +r = write 1 Mutrep p sub size p +if le r 0 +ret 74 +end +p = add p ulong r +end +if not mutwrite add at old sub n add at old +ret 74 +end +ret 0 +end +fn main to int +r = read 0 Mutmode 0 1 +if ne r 1 +ret 65 +end +mode = get Mutmode 0 +if and ne mode 48 ne mode 49 +ret 65 +end +n = ulong 0 +while lt n len Mutbuf +r = read 0 Mutbuf n sub len Mutbuf n +if lt r 0 +ret 74 +end +if eq r 0 +ret mutout n mode +end +n = add n ulong r +end +ret 65 +end diff --git a/native/omega/allen/tests/presentation.om b/native/omega/allen/tests/presentation.om new file mode 100644 index 00000000..39122182 --- /dev/null +++ b/native/omega/allen/tests/presentation.om @@ -0,0 +1,238 @@ +text Prompt1 "hello" +text Leak "LEAK" +text Scene1 "SAY 1 1/1 note left: Heading | Body" +text Hidden1 "private" +text Badscene "number: nope" +text Prompt2 "write a calculator" +text Code2 "CODE 2 1/1 2 d8932aac text hi" +text Done2 "SAY 2 1/1 Done." +global Saved uchar 8192 +global Keep ulong 2 +global Before uchar 8192 +global Wire uchar 8192 +fn test ok bool to void +put Keep 0 get Outlen 0 +put Keep 1 get Err 0 +for i ulong get Outlen 0 +put Saved i get Outb i +end +check ok add get Checks 0 1 +for i ulong get Keep 0 +put Outb i get Saved i +end +put Outlen 0 get Keep 0 +put Err 0 get Keep 1 +end +fn inbound part ulong to void +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Before i get Outb i +end +b = packet 2 get Q 1 part 0 0 +size = get Outlen 0 +for i ulong size +put In i get Outb i +end +put Inlen 0 size +for i ulong n +put Outb i get Before i +end +put Outlen 0 n +put Err 0 e +end +fn main to int +test not dpresent +test appinit 77 0 +put Inlen 0 len Prompt1 +for i ulong len Prompt1 +put In i get Prompt1 i +end +test dask 1 +test eq get R 0 1 +test eq get Dm 0 0 +test apppoll 1 true +n = get Outlen 0 +for i ulong n +put Wire i get Outb i +end +for i ulong len Scene1 +put In i get Scene1 i +end +put Inlen 0 len Scene1 +inbound 1 +size = get Inlen 0 +for i ulong size +put Before i get In i +end +test drecv 2 +test eq get A 2 1 +test eq get Dm 0 1 +test eq get Dm 2 1 +test eq get Ds 3 1 +test eq get Dt 0 1 +test eq get Dt 1 1 +test eq get Dtext get Dt 7 72 +test eq get Dtext get Dt 8 66 +test eq get Outlen 0 n +same = true +for i ulong n +if ne get Outb i get Wire i +same = false +end +end +test same +test eq get T 10 5 +note appreceive replaces In with its payload; only dpresent must preserve that. +size = get Inlen 0 +for i ulong size +put Before i get In i +end +test dpresent +test eq get Inlen 0 size +same = true +for i ulong size +if ne get Before i get In i +same = false +end +end +test same +note Even bytes outside current Inlen survive decoder scratch expansion. +for i ulong 8192 +put In i 165 +put Before i 165 +end +put Inlen 0 1 +test dpresent +test eq get Inlen 0 1 +same = true +for i ulong 8192 +if ne get In i get Before i +same = false +end +end +test same +put Inlen 0 8193 +test not dpresent +put Inlen 0 1 +note Hidden or invalid scene text cannot erase the last admitted presentation. +for i ulong len Hidden1 +put Answer i get Hidden1 i +end +put R 8 len Hidden1 +test not dpresent +test eq get Ds 3 1 +test eq get Dtext get Dt 7 72 +for i ulong len Badscene +put Answer i get Badscene i +end +put R 8 len Badscene +test not dpresent +test eq get Ds 3 1 +put A 2 0 +test not dpresent +put A 2 1 +put R 8 160 +test not dpresent +put R 8 0 +test not dpresent +note Refused receive cannot publish a stale event1. +for i ulong len Leak +put Answer i get Leak i +end +put R 8 len Leak +put Inlen 0 1 +put In 0 88 +test not drecv 2 +test eq get Ds 3 1 +test appsent 2 true +test apppoll 2 true +test appsent 2 true +put Inlen 0 len Prompt2 +for i ulong len Prompt2 +put In i get Prompt2 i +end +test dask 3 +test eq get R 0 2 +test eq get Ds 2 1 +test eq get Dtext get Dsay 0 73 +for i ulong len Code2 +put In i get Code2 i +end +put Inlen 0 len Code2 +inbound 1 +test drecv 4 +test eq get Dm 1 0 +test apppoll 4 true +test appsent 4 true +for i ulong len Done2 +put In i get Done2 i +end +put Inlen 0 len Done2 +inbound 2 +test drecv 5 +test eq get Dm 1 1 +test eq get Dm 2 2 +test eq get Dview 0 1 +test eq get Dview 1 0 +test eq get Dview 2 2 +test eq get Dstart 0 0 +test eq get Dlen 0 2 +test eq get Dline 0 1 +test eq get Dcode 0 104 +test eq get Dcode 1 105 +test eq get Dtext get Dsay 0 68 +note Code completion does not require a nonempty closing sentence. +put R 8 0 +test dpresent +test eq get Dm 1 1 +test eq get Dcode 0 104 +put Code 0 88 +test not dpresent +test eq get Dcode 0 104 +test eq get Dlen 0 2 +put Code 0 104 +note Later assembly may reuse Code; the displayed snapshot cannot alias it. +codebeg 3 +put Code 0 88 +test eq get Dcode 0 104 +put A 2 0 +test not dpresent +test eq get Dm 1 1 +put Dtext 2303 88 +put Dcode 32767 88 +put Dstart 4095 88 +put Dlen 4095 88 +put Dline 4095 88 +dreset +test eq get Dm 0 0 +test eq get Dm 1 0 +test eq get Dview 0 0 +test eq get R 0 2 +test eq get Q 1 2 +same = true +for i ulong 2304 +if ne get Dtext i 0 +same = false +end +end +test same +same = true +for i ulong 32768 +if ne get Dcode i 0 +same = false +end +end +test same +same = true +for i ulong 4096 +if ne or or get Dstart i get Dlen i get Dline i 0 +same = false +end +end +test same +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/native/omega/allen/tests/probe.om b/native/omega/allen/tests/probe.om new file mode 100644 index 00000000..726e2312 --- /dev/null +++ b/native/omega/allen/tests/probe.om @@ -0,0 +1,8 @@ +text ready "Allen Omega native probe\n" +fn main to int +n = write 1 ready 0 len ready +if ne n long len ready +ret 1 +end +ret 0 +end diff --git a/native/omega/allen/tests/provider-core.om b/native/omega/allen/tests/provider-core.om new file mode 100644 index 00000000..b703386c --- /dev/null +++ b/native/omega/allen/tests/provider-core.om @@ -0,0 +1,306 @@ +text Fmagic "ALNPRV01" +text Hi "hi" +text Leak "LEAK" +text Reply "SAY 1 1/1 hello" +text Askcode "write a calculator" +text Tinycode "CODE 2 1/1 2 d8932aac text hi" +text Done "SAY 2 1/1 Done." +global Held uchar 8192 +global Holdn ulong 2 +global Before uchar 8192 +fn test ok bool to void +note Direct write logger would clobber the very datagram being tested. +put Holdn 0 get Outlen 0 +put Holdn 1 get Err 0 +for i ulong get Outlen 0 +put Held i get Outb i +end +check ok add get Checks 0 1 +for i ulong get Holdn 0 +put Outb i get Held i +end +put Outlen 0 get Holdn 0 +put Err 0 get Holdn 1 +end +fn hword off ulong v ulong to void +for i ulong 8 +put Ph add off i uchar and shr v mul i 8 255 +end +end +fn frame op ulong now ulong arg ulong size ulong to void +for i ulong 8 +put Ph i get Fmagic i +end +hword 8 op +hword 16 now +hword 24 arg +hword 32 size +end +fn oword off ulong to ulong +v = ulong 0 +for i ulong 8 +v = or v shl ulong get Pout add off i mul i 8 +end +ret v +end +fn receive part ulong size ulong to void +note Caller placed LINE payload in In; packet overwrites Outb, so preserve it. +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Held i get Outb i +end +put Inlen 0 size +b = packet 2 get Q 1 part 0 0 +size = get Outlen 0 +for i ulong size +put Pb i get Outb i +end +for i ulong n +put Outb i get Held i +end +put Outlen 0 n +put Err 0 e +frame 5 4294967297 0 size +end +fn main to int +frame 1 4294967296 77 0 +test prparse +test eq get Pv 0 1 +test eq get Pv 1 4294967296 +test eq get Pv 2 77 +put Ph 0 88 +test not prparse +frame 11 0 0 0 +test not prparse +frame 1 0 77 1 +test not prparse +frame 3 0 2 0 +test not prparse +frame 2 0 0 160 +test not prparse +frame 10 0 0 0 +test prdo +test eq oword 16 1 +test eq get Pc 0 1 +mset32 0 3 +mset32 36 1 +test memenc 10 +for i ulong 4096 +put Pb i get Enc i +end +frame 8 0 1 4096 +test prdo +test eq oword 16 1 +test eq get St 0 10 +test prdo +test eq oword 16 0 +frame 1 4294967296 77 0 +test prdo +test eq oword 16 0 +for i ulong 4096 +put Pb i 0 +end +frame 8 0 0 4096 +test prdo +test eq oword 16 2 +test eq get Pc 0 2 +test eq get St 0 10 +frame 1 4294967296 77 0 +test prdo +test eq oword 16 0 +put Ns 0 2 +put Ns 1 0 +put Ns 2 3 +put Ns 3 0 +put Note 0 78 +put Note 1 48 +test noteenc +for i ulong 4096 +put Pb i get Enc i +end +frame 9 0 1 4096 +test prdo +test eq oword 16 0 +frame 9 0 0 4096 +test prdo +test eq oword 16 1 +test eq get Pc 0 3 +frame 1 4294967296 77 0 +test prdo +test eq oword 16 1 +test eq get A 0 1 +test eq get Dm 0 0 +test eq get Dm 1 0 +test prdo +test eq oword 16 0 +frame 10 0 0 0 +test prdo +test eq oword 16 0 +test eq mem32 0 3 +frame 2 4294967297 0 len Hi +for i ulong len Hi +put Pb i get Hi i +end +test prdo +test eq oword 16 1 +test eq get R 0 1 +test eq get Dm 0 0 +frame 3 4294967297 1 0 +test prdo +test eq oword 16 3 +test eq oword 32 get Outlen 0 +test eq get T 10 5 +same = true +for i ulong get Outlen 0 +if ne get Pout add i 40 get Outb i +same = false +end +end +test same +test prdo +test eq oword 16 1 +test eq get T 10 5 +frame 4 4294967297 0 0 +test prdo +test eq get T 3 0 +frame 3 4294967297 1 0 +test prdo +test eq oword 16 3 +frame 4 4294967297 1 0 +test prdo +test eq get T 3 1 +frame 3 4294967297 1 0 +test prdo +test eq get T 10 1 +for i ulong len Reply +put In i get Reply i +end +receive 1 len Reply +n = get Outlen 0 +e = get Err 0 +for i ulong n +put Before i get Outb i +end +test prdo +test eq get Outlen 0 n +test eq get Err 0 e +same = true +for i ulong n +if ne get Outb i get Before i +same = false +end +end +test same +test eq oword 16 1 +test eq oword 24 1 +test eq oword 32 5 +test eq get Pout 40 104 +test eq get Dm 0 1 +test eq get Dm 2 1 +test eq get Ds 2 1 +test eq get Dtext get Dsay 0 104 +test eq get R 1 0 +test eq get T 10 1 +test eq get Outb 0 65 +note A stale visible event must not be projected by a rejected provider frame. +for i ulong len Leak +put Answer i get Leak i +end +put R 8 len Leak +frame 5 4294967297 0 65 +put Ph 0 88 +test not prdo +test eq get Dtext get Dsay 0 104 +frame 5 4294967297 0 65 +for i ulong 65 +put Pb i 0 +end +test prdo +test eq oword 16 0 +test eq get Dtext get Dsay 0 104 +test eq get Dm 2 1 +frame 4 4294967297 1 0 +test prdo +frame 3 4294967297 1 0 +test prdo +test eq oword 16 3 +test eq get T 10 3 +frame 4 4294967297 1 0 +test prdo +frame 3 4294967297 1 0 +test prdo +test eq oword 16 1 +test eq oword 32 0 +frame 2 4294967297 0 len Askcode +for i ulong len Askcode +put Pb i get Askcode i +end +test prdo +test eq oword 24 1 +test eq oword 32 len Ack +test eq get Dm 0 1 +test eq get Dm 2 2 +test eq get Dtext get Dsay 0 73 +for i ulong len Tinycode +put In i get Tinycode i +end +receive 1 len Tinycode +test prdo +test eq oword 24 0 +test eq get Dm 1 0 +frame 3 4294967297 1 0 +test prdo +frame 4 4294967297 1 0 +test prdo +for i ulong len Done +put In i get Done i +end +receive 2 len Done +test prdo +test eq oword 24 1 +test eq oword 32 5 +off = ulong 45 +test eq oword add off 8 11 +test eq oword add off 32 2 +test eq get Pout add off 40 104 +test eq get Pout add off 41 105 +test eq get Pn 0 add off 42 +test eq get Dm 1 1 +test eq get Dm 2 2 +test eq get Dview 0 1 +test eq get Dview 2 2 +test eq get Dlen 0 2 +test eq get Dcode 0 104 +test eq get Dcode 1 105 +test eq get Dtext get Dsay 0 68 +note Snapshot stays independent of later assembly and refused clock. +put Code 0 88 +test eq get Dcode 0 104 +frame 3 4294967296 1 0 +test prdo +test eq oword 16 0 +test eq oword 24 0 +test eq get Dcode 0 104 +test eq get Dtext get Dsay 0 68 +put Dtext 2303 88 +put Dcode 32767 88 +put Dlen 4095 88 +frame 7 0 0 0 +test prdo +test eq get Dm 0 0 +test eq get Dm 1 0 +test eq get Dm 2 0 +test eq get Dview 0 0 +test eq get Dview 2 0 +test eq get Dtext 2303 0 +test eq get Dcode 32767 0 +test eq get Dlen 4095 0 +test eq get R 9 0 +test eq get R 0 2 +test eq get Q 1 2 +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/native/omega/allen/tests/provider-display-mutants.om b/native/omega/allen/tests/provider-display-mutants.om new file mode 100644 index 00000000..04ea517f --- /dev/null +++ b/native/omega/allen/tests/provider-display-mutants.om @@ -0,0 +1,119 @@ +note Native exact-line mutant construction; selector0 raw-ASK,1 raw-RECV,2 raw-RESET. +global Mutbuf uchar 262144 +global Mutrep uchar 128 +global Mutmode uchar 1 +text Mutold0 "\nif not dask now\n" +text Mutnew0 "\nif not appask now\n" +text Mutold1 "\nif not drecv now\n" +text Mutnew1 "\nif not appreceive now\n" +text Mutold2 "\ndreset\nret 1\n" +text Mutnew2 "\nappreset\nret 1\n" +fn mutmatch at ulong mode uchar to bool +if eq mode 48 +for i ulong len Mutold0 +if ne get Mutbuf add at i get Mutold0 i +ret false +end +end +else +if eq mode 49 +for i ulong len Mutold1 +if ne get Mutbuf add at i get Mutold1 i +ret false +end +end +else +for i ulong len Mutold2 +if ne get Mutbuf add at i get Mutold2 i +ret false +end +end +end +end +ret true +end +fn mutwrite at ulong size ulong to bool +p = ulong 0 +while lt p size +n = write 1 Mutbuf add at p sub size p +if le n 0 +ret false +end +p = add p ulong n +end +ret true +end +fn mutout n ulong mode uchar to int +old = len Mutold0 +size = len Mutnew0 +if eq mode 49 +old = len Mutold1 +size = len Mutnew1 +end +if eq mode 50 +old = len Mutold2 +size = len Mutnew2 +end +if lt n old +ret 65 +end +found = ulong 0 +at = ulong 0 +for i ulong add sub n old 1 +if mutmatch i mode +found = add found 1 +at = i +end +end +if ne found 1 +ret 65 +end +for i ulong size +if eq mode 48 +put Mutrep i get Mutnew0 i +else +if eq mode 49 +put Mutrep i get Mutnew1 i +else +put Mutrep i get Mutnew2 i +end +end +end +if not mutwrite 0 at +ret 74 +end +p = ulong 0 +while lt p size +r = write 1 Mutrep p sub size p +if le r 0 +ret 74 +end +p = add p ulong r +end +if not mutwrite add at old sub n add at old +ret 74 +end +ret 0 +end +fn main to int +r = read 0 Mutmode 0 1 +if ne r 1 +ret 65 +end +mode = get Mutmode 0 +if or lt mode 48 gt mode 50 +ret 65 +end +n = ulong 0 +while lt n len Mutbuf +r = read 0 Mutbuf n sub len Mutbuf n +if lt r 0 +ret 74 +end +if eq r 0 +ret mutout n mode +end +n = add n ulong r +end +ret 65 +end diff --git a/native/omega/allen/tests/provider-input.om b/native/omega/allen/tests/provider-input.om new file mode 100644 index 00000000..dec2a97a --- /dev/null +++ b/native/omega/allen/tests/provider-input.om @@ -0,0 +1,144 @@ +note Generates real framed stdin. Mode byte0 normal,1..5 malformed,6 fail-fast. +text Iomagic "ALNPRV01" +text Wireline "ALLEN-COURIER v=1 run=000000000000004d kind=LINE seq=1 part=1/0 bytes=0\nSAY 1 1/1 hello" +global Ih uchar 40 +global Choice uchar 1 +fn iword off ulong v ulong to void +for i ulong 8 +put Ih add off i uchar and shr v mul i 8 255 +end +end +fn ihead op ulong now ulong arg ulong size ulong to void +for i ulong 8 +put Ih i get Iomagic i +end +iword 8 op +iword 16 now +iword 24 arg +iword 32 size +end +fn ihwrite count ulong to bool +p = ulong 0 +while lt p count +size = sub count p +if eq get Choice 0 55 +size = 1 +end +n = write 1 Ih p size +if le n 0 +ret false +end +p = add p ulong n +end +ret true +end +fn ibwrite count ulong to bool +p = ulong 0 +while lt p count +size = sub count p +if eq get Choice 0 55 +size = 1 +end +n = write 1 Pb p size +if le n 0 +ret false +end +p = add p ulong n +end +ret true +end +fn iframe op ulong now ulong arg ulong size ulong to bool +ihead op now arg size +if not ihwrite 40 +ret false +end +ret ibwrite size +end +fn main to int +n = read 0 Choice 0 1 +if ne n 1 +ret 65 +end +mode = get Choice 0 +if eq mode 56 +ihead 1 1 0 0 +b = ihwrite 40 +ret 0 +end +if eq mode 49 +ihead 1 0 77 0 +put Ih 0 88 +b = ihwrite 40 +ret 0 +end +if eq mode 50 +ihead 2 0 0 160 +b = ihwrite 40 +ret 0 +end +if eq mode 51 +ihead 1 0 77 0 +b = ihwrite 39 +ret 0 +end +if eq mode 52 +ihead 2 0 0 2 +b = ihwrite 40 +put Pb 0 104 +b = ibwrite 1 +ret 0 +end +if eq mode 53 +ihead 11 0 0 0 +b = ihwrite 40 +ret 0 +end +if not iframe 1 0 77 0 +ret 74 +end +if eq mode 54 +ihead 2 1 0 160 +b = ihwrite 40 +for i ulong 160 +put Pb i 120 +end +b = ibwrite 160 +put Pb 0 104 +put Pb 1 105 +b = iframe 2 1 0 2 +ret 0 +end +put Pb 0 104 +put Pb 1 105 +if not iframe 2 1 0 2 +ret 74 +end +if not iframe 3 1 1 0 +ret 74 +end +if not iframe 4 1 1 0 +ret 74 +end +if not iframe 3 1 1 0 +ret 74 +end +if not iframe 4 1 1 0 +ret 74 +end +for i ulong len Wireline +put Pb i get Wireline i +end +if not iframe 5 2 0 len Wireline +ret 74 +end +if not iframe 3 2 1 0 +ret 74 +end +if not iframe 4 2 1 0 +ret 74 +end +if not iframe 3 2 1 0 +ret 74 +end +ret 0 +end diff --git a/native/omega/allen/tests/provider-mutants.om b/native/omega/allen/tests/provider-mutants.om new file mode 100644 index 00000000..70e14275 --- /dev/null +++ b/native/omega/allen/tests/provider-mutants.om @@ -0,0 +1,101 @@ +note Native exact-line mutant construction; selector0 auto-SENT,1 skip-shape. +global Mutbuf uchar 262144 +global Mutrep uchar 128 +global Mutmode uchar 1 +text Mutold0 "\nprreply status\n" +text Mutnew0 "\nb = qsent get Pv 1 true\nprreply status\n" +text Mutold1 "\nret prshape\n" +text Mutnew1 "\nret true\n" +fn mutmatch at ulong mode uchar to bool +if eq mode 48 +for i ulong len Mutold0 +if ne get Mutbuf add at i get Mutold0 i +ret false +end +end +else +for i ulong len Mutold1 +if ne get Mutbuf add at i get Mutold1 i +ret false +end +end +end +ret true +end +fn mutwrite at ulong size ulong to bool +p = ulong 0 +while lt p size +n = write 1 Mutbuf add at p sub size p +if le n 0 +ret false +end +p = add p ulong n +end +ret true +end +fn mutout n ulong mode uchar to int +old = len Mutold0 +size = len Mutnew0 +if eq mode 49 +old = len Mutold1 +size = len Mutnew1 +end +if lt n old +ret 65 +end +found = ulong 0 +at = ulong 0 +for i ulong add sub n old 1 +if mutmatch i mode +found = add found 1 +at = i +end +end +if ne found 1 +ret 65 +end +for i ulong size +if eq mode 48 +put Mutrep i get Mutnew0 i +else +put Mutrep i get Mutnew1 i +end +end +if not mutwrite 0 at +ret 74 +end +p = ulong 0 +while lt p size +r = write 1 Mutrep p sub size p +if le r 0 +ret 74 +end +p = add p ulong r +end +if not mutwrite add at old sub n add at old +ret 74 +end +ret 0 +end +fn main to int +r = read 0 Mutmode 0 1 +if ne r 1 +ret 65 +end +mode = get Mutmode 0 +if and ne mode 48 ne mode 49 +ret 65 +end +n = ulong 0 +while lt n len Mutbuf +r = read 0 Mutbuf n sub len Mutbuf n +if lt r 0 +ret 74 +end +if eq r 0 +ret mutout n mode +end +n = add n ulong r +end +ret 65 +end diff --git a/native/omega/allen/tests/provider-output.om b/native/omega/allen/tests/provider-output.om new file mode 100644 index 00000000..e0ba0e6c --- /dev/null +++ b/native/omega/allen/tests/provider-output.om @@ -0,0 +1,104 @@ +note Independent stream-output assertions, not a captured/blessed output fixture. +global Vbuf uchar 65536 +text Vmagic "ALNPRV01" +text Ops "1234345343" +text Hello "ALLEN-COURIER v=1 run=000000000000004d kind=HELLO seq=0 part=0/0 bytes=0\n" +text Got "ALLEN-COURIER v=1 run=000000000000004d kind=GOT seq=1 part=1/0 bytes=0\n" +text Jobtail "hi\tself=Allen\tstarts=0" +text Wordsout "hello" +fn test ok bool to void +check ok add get Checks 0 1 +end +fn vword off ulong to ulong +v = ulong 0 +for i ulong 8 +v = or v shl ulong get Vbuf add off i mul i 8 +end +ret v +end +fn vbyte at ulong expected uchar to void +test eq get Vbuf at expected +end +fn verify n ulong to int +p = ulong 0 +count = ulong 0 +while lt p n +if or lt sub n p 40 ge count 10 +ret 65 +end +for i ulong 8 +vbyte add p i get Vmagic i +end +op = vword add p 8 +status = vword add p 16 +event = vword add p 24 +size = vword add p 32 +p = add p 40 +if gt size sub n p +ret 65 +end +test eq op sub ulong get Ops count 48 +wanted = ulong 1 +if or eq count 2 eq count 4 +wanted = 3 +end +if eq count 7 +wanted = 3 +end +test eq status wanted +if eq count 6 +test eq event 1 +test eq size len Wordsout +for i ulong len Wordsout +vbyte add p i get Wordsout i +end +else +test eq event 0 +end +if eq count 2 +test eq size len Hello +for i ulong len Hello +vbyte add p i get Hello i +end +end +if eq count 7 +test eq size len Got +for i ulong len Got +vbyte add p i get Got i +end +end +if eq count 4 +test ge size len Jobtail +if ge size len Jobtail +at = add p sub size len Jobtail +for i ulong len Jobtail +vbyte add at i get Jobtail i +end +end +end +if and ne wanted 3 ne count 6 +test eq size 0 +end +p = add p size +count = add count 1 +end +test eq count 10 +if ne get Fails 0 0 +ret 1 +end +ret 0 +end +fn main to int +n = ulong 0 +while lt n len Vbuf +r = read 0 Vbuf n sub len Vbuf n +if lt r 0 +ret 74 +end +if eq r 0 +ret verify n +end +n = add n ulong r +end +ret 65 +end diff --git a/native/omega/allen/tests/provider-process.om b/native/omega/allen/tests/provider-process.om new file mode 100644 index 00000000..3b190ff8 --- /dev/null +++ b/native/omega/allen/tests/provider-process.om @@ -0,0 +1,100 @@ +note Native assertions over host-collected process receipts. +note Four decimal lines: mode, exit, stdout bytes, stderr bytes; then stdout+stderr. +global Procbuf uchar 65536 +global Procnum ulong 4 +global Procpos ulong 1 +text Procmag "ALNPRV01" +fn pcheck ok bool to void +check ok add get Checks 0 1 +end +fn pnumber n ulong to bool +v = ulong 0 +digits = ulong 0 +while lt get Procpos 0 n +c = get Procbuf get Procpos 0 +put Procpos 0 add get Procpos 0 1 +if eq c 10 +if eq digits 0 +ret false +end +put Procnum 3 v +ret true +end +if or lt c 48 gt c 57 +ret false +end +if ge digits 8 +ret false +end +v = add mul v 10 sub ulong c 48 +digits = add digits 1 +end +ret false +end +fn pword off ulong to ulong +v = ulong 0 +for i ulong 8 +v = or v shl ulong get Procbuf add off i mul i 8 +end +ret v +end +fn pverify n ulong to int +for i ulong 3 +if not pnumber n +ret 65 +end +put Procnum i get Procnum 3 +end +if not pnumber n +ret 65 +end +mode = get Procnum 0 +rc = get Procnum 1 +size = get Procnum 2 +err = get Procnum 3 +p = get Procpos 0 +pcheck eq n add add p size err +pcheck eq err 0 +if le mode 6 +pcheck ge mode 1 +pcheck eq rc 65 +if eq mode 6 +pcheck eq size 40 +if ge sub n p 40 +for i ulong 8 +pcheck eq get Procbuf add p i get Procmag i +end +pcheck eq pword add p 8 1 +pcheck eq pword add p 16 1 +pcheck eq pword add p 24 0 +pcheck eq pword add p 32 0 +end +else +pcheck eq size 0 +end +else +if eq mode 7 +pcheck eq rc 0 +else +ret 65 +end +end +if ne get Fails 0 0 +ret 1 +end +ret 0 +end +fn main to int +n = ulong 0 +while lt n len Procbuf +r = read 0 Procbuf n sub len Procbuf n +if lt r 0 +ret 74 +end +if eq r 0 +ret pverify n +end +n = add n ulong r +end +ret 65 +end diff --git a/native/omega/allen/tests/render.om b/native/omega/allen/tests/render.om new file mode 100644 index 00000000..b30df9bc --- /dev/null +++ b/native/omega/allen/tests/render.om @@ -0,0 +1,12 @@ +text Ppm "P6\n192 128\n255\n" +fn main to int +render +w = write 1 Ppm 0 len Ppm +if ne w long len Ppm +ret 1 +end +if not frameout +ret 2 +end +ret 0 +end diff --git a/native/omega/allen/tests/reply.om b/native/omega/allen/tests/reply.om new file mode 100644 index 00000000..4f9fd669 --- /dev/null +++ b/native/omega/allen/tests/reply.om @@ -0,0 +1,47 @@ +text Wait "WAIT 7" +text Say1 "SAY 7 1/0 First\\npart" +text Say2 "SAY 7 2/2 Model words." +text Final "SAY 8 1/1 Code ready." +fn main to int +put R 0 7 +put R 1 1 +put R 2 1 +put Inlen 0 len Wait +for i ulong len Wait +put In i get Wait i +end +check eq saytake 10 1 801 +check eq get R 4 10 802 +put Inlen 0 len Say1 +for i ulong len Say1 +put In i get Say1 i +end +check eq saytake 11 1 803 +check eq get R 8 10 804 +check eq saytake 12 0 805 +check eq get R 8 10 806 +put Inlen 0 len Say2 +for i ulong len Say2 +put In i get Say2 i +end +check eq saytake 13 1 807 +check eq get R 1 0 808 +check eq get R 8 23 809 +check eq saytake 14 0 810 +put R 0 8 +put R 1 1 +put R 2 2 +codebeg 8 +put Inlen 0 len Final +for i ulong len Final +put In i get Final i +end +v = saytake 15 +same = eq get Outlen 0 7 +check eq v 2 811 +check same 812 +check eq get R 1 1 813 +check eq saytake 16 3 814 +check eq get R 1 0 815 +ret int get Fails 0 +end diff --git a/native/omega/allen/tests/runtime.om b/native/omega/allen/tests/runtime.om new file mode 100644 index 00000000..8a0d9d2a --- /dev/null +++ b/native/omega/allen/tests/runtime.om @@ -0,0 +1,57 @@ +text Ask "make me a calculator" +text Reply "Model supplied answer." +fn askload to void +put Inlen 0 len Ask +for i ulong len Ask +put In i get Ask i +end +end +fn main to int +askload +check start 2 0 1 +check eq get R 1 1 2 +check eq get R 2 2 3 +check eq get R 8 len Ack 4 +old = get R 0 +check not start 1 1 5 +put Inlen 0 len Reply +for i ulong len Reply +put In i get Reply i +end +check not answer add old 1 2 6 +check eq get R 8 len Ack 7 +check answer old 3 8 +check eq get R 1 0 9 +askload +check start 1 4 10 +check gt get R 0 old 11 +cancel +check eq get R 1 0 12 +check not answer get R 0 5 13 +askload +check start 1 10 14 +check eq tick 20009 0 15 +check eq tick 20010 1 16 +check eq tick 20011 0 17 +check eq tick 30010 2 18 +check eq get R 1 0 19 +old = get R 0 +reset +check eq get R 0 old 20 +askload +check start 2 40000 21 +check gt get R 0 old 22 +cancel +put Inlen 0 160 +check not start 1 40001 23 +check eq get R 1 0 24 +askload +check not start 3 40002 25 +put R 6 1 +check start 3 40003 26 +check eq get R 8 len Ackmore 27 +cancel +put R 0 4294967295 +check not start 1 40004 28 +ret int get Fails 0 +end diff --git a/native/omega/allen/tests/scene-input.om b/native/omega/allen/tests/scene-input.om new file mode 100644 index 00000000..51ef9bf7 --- /dev/null +++ b/native/omega/allen/tests/scene-input.om @@ -0,0 +1,213 @@ +text Fancy "\t- **SaY**:\tKeep My CASE.~\n> NOTE RIGHT WARM: Title | Body TEXT\n" +text Private "say secret\nnote: secret | hidden\n\n```scene\nsay Visible\n```\n" +text Inline "say public secret\nsay Safe\n" +text Unclosed "never closed\nsay secret\n" +text Plain "Hello there.\nAnother sentence.\n" +text Mixed "Unrecognized text.\nnote: Heading | Body\n" +text Invalid "number: nope\n" +text Moodonly "MOOD Dawn Lively\n" +text Listmark "1. note left: Heading | Body\n" +text Wanted "Keep My CASE." +text Vis "Visible" +text Hello "Hello there." +text Nested "- > - **SaY**: Nested works.\n" +text Negative "-3 is negative.\n" +global Savedin uchar 2048 +fn test ok bool to void +check ok add get Checks 0 1 +end +fn load which ulong to void +if eq which 0 +put Inlen 0 len Fancy +for i ulong len Fancy +c = get Fancy i +if eq c 126 +c = uchar 13 +end +put In i c +end +end +if eq which 1 +put Inlen 0 len Private +for i ulong len Private +put In i get Private i +end +end +if eq which 2 +put Inlen 0 len Inline +for i ulong len Inline +put In i get Inline i +end +end +if eq which 3 +put Inlen 0 len Unclosed +for i ulong len Unclosed +put In i get Unclosed i +end +end +if eq which 4 +put Inlen 0 len Plain +for i ulong len Plain +put In i get Plain i +end +end +if eq which 5 +put Inlen 0 len Mixed +for i ulong len Mixed +put In i get Mixed i +end +end +if eq which 6 +put Inlen 0 len Invalid +for i ulong len Invalid +put In i get Invalid i +end +end +if eq which 7 +put Inlen 0 len Moodonly +for i ulong len Moodonly +put In i get Moodonly i +end +end +if eq which 8 +put Inlen 0 len Listmark +for i ulong len Listmark +put In i get Listmark i +end +end +end +fn main to int +load 0 +n = get Inlen 0 +for i ulong n +put Savedin i get In i +end +test scdecode +test eq get Sc 2 1 +test eq get Sc 3 1 +test eq get Things 0 1 +test eq get Things 1 2 +test eq get Things 4 1 +test gt get Nm 2 0 +test eq get Inlen 0 n +same = true +for i ulong n +if ne get In i get Savedin i +same = false +end +end +test same +same = true +for i ulong len Wanted +if ne get Stext add get Sw 3 i get Wanted i +same = false +end +end +test same +test eq get Stext add get Sw 3 len Wanted 0 +load 1 +test scdecode +test eq get Sc 2 1 +test eq get Sc 3 0 +test eq get Nm 3 3 +same = true +for i ulong len Vis +if ne get Stext add get Sw 3 i get Vis i +same = false +end +end +test same +test eq get Stext add get Sw 3 len Vis 0 +load 2 +test scdecode +test eq get Nm 3 1 +test eq get Stext get Sw 3 83 +load 3 +test not scdecode +test eq get Sc 2 0 +test eq get Sc 3 0 +test eq get Nm 0 1 +load 4 +test scdecode +test eq get Sc 2 1 +test eq get Sc 3 0 +same = true +for i ulong len Hello +if ne get Stext add get Sw 3 i get Hello i +same = false +end +end +test same +load 5 +test scdecode +test eq get Sc 2 0 +test eq get Sc 3 1 +load 6 +test not scdecode +test eq get Sc 2 0 +test eq get Sc 3 0 +load 7 +test scdecode +test eq get Sc 0 1 +test eq get Sc 1 2 +test eq get Sc 2 0 +load 8 +test scdecode +test eq get Things 1 1 +put Inlen 0 160 +for i ulong 160 +put In i 120 +end +test not scdecode +test eq get Sc 2 0 +put Inlen 0 159 +test scdecode +test eq get Sc 2 1 +test eq get Stext add get Sw 3 159 0 +put Inlen 0 2049 +test not scdecode +test eq get Nm 6 1 +test eq get Sc 2 0 +test eq get Sc 3 0 +load 4 +put In 2 0 +test not scdecode +test eq get Nm 6 1 +test eq get In 2 0 +put Inlen 0 0 +test not scdecode +test eq get Sc 2 0 +put Inlen 0 len Nested +for i ulong len Nested +put In i get Nested i +end +test scdecode +test eq get Stext get Sw 3 78 +put Inlen 0 len Negative +for i ulong len Negative +put In i get Negative i +end +test scdecode +test eq get Stext get Sw 3 45 +note A thirteenth line cannot enable mood or plain fallback after twelve refusals. +for k ulong 12 +for i ulong len Invalid +put In add mul k len Invalid i get Invalid i +end +end +n = mul 12 len Invalid +for i ulong len Moodonly +put In add n i get Moodonly i +end +put Inlen 0 add n len Moodonly +test not scdecode +test eq get Sc 0 0 +test eq get Sc 7 1 +for i ulong len Plain +put In add n i get Plain i +end +put Inlen 0 add n len Plain +test not scdecode +test eq get Sc 2 0 +ret int get Fails 0 +end diff --git a/native/omega/allen/tests/scene.om b/native/omega/allen/tests/scene.om new file mode 100644 index 00000000..7d76f2ec --- /dev/null +++ b/native/omega/allen/tests/scene.om @@ -0,0 +1,23 @@ +text Scenein "mood dawn lively\nsay Seventeen percent of 240 is 40.8.\nnumber right warm: 40.8 | 17% of 240\nnote left: How | 240 x 0.17 = 40.8\n" +fn main to int +put Inlen 0 len Scenein +for i ulong len Scenein +put In i get Scenein i +end +check scene 1001 +check eq get Sc 0 1 1002 +check eq get Sc 1 2 1003 +check eq get Sc 2 1 1004 +check eq get Sc 3 2 1005 +check eq get Sc 6 0 1006 +check eq get Things 0 3 1007 +check eq get Things 1 2 1008 +check eq get Things 4 1 1009 +check eq get Things 6 2 1010 +check eq get Things 16 1 1011 +check eq get Things 17 1 1012 +put Inlen 0 0 +check not scene 1013 +check eq get Sc 3 0 1014 +ret int get Fails 0 +end diff --git a/native/omega/allen/tests/scheduler.om b/native/omega/allen/tests/scheduler.om new file mode 100644 index 00000000..5b58fc69 --- /dev/null +++ b/native/omega/allen/tests/scheduler.om @@ -0,0 +1,258 @@ +note Native courier lifecycle regression. Clock values are injected milliseconds. +text Lineone "SAY 1 1/1 Model text." +note check writes through Outb; preserve the actual pending datagram around logging. +global SavedOut uchar 8192 +fn test ok bool to void +n = get Outlen 0 +e = get Err 0 +for i ulong n +put SavedOut i get Outb i +end +check ok add get Checks 0 1 +for i ulong n +put Outb i get SavedOut i +end +put Outlen 0 n +put Err 0 e +end +fn tcopy to void +put Inlen 0 get Outlen 0 +for i ulong get Outlen 0 +put In i get Outb i +end +end +fn control kind ulong seq ulong to void +put Inlen 0 0 +b = packet kind seq 0 0 0 +tcopy +end +fn linepkt part ulong to void +put Inlen 0 len Lineone +for i ulong len Lineone +put In i get Lineone i +end +b = packet 2 get Q 1 part 0 0 +tcopy +end +fn jobinput to void +put Inlen 0 1001 +for i ulong 1001 +put In i 120 +end +put In 999 10 +put In 1000 121 +end +fn main to int +test qstart 42 100 +test not qready 100 +test not qnext 100 false +test eq get T 3 0 +test qnext 100 true +test eq get T 10 5 +test not qnext 100 true +test qsent 100 false +test eq get T 3 0 +test qnext 101 true +test qsent 101 true +test eq get T 3 1 +test not qnext 2100 true +test qnext 2101 true +test qsent 2101 true +control 6 0 +test eq qincoming 2102 1 +test qready 2102 +test not qnext 12100 true +test qnext 12101 true +test eq get T 10 5 +test qsent 12101 true +test qready 32101 +test not qready 32102 +test qnext 32102 true +test qsent 32102 true +test not qnext 32101 true +test eq get T 0 32102 +jobinput +test qsubmit 32103 +test eq get Q 1 1 +test eq get JobOut 999 32 +test eq get JobOut 1000 121 +test not qsubmit 32103 +test qnext 32103 true +test eq get T 10 1 +test eq get T 11 1 +tcopy +test pkparse +test eq get N 6 1000 +test eq get In add get N 5 999 32 +test qsent 32103 false +test eq get T 9 1 +test qnext 32104 true +test eq get T 11 1 +test qsent 32104 true +test qnext 32104 true +test eq get T 11 2 +tcopy +test pkparse +test eq get N 6 1 +test eq get In get N 5 121 +test qsent 32104 true +test eq get T 9 0 +control 6 0 +test eq qincoming 32105 1 +test qready 32105 +test not qnext 34103 true +test qnext 34104 true +test eq get T 10 1 +test eq get T 11 1 +test qsent 34104 true +test qnext 34104 true +test eq get T 11 2 +test qsent 34104 true +control 4 2 +test eq qincoming 34105 0 +test eq get T 6 0 +control 4 1 +test eq qincoming 34105 1 +test eq get T 6 1 +test not qnext 36104 true +linepkt 1 +test eq qincoming 36105 1 +test eq get Q 4 1 +test eq get T 13 1 +test qnext 36105 true +test eq get T 10 3 +test qsent 36105 false +test eq get T 13 1 +linepkt 1 +test eq qincoming 36106 2 +test eq get Q 4 1 +test qnext 36106 true +test eq get T 10 3 +test qsent 36106 true +test eq get T 13 0 +test qtake +test eq get Inlen 0 len Lineone +test not qtake +linepkt 2 +test eq qincoming 36107 1 +linepkt 3 +test eq qincoming 36107 0 +test eq get Q 2 2 +test eq get Q 4 1 +test qnext 36108 true +test qsent 36108 true +linepkt 3 +test eq qincoming 36109 1 +test eq get Q 2 3 +qcancel +test eq get T 5 0 +linepkt 4 +test eq qincoming 36110 0 +jobinput +test qsubmit 36111 +test eq get Q 1 2 +test eq get Q 4 0 +control 6 0 +test eq qincoming 36112 1 +control 6 0 +put In 22 49 +test eq qincoming 36113 0 +test eq get T 2 36112 +control 4 2 +test eq qincoming 36110 0 +test eq get T 6 0 +qcancel +put Q 1 4294967295 +jobinput +test not qsubmit 36114 +test eq get Q 1 4294967295 +test not qstart 0 36114 +test eq get Q 0 42 +test qstart 43 0 +put Inlen 0 4097 +test not qsubmit 0 +test eq get Q 1 0 +put Inlen 0 0 +test not qsubmit 0 +test not qsent 0 true +note Maximum payload crosses all five datagrams, preserving every byte except CR/LF. +put Inlen 0 4096 +for i ulong 4096 +put In i uchar rem i 251 +end +test qsubmit 0 +test qnext 0 true +test eq get T 10 5 +test qsent 0 true +for k ulong 5 +test qnext 0 true +test eq get T 10 1 +tcopy +test pkparse +test eq get N 1 1 +test eq get N 2 add k 1 +test eq get N 3 5 +test eq get N 4 4096 +size = ulong 1000 +if eq k 4 +size = ulong 96 +end +test eq get N 6 size +bad = ulong 0 +for j ulong size +want = uchar rem add mul k 1000 j 251 +if or eq want 10 eq want 13 +want = uchar 32 +end +if ne get In add get N 5 j want +bad = add bad 1 +end +end +test eq bad 0 +test qsent 0 true +end +note A first LINE also stops job retries without a preceding ACK. +linepkt 1 +test eq qincoming 1 1 +test eq get T 6 1 +test qnext 1 true +test eq get T 10 3 +test qsent 1 true +control 6 0 +test eq qincoming 2 1 +test not qnext 2000 true +note Fill the eight-line queue; no GOT until a ninth line can actually be kept. +for k ulong 7 +linepkt add k 2 +test eq qincoming add k 2003 1 +test qnext add k 2003 true +test eq get T 10 3 +test qsent add k 2003 true +end +linepkt 9 +test eq qincoming 2010 0 +test eq get Q 2 8 +test eq get T 13 0 +test qtake +linepkt 9 +test eq qincoming 2011 1 +test eq get Q 2 9 +test qnext 2011 true +test not qsent 2010 true +test eq get T 10 3 +test qsent 2011 true +note Malformed ACK and wrong kinds cannot advance the accepted clock. +put Inlen 0 0 +b = packet 4 1 1 0 0 +tcopy +test eq qincoming 2012 0 +test eq get T 0 2011 +control 5 0 +test eq qincoming 2012 0 +test eq get T 0 2011 +qcancel +control 4 1 +test eq qincoming 2013 0 +test eq get Q 4 0 +ret int get Fails 0 +end diff --git a/native/omega/allen/tests/stdio-overflow.om b/native/omega/allen/tests/stdio-overflow.om new file mode 100644 index 00000000..aea8394e --- /dev/null +++ b/native/omega/allen/tests/stdio-overflow.om @@ -0,0 +1,30 @@ +note Regression input for L719: one over-capacity command then a valid one. +note The standalone Allen program must refuse with65, never emit the later JOB. +global Huge uchar 8193 +text Suffix "\nASK hi\n" +fn main to int +for i ulong len Huge +put Huge i 120 +end +put Huge 0 65 +put Huge 1 83 +put Huge 2 75 +put Huge 3 32 +sent = ulong 0 +while lt sent len Huge +n = write 1 Huge sent sub len Huge sent +if le n 0 +ret 2 +end +sent = add sent ulong n +end +sent = ulong 0 +while lt sent len Suffix +n = write 1 Suffix sent sub len Suffix sent +if le n 0 +ret 2 +end +sent = add sent ulong n +end +ret 0 +end diff --git a/native/omega/allen/tests/surface-mutants.om b/native/omega/allen/tests/surface-mutants.om new file mode 100644 index 00000000..ff71b1e5 --- /dev/null +++ b/native/omega/allen/tests/surface-mutants.om @@ -0,0 +1,101 @@ +note Native exact-line mutant construction; selector0 remove-right-clip,1 wrong-destination-blend. +global Mutbuf uchar 262144 +global Mutrep uchar 128 +global Mutmode uchar 1 +text Mutold0 "\nif ge x long add get Cvs 4 get Cvs 6\n" +text Mutnew0 "\nif false\n" +text Mutold1 "\nd = ulong get Nfrm at\n" +text Mutnew1 "\nd = ulong 395282\n" +fn mutmatch at ulong mode uchar to bool +if eq mode 48 +for i ulong len Mutold0 +if ne get Mutbuf add at i get Mutold0 i +ret false +end +end +else +for i ulong len Mutold1 +if ne get Mutbuf add at i get Mutold1 i +ret false +end +end +end +ret true +end +fn mutwrite at ulong size ulong to bool +p = ulong 0 +while lt p size +n = write 1 Mutbuf add at p sub size p +if le n 0 +ret false +end +p = add p ulong n +end +ret true +end +fn mutout n ulong mode uchar to int +old = len Mutold0 +size = len Mutnew0 +if eq mode 49 +old = len Mutold1 +size = len Mutnew1 +end +if lt n old +ret 65 +end +found = ulong 0 +at = ulong 0 +for i ulong add sub n old 1 +if mutmatch i mode +found = add found 1 +at = i +end +end +if ne found 1 +ret 65 +end +for i ulong size +if eq mode 48 +put Mutrep i get Mutnew0 i +else +put Mutrep i get Mutnew1 i +end +end +if not mutwrite 0 at +ret 74 +end +p = ulong 0 +while lt p size +r = write 1 Mutrep p sub size p +if le r 0 +ret 74 +end +p = add p ulong r +end +if not mutwrite add at old sub n add at old +ret 74 +end +ret 0 +end +fn main to int +r = read 0 Mutmode 0 1 +if ne r 1 +ret 65 +end +mode = get Mutmode 0 +if and ne mode 48 ne mode 49 +ret 65 +end +n = ulong 0 +while lt n len Mutbuf +r = read 0 Mutbuf n sub len Mutbuf n +if lt r 0 +ret 74 +end +if eq r 0 +ret mutout n mode +end +n = add n ulong r +end +ret 65 +end diff --git a/native/omega/allen/tests/surface-render.om b/native/omega/allen/tests/surface-render.om new file mode 100644 index 00000000..0f2215c6 --- /dev/null +++ b/native/omega/allen/tests/surface-render.om @@ -0,0 +1,128 @@ +note Native provider-to-pixels fixture. Reply is a labeled test input, not live inference. +note The surface draws into the native frame Nfrm; the frame is 768 x 384 (scale 1) over night. +text Cvppm "P6\n768 384\n255\n" +text Cvask "hello" +text Cvanswer "SAY 1 1/1 note: Hello, Drake. | This text was drawn in Omega." +global Svrow uchar 2304 +fn svnight to void +put Lg 0 768 +put Lg 1 384 +for i ulong 294912 +put Nfrm i 395282 +end +end +fn svrow y ulong to bool +for x ulong 768 +v = ulong get Nfrm add mul y 768 x +put Svrow mul x 3 uchar and shr v 16 255 +put Svrow add mul x 3 1 uchar and shr v 8 255 +put Svrow add mul x 3 2 uchar and v 255 +end +p = ulong 0 +while lt p 2304 +n = write 1 Svrow p sub 2304 p +if le n 0 +ret false +end +p = add p ulong n +end +ret true +end +fn svword off ulong v ulong to void +for i ulong 8 +put Ph add off i uchar and shr v mul i 8 255 +end +end +fn svframe op ulong now ulong arg ulong size ulong to void +for i ulong 8 +put Ph i get Prmagic i +end +svword 8 op +svword 16 now +svword 24 arg +svword 32 size +end +fn svsize beg ulong to ulong +if ge beg len Dtext +ret 0 +end +n = ulong 0 +while lt add beg n len Dtext +if eq get Dtext add beg n 0 +ret n +end +n = add n 1 +end +ret 0 +end +fn svout to bool +p = ulong 0 +while lt p len Cvppm +n = write 1 Cvppm p sub len Cvppm p +if le n 0 +ret false +end +p = add p ulong n +end +for y ulong 384 +if not svrow y +ret false +end +end +ret true +end +fn main to int +svframe 1 0 77 0 +if not prdo +ret 1 +end +for i ulong len Cvask +put Pb i get Cvask i +end +svframe 2 1 0 len Cvask +if not prdo +ret 2 +end +for i ulong len Cvanswer +put In i get Cvanswer i +end +put Inlen 0 len Cvanswer +if not packet 2 get Q 1 1 0 0 +ret 3 +end +for i ulong get Outlen 0 +put Pb i get Outb i +end +svframe 5 2 0 get Outlen 0 +if not prdo +ret 4 +end +if or ne get Dm 0 1 ne get Ds 3 1 +ret 5 +end +if or ne get Dt 0 1 ne get Dt 6 2 +ret 6 +end +svnight +if not cvinit 768 384 +ret 7 +end +if not afinit 30 1250 +ret 8 +end +a = get Dt 7 +if not cvspan a svsize a 48 166 15528188 +ret 9 +end +if not afinit 18 900 +ret 10 +end +a = get Dt 8 +if not cvspan a svsize a 48 210 13161215 +ret 11 +end +if not svout +ret 74 +end +ret 0 +end diff --git a/native/omega/allen/tests/surface.om b/native/omega/allen/tests/surface.om new file mode 100644 index 00000000..2b62c3ca --- /dev/null +++ b/native/omega/allen/tests/surface.om @@ -0,0 +1,309 @@ +note Surface tests: removing clipping, using constant background or bypassing drawing must fail. +note The surface draws packed 0x00RRGGBB words into the native frame Nfrm (look-paint.om) with +note Lg 0..1 as the native size. A 32 x 32 native frame gives scale 1 and no offset, so the +note logical geometry equals the former Canvas tests; 70 x 66 and 3840 x 2160 check the scale. +global Csave uint 1024 +global Cmeta ulong 16 +const CNIGHT ulong 395282 +fn test ok bool to void +check ok add get Checks 0 1 +end +fn cvframe w ulong h ulong to void +note The native size and the night background the look leaves; one sentinel word past it. +put Lg 0 long w +put Lg 1 long h +for i ulong mul w h +put Nfrm i uint CNIGHT +end +put Nfrm mul w h 0 +end +fn cvat x ulong y ulong to ulong +ret ulong get Nfrm add mul y 32 x +end +fn cvkeep to void +for i ulong 1024 +put Csave i get Nfrm i +end +for i ulong 8 +put Cmeta i get Cv i +put Cmeta add i 8 get Cvs i +end +end +fn cvsame to bool +for i ulong 1024 +if ne get Nfrm i get Csave i +ret false +end +end +for i ulong 8 +if ne get Cv i get Cmeta i +ret false +end +if ne get Cvs i get Cmeta add i 8 +ret false +end +end +ret true +end +fn cvink to ulong +ink = ulong 0 +for i ulong 1024 +if ne ulong get Nfrm i CNIGHT +ink = add ink 1 +end +end +ret ink +end +fn cvrefclip to bool +ink = ulong 0 +for y ulong 32 +for x ulong 32 +at = add mul y 32 x +inside = and ge x 8 lt x 16 +inside = and inside and ge y 8 lt y 16 +v = ulong get Nfrm at +if inside +if ne v ulong get Csave at +ret false +end +if ne v CNIGHT +ink = add ink 1 +end +else +if ne v CNIGHT +ret false +end +end +end +end +ret gt ink 0 +end +fn cvfrac to bool +cvframe 32 32 +b = cvinit 32 32 +b = afinit 14 900 +for i ulong 3 +put Dtext i 65 +end +if not cvspan 0 3 -1 20 15528188 +ret false +end +one = get Af 5 +if ne get Cv 7 mul one 3 +ret false +end +cvkeep +cvframe 32 32 +b = cvinit 32 32 +for i ulong 3 +x = affloor add long -256 long mul one i +if not cvglyph 65 x 20 15528188 +ret false +end +end +for i ulong 1024 +if ne get Nfrm i get Csave i +ret false +end +end +ret true +end +fn cvfills to void +note A logical fill blends from the current pixel, clamps alpha, refuses an oversized rectangle +note and stays inside the clip. +cvframe 32 32 +test cvinit 32 32 +cvfill 1 1 2 2 15528188 128 +test eq cvat 1 1 7961735 +test eq cvat 2 2 7961735 +test eq cvat 0 0 CNIGHT +test eq cvat 3 3 CNIGHT +test eq cvat 1 3 CNIGHT +test eq cvat 3 1 CNIGHT +cvfill 1 1 2 2 15528188 128 +test eq cvat 1 1 11712193 +cvfill 1 1 2 2 0 999 +test eq cvat 2 2 0 +cvfill 31 0 2 1 15528188 255 +test eq cvat 31 0 CNIGHT +test cvclip 8 8 8 8 +cvfill 0 0 32 32 15528188 255 +test eq cvat 7 7 CNIGHT +test eq cvat 8 8 15528188 +test eq cvat 15 15 15528188 +test eq cvat 16 16 CNIGHT +end +fn cvscale to void +note 70 x 66 native pixels hold the 32 x 32 surface at scale 2, centred at (3, 1). +cvframe 70 66 +test cvinit 32 32 +test eq get Cvs 0 2 +test eq get Cvs 2 3 +test eq get Cvs 3 1 +test eq get Cvs 4 3 +test eq get Cvs 5 1 +test eq get Cvs 6 64 +test eq get Cvs 7 64 +cvfill 0 0 1 1 15528188 255 +test eq get Nfrm 73 15528188 +test eq get Nfrm 74 15528188 +test eq get Nfrm 143 15528188 +test eq get Nfrm 144 15528188 +test eq ulong get Nfrm 72 CNIGHT +test eq ulong get Nfrm 75 CNIGHT +test eq ulong get Nfrm 3 CNIGHT +test eq ulong get Nfrm 213 CNIGHT +test cvfont 10 900 +test eq get Cvs 1 10 +cvpixel 2 0 255 0 +test eq ulong get Nfrm 2 CNIGHT +cvpixel 3 1 255 0 +test eq get Nfrm 73 0 +put Lg 0 3840 +put Lg 1 2160 +test cvinit 768 384 +test eq get Cv 0 768 +test eq get Cv 1 384 +test eq get Cvs 0 5 +test eq get Cvs 2 0 +test eq get Cvs 3 120 +test eq get Cvs 6 3840 +test eq get Cvs 7 1920 +end +fn main to int +test not cvglyph 65 0 0 15528188 +test not cvinit 0 32 +test not cvinit 32 0 +test not cvinit 769 32 +test not cvinit 32 385 +cvframe 32 32 +test cvinit 32 32 +test eq get Cv 0 32 +test eq get Cv 1 32 +test eq get Cv 4 32 +test eq get Cv 5 32 +test eq get Cvs 0 1 +test eq get Cvs 2 0 +test eq get Cvs 3 0 +test eq get Cvs 6 32 +test eq get Cvs 7 32 +test eq cvat 0 0 CNIGHT +test eq cvat 31 31 CNIGHT +test eq get Nfrm 1024 0 +test not cvglyph 65 0 0 15528188 +test afinit 20 1000 +note Exact alpha arithmetic and repeated overlap must use current destination. +cvpixel 0 0 0 15528188 +test eq cvat 0 0 CNIGHT +cvpixel 0 0 128 15528188 +test eq cvat 0 0 7961735 +cvpixel 0 0 128 15528188 +test eq cvat 0 0 11712193 +cvpixel 0 0 255 15528188 +test eq cvat 0 0 15528188 +cvkeep +cvpixel -1 0 255 0 +cvpixel 0 -1 255 0 +cvpixel 32 0 255 0 +cvpixel 0 32 255 0 +test cvsame +test not cvinit 18446744073709551615 1 +test cvsame +test not cvclip 33 0 0 0 +test not cvclip 0 33 0 0 +test not cvclip 0 0 33 1 +test not cvclip 0 0 1 33 +test not cvclip 1 1 18446744073709551615 1 +test cvsame +test not cvglyph 65 -4097 0 15528188 +test not cvglyph 65 4097 0 15528188 +test not cvglyph 65 0 -4097 15528188 +test not cvglyph 65 0 4097 15528188 +test not cvglyph 65 0 0 16777216 +test cvsame +note Independent reference crop of the already rendered glyph. +cvframe 32 32 +test cvinit 32 32 +test cvglyph 65 4 24 15528188 +test gt get Cv 7 0 +cvkeep +cvframe 32 32 +test cvinit 32 32 +test cvclip 8 8 8 8 +put Nfrm 1024 165 +test cvglyph 65 4 24 15528188 +test cvrefclip +test eq get Nfrm 1024 165 +note Zero-area and edge clips cannot draw any pixel. +cvframe 32 32 +test cvinit 32 32 +test cvclip 32 32 0 0 +cvkeep +test cvglyph 65 -8 6 15528188 +put Cmeta 7 get Cv 7 +test cvsame +note A negative origin that intersects the surface must draw without wrapping. +test cvclip 0 0 32 32 +test cvglyph 65 -8 6 15528188 +test gt cvink 0 +test eq get Nfrm 1024 0 +note Explicit retained-text span agrees with two separately positioned glyphs. +put Dtext 0 65 +put Dtext 1 65 +cvframe 32 32 +test cvinit 32 32 +put Outb 0 88 +put Outlen 0 1 +put Err 0 7 +put In 8191 99 +ok = cvspan 0 2 1 24 15528188 +clean = and eq get Outb 0 88 eq get Outlen 0 1 +clean = and clean eq get Err 0 7 +test ok +test clean +test eq get In 8191 99 +advance = get Cv 7 +cvkeep +cvframe 32 32 +test cvinit 32 32 +test cvglyph 65 1 24 15528188 +one = get Cv 7 +x = add long 1 long div one 256 +test cvglyph 65 x 24 15528188 +test eq advance mul one 2 +same = true +for i ulong 1024 +if ne get Nfrm i get Csave i +same = false +end +end +test same +note Refused spans and extreme offsets preserve pixels and all surface metadata. +cvkeep +test not cvspan 2305 0 0 0 0 +test not cvspan 2304 1 0 0 0 +test not cvspan 1 18446744073709551615 0 0 0 +test not cvspan 0 1 0 0 18446744073709551615 +test not cvspan 0 1 -4097 0 0 +test cvsame +test cvspan 2304 0 0 0 0 +test eq get Cv 7 0 +test eq get Dtext 0 65 +test eq get Dtext 1 65 +test cvfrac +for i ulong 2304 +put Dtext i 65 +end +cvframe 32 32 +test cvinit 32 32 +cvkeep +test cvspan 0 2304 4096 0 15528188 +put Cmeta 7 get Cv 7 +test cvsame +cvfills +cvscale +if ne get Fails 0 0 +ret 1 +end +ret 0 +end diff --git a/native/omega/allen/tests/tls-cert-ecdsa.om b/native/omega/allen/tests/tls-cert-ecdsa.om new file mode 100644 index 00000000..2f7df904 --- /dev/null +++ b/native/omega/allen/tests/tls-cert-ecdsa.om @@ -0,0 +1,363 @@ +note Independent ECDSA oracle vectors for tls-p384.om and vendor/cert-p256.om. +note Build: base.om vendor/sha256-core.om vendor/cert-sha384.om vendor/cert-p256.om tls-p384.om tests/check.om tests/tls-cert-ecdsa.om +note Generated 2026-10-25 with OpenSSL: throwaway test-only keys from openssl ecparam -genkey (secp384r1, prime256v1), +note signatures from openssl dgst -sha384/-sha256 -sign, each accepted by openssl dgst -verify before embedding. +note Message lengths 0,1,55,111,112,127,128,129,239,1000 cross SHA-256/SHA-384 padding boundaries. No private key here. +note Record: public key 04||X||Y, r, s, n-s, message. +text Vdat "049d3c71fa72bbd145db340ad61901cc6c0f25df1ffccc232f72ae87e0789e0dba5b91da59058647da8c393c85f78f951014985f2b4b6f6f9ffe779a2fbe6049b2d3446f16be71f4e6b2f269442db381f0956ccafb68d842234cb561599ecc2b39ea0bac594b9669a2fcba7669d49f101774555c17588996f9d43072fe445e89435ad35890f9ec3323cf718b4f26effc4ac2c068608e658a9b9938e8077ae2a55079b82233c3f67dcb06d385edfe85c17faf3005254c98bbc4c42d2ca08516334b3d3f979f719a756466c717f8851d5aaf8647ddcc3c098234c08fc793f5b16c5fa8ea088cfc17ebb628beecca47aef628049d3c71fa72bbd145db340ad61901cc6c0f25df1ffccc232f72ae87e0789e0dba5b91da59058647da8c393c85f78f951014985f2b4b6f6f9ffe779a2fbe6049b2d3446f16be71f4e6b2f269442db381f0956ccafb68d842234cb561599ecc2b394cdb70bf5430717f8abd153e1bf2101c3ce0fdf4f9305d036541d9742085f0e7923df571a44d46fb1d3ba49f911d0b5b92e94c46c65ce95cc613d15f01988d6c40225eaa6a266b6a007cee9a410dc97f98ad9495fdd65b2916e525273fd02e9c6d16b3b939a316a339ec2ea0fe677293bfdda15595d99495c6e65ee7b329645fbf6c791c4ada4c51d606f4438cf4fad7c4049d3c71fa72bbd145db340ad61901cc6c0f25df1ffccc232f72ae87e0789e0dba5b91da59058647da8c393c85f78f951014985f2b4b6f6f9ffe779a2fbe6049b2d3446f16be71f4e6b2f269442db381f0956ccafb68d842234cb561599ecc2b392e6eea36b7787796341a1740f84c7cf61abaa5a38488a4fc8d69f70c708f1b37a2c1ca18face18b990e52551db380c94a76d4454606cde128a8c46edd9b383c528c888658f169ce0acd421d7995a3f14c994066f024ac889a5a998750e80875e5892bbab9f9321ed7573b912264c7c3ad737779a70e9631f1a8f2baa5adceeca8e8607434665def1474280f5be44a215180cbf7ce07e3f77c2911c45c9e45d91dccafcf8cedecf8e8166965fff5ae5e376aaebca8a9d19980ced83a75079760edd2801863dca52049d3c71fa72bbd145db340ad61901cc6c0f25df1ffccc232f72ae87e0789e0dba5b91da59058647da8c393c85f78f951014985f2b4b6f6f9ffe779a2fbe6049b2d3446f16be71f4e6b2f269442db381f0956ccafb68d842234cb561599ecc2b395bfdec8559d052174b81c01adf8de3855e296b4a5acb78bfbd7abf78d7a383d7fd005431c1691fe26e14653d3a60082445b6a7cecc46d18650c5941a0b1dd8064b693372b0d3b8696ebb46589b0fe1546a13e7388b638fcf4fab6beb711b1bebba49583133b92e79af3a6be5f4e227f9b496cc8d4f2c479658a8072959274c8aee062679bd4d17ab9d40ad7f5baa0d88ad8d84bbb956ef82687f39e40791631f673d73a6cacca625b94018a6312d8a107891973582594e98ac6ccc35fe68b175fbf101dba13e32fe673c39315483d0d6b8fe663c458195328ec9884ab686570391c878a68f0f943c2e90789ceb03cad05dd3050d08dda330a75ca588c7e1b5049d3c71fa72bbd145db340ad61901cc6c0f25df1ffccc232f72ae87e0789e0dba5b91da59058647da8c393c85f78f951014985f2b4b6f6f9ffe779a2fbe6049b2d3446f16be71f4e6b2f269442db381f0956ccafb68d842234cb561599ecc2b39b053ab2406d5a9de9b7a1d15f4d353cf205b6bce3d25c0db3848af6b53bb3eb2880762e070f1fe091b56ba3daf841f3d0f7777bd8ba69dcbaad93012b05083346a42a0cbff4bbb0c37caf2da717e261afd960fc1b170807aba50e80749ec563cf0888842745962345526cfed4faf7ccb95bd5f3400b444f38f985aa782b907c45a83fdf097402700329b316382d8d337ccdc59eb1dbe7e916be7c8e098f5eab587fcccad113b436a18c32feb6869b8ac3bbe203e72ee660a8fd7b29bb475189f7dc7e44a5cfed5ae22ed65b32ea8079e6e194514cc371a9768fa9bb3c2cc1b17609c28db59d8bd16cc2ebb2d653bca177461156a49fee0bf48827ee89d56a45b049d3c71fa72bbd145db340ad61901cc6c0f25df1ffccc232f72ae87e0789e0dba5b91da59058647da8c393c85f78f951014985f2b4b6f6f9ffe779a2fbe6049b2d3446f16be71f4e6b2f269442db381f0956ccafb68d842234cb561599ecc2b396c76e957b3ac1e3200f5edc3424b5dca14ff00cceacf4f4c00edc73ca6f72a7eb1477a207a3f12a7f28ad32426a200d29863d44bf5b0ae1f4cb302b1f4b7fdb4c8c28397d7bc622376be9971b6b3c30edfa67350633aa045ebebed511128e168679c2bb40a4f51e0b34cfd4e0b48024b373d7c6828439ddc50a4b4103d836ad078739a61e576073501002c19bb9c480b24886017b27e281a797cf60450c0108dd8b515317ab46ef87cf799e5916be9ed88ac0e69fc43eea30700ee10b787b8fd50b8d1c31c219ae61483a6323871eaa2d01de2bf9e62031de5c2df3219f9d4154909a37c3578ea54503609aa59f1f397f2ecb9e83f6f634ffc74685ac6dd7803c24b3d8beed21c3a8bbddfdc79d843049d3c71fa72bbd145db340ad61901cc6c0f25df1ffccc232f72ae87e0789e0dba5b91da59058647da8c393c85f78f951014985f2b4b6f6f9ffe779a2fbe6049b2d3446f16be71f4e6b2f269442db381f0956ccafb68d842234cb561599ecc2b39af66a8461b836e81fe90434a8fcb88f463f07d647c04dd7123e404ae801109e7cd07c12cdab8ffdc1b4e96fcb7ed92bad7178920e601446cdb6c96bff077e702fc1124dd6c029dcb737835dbbc2d9e2a541b958a8c9d617baa5008ba1b552ddc28e876df19febb93249369400f8818fd03eedb2293fd623453eb17a638098fb503fe7827bc1345ff429c10b0b16ffb97bf28a7dc1f80f8520507fb8d339deefdd5ce6d784a8d7d2799641c7e78df0c58585c0bb183bb54c9a24d5fdb9c0b9e5d3d55f5b11a6e992f2a4f88de399febb5afc7e0e6c0c63b68b3838935485cb77ceb01bcc79fa0eca9232a98fde65c7582d4217c24b5c45cd0b63204c7a651dbed2bbf43cf489627d5175d0bf70d109c4b049d3c71fa72bbd145db340ad61901cc6c0f25df1ffccc232f72ae87e0789e0dba5b91da59058647da8c393c85f78f951014985f2b4b6f6f9ffe779a2fbe6049b2d3446f16be71f4e6b2f269442db381f0956ccafb68d842234cb561599ecc2b39980a4d9bd3d8f0e9b25f9185507293e3adf8532023765e584ead8a8ca70fcf49fdaed3763ab455c2214e803a58062e4338be685831793303f36deb483a7f591bcef25afc783dd2f35045a2cf0a4e7fcb45212c72e6b3b04eeb2ab8a8eeb5f792c74197a7ce86ccfc0c9214b7c580a6e4310da50387c22d0c771daab2e9e8ae1412f8e13f61fcf72c01c160c1de0f31e1714e7c90b7557ae432d456b07aebc401e9ec0fca38313d70a1fb371edf93b8f79e5ae9b642d73917ef784bea13314ea74990e446bb1ce36ca9c1ed66528130a1683f3a3f0ee487d52930ce90930e18bd686d8767d4ffdf21f03e53fdefadc9bf5796dc0a18409b5b833497f0da2d988a07a55089a788eeb10a42700c327f43fcd4049d3c71fa72bbd145db340ad61901cc6c0f25df1ffccc232f72ae87e0789e0dba5b91da59058647da8c393c85f78f951014985f2b4b6f6f9ffe779a2fbe6049b2d3446f16be71f4e6b2f269442db381f0956ccafb68d842234cb561599ecc2b39d8bcb2a6ffc5a44de1d01861f7a0010c3fdbd4854ad8c3d113ae8073a0904db119a0e44dcc4f02049680478d0750a34b96aa4eea05d568a77243187b26daf3556782953d5a939e5c18e80c8ed336b388b09266317e85b6a6abd1e7f6a217253b6955b115fa2a97588dbce784d9250caa987d6ac2a56c61a3ae7b40f321007a56a787a780ca2af0d4411a31742aae043898576156838bdcd99d34a809bb2cd5b79cda357a0f7df1181a8ee33d7f9cfb7ed1af17d7db9cb54b09ca5115aab81173a057e6aa628cedf3c013581b30f4dd863c6d6db838767248139616d41c614a7abbe20d0784a6972c6fc8ca56e9f4f12cb7b376fac9e9e60d6883918bd0766636666cce573f9b556a0bdc29bd3b96dca8ce939c3284a3fdd1fb80f33ff610f2405d9548d1de4614063b454a0e5b3128cec315b1d1ca44c244c80bd80e80f0dce3947e5eb4438506b5185d987adf415ecbefa758137d05bb6492b991fa216361f58e15dd90b0e8641f35307ab674b67c90e8e5c1cbc00285deb9e6e79832fe23049d3c71fa72bbd145db340ad61901cc6c0f25df1ffccc232f72ae87e0789e0dba5b91da59058647da8c393c85f78f951014985f2b4b6f6f9ffe779a2fbe6049b2d3446f16be71f4e6b2f269442db381f0956ccafb68d842234cb561599ecc2b3960351c3697ffadea10098f2dcabd554fe2c7d3019c525fa641b93bfb1ea7ed060ac5547d1c52ade9e5c32212d931e8421de9f9e6001065f169bf4c784fbfdc37a4177ae99e01b135d94d931be93211c5cfe06637fc2e9bdcaa3443bcf59bb763e2160619ffef9a0e9640b387b04023c85be8851661fe4ec9ee15ba660b051c198839a77a4c820b9e42b7d5add7297210be8e52c2f3c0bd0c2b6074d332160fdfa13dc09f82ee1fbef2920715a2eb2abc80bc9ba4c809744d1a9ad979b1b096384b8c352e726a4a75a42fb7057f2c11e74a0c8cf016037bf0028bdcfdebd3e140c57ee56593e7e876bd343653164434212fe9b4e5727873192a821fcde39b7866d2e1cc3752ff24361b661819e1708a24f026bb6aaf95932071c47621cd3b617cd7dc7521a77d46928ff0f8d1adc5e9b9cdc4f6988ff58feb7190799a6d00819fd4ee17230aa671d06fd13bbffb8dd7bb5dc41d5484c84405f7f189967205e7c3272bfe74dbbe935e5fdd9fe9088182f6638a53b093fc704889d4a519a8145729da3f35985114fa14271d9e013a8dd3bd9ad720d3e875a4507257374b697ca70a4fdedb7f38bf1d9222e24d12fb18fc0814085105f97fecd584973de147bc0ca737977fb4b1f5a46de63a2b41d136699ce9e0b0dcb3003a0f940000d467f2050752ffb45f0f22ce82642e49ddcc3c45207780d7428ac708707b1d5873fb64cfac286ef907880b6a048c085068acc0ea9fdb9bf2653548d0bf35a74ed0e43b5e74d2543c4fbb7fff85860b5bc6678409dc6240124e1e85d4132ea4ecf877517f18e209c81bfb510695fe11b641dd64b94dbf0403762a057446365443776104a7f76e60fd9408099a45a4036b62a8a96f2061fed69036187e7b5584d2c8b2daa51fbdaf38fbb21a8e47138de4156d7dfae91c88831da105d070c0320357c9cab1cdb7c1f24815570aa8b2b6f48d1b44652c89baf2dc9b3e1d01a635e79178dcf5a9ab5980478dbd9e76fb9e55f30f62d9dc5f0a1b2a2e30458fcbfce5eae2653b86ad0a3cd91850838fae1b46cb62335e5493b7e2ce3ac11fb64f1f86a9aa318e444a0b5222c8c89da4bbdbb38a7a4df565db9057bf741be13d48efbede9639dbd993d8718f053a011f0ef8308f9c95f899cddebaf96c31408dd153607e97156504a03c734cf25e0b631fecdd10eed9c70346a28bd7847719fe6972d48bdde445d8579a6b1a1ed8e06f3633290d33cf6d7032d14ae1cc844215cc694f775dc7c91b6ab212dc78b4c22a2651086279fe8e6b95882b00b412978c37fd4221c63a136950cdfdc9f2539fdcad02c50e4e0b1ebb6cf733a4f97ebf714832d9f7e755268f826d99eef8eb23b9da0ba9521aae717222594f4c8e1f2f289eba6843ea252bde9dd4702ec6f52686154a9f6ffce0f6edead159b2eaeb02142c7c17fb10178f5404ab32f60893d3fc734fa2a4d3b914a63d63026d4452ff4ede6cbe1adce4db773307f194b429dcfb6400a4559a7437b77232f0e7bc1b21c6e97c4a05acc80ee71694b020d3041cb5656946ea0b73fb841d342d7f926ccaa6ac5022bb839bd973a24c25aea76ce163abf77ad0a54354c2db7490456a552e6a046d496c6cfc0f91a8a3e2518db8a0b17215fce3a9563fa0437d6466e9dc5d59ee7802caa677a8770d99c1d74e174b9abb234060251d590ca2ae5c81ed495bf3542b1645a1d07c80ec49a2f3e8b0ec6019c6a0787b6b98f9e133fab07028919d875b18a395fc88f2d7360be036dc9f7749a7371280ea84561674e20dad37cd990fa4e75c6903770d29c9f41fc9236088b615afe82cbc93486e7ed7bd15c4958c42046d496c6cfc0f91a8a3e2518db8a0b17215fce3a9563fa0437d6466e9dc5d59ee7802caa677a8770d99c1d74e174b9abb234060251d590ca2ae5c81ed495bf35486809306e59dd3858abd5dc17a645773aefa7eb7348a7df8bba5670a63b6dc73b4cd89233e93f39aea5a3f1690f03e15965a913b45fc360d8936d4e844f85fcb4b3276dbc16c0c6615a5c0e96f0fc1ea268c6972611b68776a82f5dab76ac586fa046d496c6cfc0f91a8a3e2518db8a0b17215fce3a9563fa0437d6466e9dc5d59ee7802caa677a8770d99c1d74e174b9abb234060251d590ca2ae5c81ed495bf354125a38862aa393c9ad9de110b0f8a75bfef7f3fca5a52fd534932a186de678b65f627b487369fd347a71bde86363d1d435552e5e0986e9fe8ea5039474ac3273a09d84b68c9602cc858e42179c9c2e2b8791cc4f9d90b4866514c72e87b6f2de9eddbbc014eadd7c5893a3a5a82993528b19ef11ce6e480c85056144d8bcbae490f427529f82ce723adb0720b115548c3a006f6b75cf7e046d496c6cfc0f91a8a3e2518db8a0b17215fce3a9563fa0437d6466e9dc5d59ee7802caa677a8770d99c1d74e174b9abb234060251d590ca2ae5c81ed495bf354b00c789a66a14299d11533cecf63a703057536c5c4646ce59e9c8e0c16aa1fa4480d516ccc4a2595d592e2bfeca0de1c0384df3d3404a35ae27c1f2d66f2deb1b7f2ae9233b5da6b2a6d1d40135f21e3b9621b707312fb2a113dab95957046a0e163a4db18f697b9f90be2ec01bef4e0090ac537c677048f7423093b5637978284086e9370d933467ee162c6afd176be1db9b9fd8061d3f31a0737f19a7cb2a610ef855352697af52f4c414a7e555705f261807418f09d354a174155a80195a3126efed1edf6733632755c7caf0fd5046d496c6cfc0f91a8a3e2518db8a0b17215fce3a9563fa0437d6466e9dc5d59ee7802caa677a8770d99c1d74e174b9abb234060251d590ca2ae5c81ed495bf354970eae111f406bb063265ba8d57641d29314df43c8335996334655a93a3620bf183fa8cc7347674d445904706b4d34aa9fe41f35ec72d86df7ae67ec48352f4ae7c057328cb898b3bba6fb8f94b2cb551d02db77baa4c616fc0b62d6b42df607329b92eb3def931709ef480ea7cc5c54c6b1c8fe15b664cbdcdb1271d5d34c492d12640034df91864ec501fcdd9aa7f73eaeea19464361e67b48357dbfc2131fa85b69d2a5f7f8f07164123998ad0f843085955bd489fc46ae01e2ad521bdede7b19903e96c5f7bb8d53b976749cd829046d496c6cfc0f91a8a3e2518db8a0b17215fce3a9563fa0437d6466e9dc5d59ee7802caa677a8770d99c1d74e174b9abb234060251d590ca2ae5c81ed495bf3540f6142a00b254522602565ff0c0e02fb7646655c145e7d4d408866e9422f0d5d9fdea626afdb6902cb9356ef5ca31acbfb607dbe5a57422beb5d0033dbc11136602159d8502496fe346ca910a35ce533c1867cef4cc05c59085cca8f20a2141b238f121d7d1645eb922bf7bb04a6cc98240ffad65e9d3a8d6640dcd45a99d26759243c1e1b74ff7fdc14a0e51f6925a9ec581ccba3d6ee511da56ba946cb867ec63e3cf677321d8ac59340cfdf1e5defd48542241c195f4fd8b44e9020f01aefad37a502a2b2be27b2596da75bc8dfa8b404015c5ea9d07f01089cbf56b8c5046d496c6cfc0f91a8a3e2518db8a0b17215fce3a9563fa0437d6466e9dc5d59ee7802caa677a8770d99c1d74e174b9abb234060251d590ca2ae5c81ed495bf3549accbc84cdf3c5b13171080f810c4d458df84255f9a4bc915b3ab3acb7d1708240898471e8465a42d9d6761ec4772f018dbb02f1108247bc0af5b96ab527ae0ebf767b8d17b9a5be262989e13b88d0fe2f2bf7bc969556c8e8c41158473b77433c2c87762bb5707281ade2ca67ed5c91a6185c955eae5328b504086b95a1e53272bea6245337af363c79ebaa457c5ef552af4dee7ac687ef9ded79ba590790406f154e8a5566999e304de802db662d9e1b327b63539544956ad6b97aab76a3bd9dab1828e798e72b5dc24e929f5e5e6f01065d84c1c130172850bf2cce01540e046d496c6cfc0f91a8a3e2518db8a0b17215fce3a9563fa0437d6466e9dc5d59ee7802caa677a8770d99c1d74e174b9abb234060251d590ca2ae5c81ed495bf3540fb116a703212a4795cc967502075aeb25a013b431f72565c6bb15cd8aee62892591cae870b97eb3dce0694d2a2a35136b3acebc11b2f38274bdd81d511c0d0eda6e35168f46814d231f96b2d5d5caec51ac2bf19564ab027efbf2a5ab471843eeb98657f8b8d3152d02f299885f7c86c8a1ded048cb791c4cc4181fdfa52dc0da484744605d5dec15aafbffd13078f4ba1be37b63302287871264dd0ba38e89550967a6b73c8066f06cef8dd85b07c662acdfd7d7499efcab64489dee19e7519775d088b613c6f8d319d198174735b6fa8c33b5d89fcaab79598f9df769906440046d496c6cfc0f91a8a3e2518db8a0b17215fce3a9563fa0437d6466e9dc5d59ee7802caa677a8770d99c1d74e174b9abb234060251d590ca2ae5c81ed495bf354684bf58f9e58196a86e7b60c6a4c1a9576297098897e1a817183e32cb5ee651c372b7887f4db030966db2363f105015ba7d5c06de644635d08ff6e7dc8e4ce74c8d487770b24fcf79924dc9c0efafea415113a3fc0d33b27eaba5c45337e56dd789ab3111d7a8699aa2db316e4140664e3b29ee95ad3741b10db34cd8ae8c17dfbdf6067dc06b3c275c47a1dd4049161bdb72aca5d430da0caafa7869c5ce04f41e9f75bf30d0ead9460205b6835891ae3ce07dc9d524670b315c03b58768f7f9816f765e1f0102f25c37c4fec3fc9e49383b340f6575a57ca667ea6e4c379b40585246ae96c047d58404f836f0589f22e507b0398b1020cb36694f821994bf6a08f215874cc9a06ccf71e9463b1ce4e54506a77445b3713084a5a75ec7a84887d4e2bb43cc44c55535ff007a2e625fb599cf17ee9d6f50ad048c45d817beaf3bdb13809260d7b1411957bd6b0798a046d496c6cfc0f91a8a3e2518db8a0b17215fce3a9563fa0437d6466e9dc5d59ee7802caa677a8770d99c1d74e174b9abb234060251d590ca2ae5c81ed495bf354fbf5ed7f6d0d96faf0914a900d502fbd17e68f4cd030d860ae716dca04124d75e005539d3c4de97ff4328c683a517f681d8dbc000847cab54c58ce1e911248e01ffaac61c3b216810bcd7397c5ae80979f593ead9ecfd3cfa760fca46b50dc71986910e2bb1a09a06724361cf3dc40fd2c411634dec22c32a6f00a32eaf611c5ae91b28ad96441fcaa28b6f94c64f78071c62662746793aa78802d10b26f23ef0d0d6f3869c39fa83adafa9ffa8f654c51fd8cfad39fbefa7d995c4411548a076c7071e5917801e4af86045e23b1a30e4922255d12421983149cef79c13502b8f4edb3873fb431c8fab39b1c2364e4411f341a78e65f6262ddca46dc6d7e29515f59bf2c87928f4db175360e591a9c15cf5af3e6f292f2c1c9904c5fa089cb93fc482a906f52162ef3016a480c2854cabf1ccfb83017c642a6d9cba79c663b9ce730157eaf8ef10f11edf1b99f01c0cb48e69c93f7464a5d890b7ac7c5f317bc364a8316285918808b7dec9f6b12d8551e9f2cd3f57464b2256baf348f9baef616d11765960cc45676f26aa8ac2ea6c6e1c64b4e60e20642a7ff77755a7dd8d7d96c58bdefce6ae4c286df319bea566e89986e9fbdc9f10689e047ef49f195a6b2c35a2a18641084101529e0ed424a30ff14266df0c22e38bedf216bed4141d085fc60fe4802f167625c5d7625bd1ecd6a19a6019ec2ad0d422ee02e9a93a5a45000639bfaf89cbdd4cbfe52de58353b6a85a294c1d2a2a1a9875f5bf60bbe3545f2bf06a16e4f1dd38069cd9fbd3c0564b6744123c8effd22e316eb9407e9fbc3de93f923f7962e28663dc3b98a15da633cf2253171049a3ccf102e27d3aa0f274c742a20233300d9ea75f057e982fa6d381aac4dfae2fa09f85af1751d30cf6e673f6bfb79e359eadb13c330aeaed3372bdcca016a0b91dc32853f43555c7b88dbbf2135037e85b8ecc1112e4acdcdf7d44f510c160f960579f4d9f555d09400fb5b52cf1a4741e00f439f5fe272406fef29a4baf68bc1a1603421f7dfd232ab55993b054af2d8d202c8cc1e9563700c728a795831dcf71120da04241c26ed05e3ac0f202d3a35cb8f0409bdf3b58ff6d9633a03ce5ba7c2a1794a1ee9219e6d758d289eb3298634092c74a71a642b14506fa3eeac0f7a9d12c94d12039c67b388646896f535227fbf5549a6b0c39be6278da8224bb32bfc8a6652e8c9fcd8b23a54ed5af9d995a89480523c343c48681b240891530d5654d6512bbde398d7eb36a4b587f244b776b4f7882f60e7e490609537b4beeb0fad737ad27dcf487ff6463369de06273208898689059f572cae7b8906617a5c6ddf68bc62d8562d9de638fa855356614a58f0f62412cdd46547c42b5973513494ebfcc33dc3b0b6b7bbdfeca4ea753e2f9e5c5fabe23ecea089679eaaf691ccdaa3ea9956e009097a8ff7d9321ca462703e9c332f42324db5c76707259a0b10fd99ae221312ce727bf86527b07b16dec44766e2ce275341c922c0725e68984e7134e0c09de158bd6f0a1d7724a34c2820" + +fn cthexb c uchar to uchar +if and ge c 48 le c 57 +ret sub c 48 +end +if and ge c 97 le c 102 +ret sub c 87 +end +trap 5 +end + +fn tvb i ulong to uchar +ret or shl cthexb get Vdat mul i 2 4 cthexb get Vdat add mul i 2 1 +end + +note mode 0 as signed, 1 message or digest bit flip, 2 r flip, 3 s flip, 4 public Y flip, +note 5 high-s n-s (valid ECDSA), 6 r zero, 7 s replaced by n (out of range). +fn tv384 off ulong ml ulong mode ulong to bool +w = new ulong 1536 0 +b = new uchar 4096 0 +so = add add off 97 48 +if eq mode 5 +so = add so 48 +end +mo = add off 241 +m = new uchar 65536 0 +d = new uchar 64 0 +for i ulong ml +put m i tvb add mo i +end +cs384hash m ml d +for j ulong 48 +put b add 3296 j get d j +end +for k ulong 97 +put b add 3072 k tvb add off k +end +for q ulong 48 +put b add 3200 q tvb add add off 97 q +put b add 3248 q tvb add so q +end +if eq mode 1 +put b 3296 xor get b 3296 1 +end +if eq mode 2 +put b 3247 xor get b 3247 1 +end +if eq mode 3 +put b 3295 xor get b 3295 1 +end +if eq mode 4 +put b 3168 xor get b 3168 1 +end +if eq mode 6 +for z ulong 48 +put b add 3200 z 0 +end +end +if eq mode 7 +put b 3248 255 +put b 3249 255 +put b 3250 255 +put b 3251 255 +put b 3252 255 +put b 3253 255 +put b 3254 255 +put b 3255 255 +put b 3256 255 +put b 3257 255 +put b 3258 255 +put b 3259 255 +put b 3260 255 +put b 3261 255 +put b 3262 255 +put b 3263 255 +put b 3264 255 +put b 3265 255 +put b 3266 255 +put b 3267 255 +put b 3268 255 +put b 3269 255 +put b 3270 255 +put b 3271 255 +put b 3272 199 +put b 3273 99 +put b 3274 77 +put b 3275 129 +put b 3276 244 +put b 3277 55 +put b 3278 45 +put b 3279 223 +put b 3280 88 +put b 3281 26 +put b 3282 13 +put b 3283 178 +put b 3284 72 +put b 3285 176 +put b 3286 167 +put b 3287 122 +put b 3288 236 +put b 3289 236 +put b 3290 25 +put b 3291 106 +put b 3292 204 +put b 3293 197 +put b 3294 41 +put b 3295 115 +end +cp3init w +ret eq cp3vrfy w b 1 +end + +note mode 0 as signed, 1 message or digest bit flip, 2 r flip, 3 s flip, 4 public Y flip, +note 5 high-s n-s (valid ECDSA), 6 r zero, 7 s replaced by n (out of range). +fn tv256 off ulong ml ulong mode ulong to bool +w = new ulong 1024 0 +b = new uchar 4096 0 +so = add add off 65 32 +if eq mode 5 +so = add so 32 +end +mo = add off 161 +constants +hinit +for i ulong ml +hbyte tvb add mo i +end +finish +for j ulong 32 +put b add 3296 j get Hash j +end +for k ulong 65 +put b add 3072 k tvb add off k +end +for q ulong 32 +put b add 3200 q tvb add add off 65 q +put b add 3232 q tvb add so q +end +if eq mode 1 +put b 3296 xor get b 3296 1 +end +if eq mode 2 +put b 3231 xor get b 3231 1 +end +if eq mode 3 +put b 3263 xor get b 3263 1 +end +if eq mode 4 +put b 3136 xor get b 3136 1 +end +if eq mode 6 +for z ulong 32 +put b add 3200 z 0 +end +end +if eq mode 7 +put b 3232 255 +put b 3233 255 +put b 3234 255 +put b 3235 255 +put b 3236 0 +put b 3237 0 +put b 3238 0 +put b 3239 0 +put b 3240 255 +put b 3241 255 +put b 3242 255 +put b 3243 255 +put b 3244 255 +put b 3245 255 +put b 3246 255 +put b 3247 255 +put b 3248 188 +put b 3249 230 +put b 3250 250 +put b 3251 173 +put b 3252 167 +put b 3253 23 +put b 3254 158 +put b 3255 132 +put b 3256 243 +put b 3257 185 +put b 3258 202 +put b 3259 194 +put b 3260 252 +put b 3261 99 +put b 3262 37 +put b 3263 81 +end +cp2init w +ret eq cp2vrfy w b 1 +end + +fn main to int +check tv384 0 0 0 100 +check not tv384 0 0 1 101 +check not tv384 0 0 2 102 +check not tv384 0 0 3 103 +check not tv384 0 0 4 104 +check tv384 0 0 5 105 +check not tv384 0 0 6 106 +check not tv384 0 0 7 107 +check tv384 241 1 0 108 +check not tv384 241 1 1 109 +check not tv384 241 1 2 110 +check not tv384 241 1 3 111 +check not tv384 241 1 4 112 +check tv384 241 1 5 113 +check not tv384 241 1 6 114 +check not tv384 241 1 7 115 +check tv384 483 55 0 116 +check not tv384 483 55 1 117 +check not tv384 483 55 2 118 +check not tv384 483 55 3 119 +check not tv384 483 55 4 120 +check tv384 483 55 5 121 +check not tv384 483 55 6 122 +check not tv384 483 55 7 123 +check tv384 779 111 0 124 +check not tv384 779 111 1 125 +check not tv384 779 111 2 126 +check not tv384 779 111 3 127 +check not tv384 779 111 4 128 +check tv384 779 111 5 129 +check not tv384 779 111 6 130 +check not tv384 779 111 7 131 +check tv384 1131 112 0 132 +check not tv384 1131 112 1 133 +check not tv384 1131 112 2 134 +check not tv384 1131 112 3 135 +check not tv384 1131 112 4 136 +check tv384 1131 112 5 137 +check not tv384 1131 112 6 138 +check not tv384 1131 112 7 139 +check tv384 1484 127 0 140 +check not tv384 1484 127 1 141 +check not tv384 1484 127 2 142 +check not tv384 1484 127 3 143 +check not tv384 1484 127 4 144 +check tv384 1484 127 5 145 +check not tv384 1484 127 6 146 +check not tv384 1484 127 7 147 +check tv384 1852 128 0 148 +check not tv384 1852 128 1 149 +check not tv384 1852 128 2 150 +check not tv384 1852 128 3 151 +check not tv384 1852 128 4 152 +check tv384 1852 128 5 153 +check not tv384 1852 128 6 154 +check not tv384 1852 128 7 155 +check tv384 2221 129 0 156 +check not tv384 2221 129 1 157 +check not tv384 2221 129 2 158 +check not tv384 2221 129 3 159 +check not tv384 2221 129 4 160 +check tv384 2221 129 5 161 +check not tv384 2221 129 6 162 +check not tv384 2221 129 7 163 +check tv384 2591 239 0 164 +check not tv384 2591 239 1 165 +check not tv384 2591 239 2 166 +check not tv384 2591 239 3 167 +check not tv384 2591 239 4 168 +check tv384 2591 239 5 169 +check not tv384 2591 239 6 170 +check not tv384 2591 239 7 171 +check tv384 3071 1000 0 172 +check not tv384 3071 1000 1 173 +check not tv384 3071 1000 2 174 +check not tv384 3071 1000 3 175 +check not tv384 3071 1000 4 176 +check tv384 3071 1000 5 177 +check not tv384 3071 1000 6 178 +check not tv384 3071 1000 7 179 +check tv256 4312 0 0 180 +check not tv256 4312 0 1 181 +check not tv256 4312 0 2 182 +check not tv256 4312 0 3 183 +check not tv256 4312 0 4 184 +check tv256 4312 0 5 185 +check not tv256 4312 0 6 186 +check not tv256 4312 0 7 187 +check tv256 4473 1 0 188 +check not tv256 4473 1 1 189 +check not tv256 4473 1 2 190 +check not tv256 4473 1 3 191 +check not tv256 4473 1 4 192 +check tv256 4473 1 5 193 +check not tv256 4473 1 6 194 +check not tv256 4473 1 7 195 +check tv256 4635 55 0 196 +check not tv256 4635 55 1 197 +check not tv256 4635 55 2 198 +check not tv256 4635 55 3 199 +check not tv256 4635 55 4 200 +check tv256 4635 55 5 201 +check not tv256 4635 55 6 202 +check not tv256 4635 55 7 203 +check tv256 4851 111 0 204 +check not tv256 4851 111 1 205 +check not tv256 4851 111 2 206 +check not tv256 4851 111 3 207 +check not tv256 4851 111 4 208 +check tv256 4851 111 5 209 +check not tv256 4851 111 6 210 +check not tv256 4851 111 7 211 +check tv256 5123 112 0 212 +check not tv256 5123 112 1 213 +check not tv256 5123 112 2 214 +check not tv256 5123 112 3 215 +check not tv256 5123 112 4 216 +check tv256 5123 112 5 217 +check not tv256 5123 112 6 218 +check not tv256 5123 112 7 219 +check tv256 5396 127 0 220 +check not tv256 5396 127 1 221 +check not tv256 5396 127 2 222 +check not tv256 5396 127 3 223 +check not tv256 5396 127 4 224 +check tv256 5396 127 5 225 +check not tv256 5396 127 6 226 +check not tv256 5396 127 7 227 +check tv256 5684 128 0 228 +check not tv256 5684 128 1 229 +check not tv256 5684 128 2 230 +check not tv256 5684 128 3 231 +check not tv256 5684 128 4 232 +check tv256 5684 128 5 233 +check not tv256 5684 128 6 234 +check not tv256 5684 128 7 235 +check tv256 5973 129 0 236 +check not tv256 5973 129 1 237 +check not tv256 5973 129 2 238 +check not tv256 5973 129 3 239 +check not tv256 5973 129 4 240 +check tv256 5973 129 5 241 +check not tv256 5973 129 6 242 +check not tv256 5973 129 7 243 +check tv256 6263 239 0 244 +check not tv256 6263 239 1 245 +check not tv256 6263 239 2 246 +check not tv256 6263 239 3 247 +check not tv256 6263 239 4 248 +check tv256 6263 239 5 249 +check not tv256 6263 239 6 250 +check not tv256 6263 239 7 251 +check tv256 6663 1000 0 252 +check not tv256 6663 1000 1 253 +check not tv256 6663 1000 2 254 +check not tv256 6663 1000 3 255 +check not tv256 6663 1000 4 256 +check tv256 6663 1000 5 257 +check not tv256 6663 1000 6 258 +check not tv256 6663 1000 7 259 +ret int get Fails 0 +end diff --git a/native/omega/allen/tests/tls-cert.om b/native/omega/allen/tests/tls-cert.om new file mode 100644 index 00000000..b0a09de6 --- /dev/null +++ b/native/omega/allen/tests/tls-cert.om @@ -0,0 +1,338 @@ +note Certificate verifier fixtures. Build order: base.om vendor/sha256-core.om vendor/cert-sha384.om +note vendor/cert-p256.om tls-p384.om vendor/cert-root.om tls-cert.om tests/check.om tests/tls-cert.om. +note Public api.github.com chain observed by parent 2026-10-25 in /tmp/allen-imac-qualification/github-api-fullchain.txt +note through an OpenSSL TLS1.3 ChaCha20 handshake. Independent oracle: openssl verify -CAfile system Root E46 +note -untrusted intermediate -purpose sslserver -verify_hostname api.github.com leaf: OK. Test-only bytes. +note Leaf DER SHA256 06e6a4a004329905d4a4e7c0d2c6ec7a632c56443f256424a43cc786951b3149. +note Intermediate DER SHA256 873f0ba80e3ac222656dfd04158cc15c2927d42d5d05f01dee4a47eb43a916df. +note Cross-signed Root E46 DER SHA256 ea6b89ed6907a209ff9188676fb164e7aced894b8996dfbe5ce5bbcc22de4ddd. +note Production code never reads these texts; trust comes from vendor/cert-root.om only. +note certsig positive uses the public intermediate key and its real ECDSA-SHA256 over leaf TBS. +text Tleaf "308203ee30820394a003020102021078f8ae8f2ae4d74fda13a80568074b6f300a06082a8648ce3d0403023060310b300906035504061302474231183016060355040a130f5365637469676f204c696d69746564313730350603550403132e5365637469676f205075626c6963205365727665722041757468656e7469636174696f6e20434120445620453336301e170d3236303833303030303030305a170d3236313132373233353935395a30173115301306035504030c0c2a2e6769746875622e636f6d3059301306072a8648ce3d020106082a8648ce3d03010703420004d6c33b882041438111d499cbbc698be6be414eeeb0cba06bbfa5216e3474dc32cea9f39feb4f8c08230d8ccf2cddce43ac95b2e83079ca112d9716fa412034f0a382027730820273301f0603551d230418301680141799a804c16fe42d70a80a103d03d3e91ab82663301d0603551d0e04160414c3ee316094e517ebe26296f8081f03c03f7437d0300e0603551d0f0101ff040403020780300c0603551d130101ff0402300030130603551d25040c300a06082b0601050507030130490603551d20044230403034060b2b06010401b231010202073025302306082b06010505070201161768747470733a2f2f7365637469676f2e636f6d2f4350533008060667810c01020130818406082b0601050507010104783076304f06082b060105050730028643687474703a2f2f6372742e7365637469676f2e636f6d2f5365637469676f5075626c696353657276657241757468656e7469636174696f6e434144564533362e637274302306082b060105050730018617687474703a2f2f6f6373702e7365637469676f2e636f6d30820105060a2b06010401d6790204020481f60481f300f1007700d76d7d10d1a7f577c2c7e95fd700bff982c9335a65e1d0b3017317c0c8c56977000001a0501f4ff70000040300483046022100bf8417b321ff4d63069da780ea0c80da79814e122c327d43555da2a91ce3e49902210085dacc1bf48945ba84793afaa16d81ce31c52ce22968c482d4a0a24cf3019ca4007600c8a3c47fc7b3adb9356b013f6a7a126de33a4e43a5c646f997ad3975991dcf9a000001a0501f4ffe0000040300473045022100af24545a95f9858841971cb29838c25a51b8a4fb11f1b8add82a6586dbe6894f02204143eecce1001622a34b8d15a7407eb0bc0e38bfc0f1ff68ee87ea43feeacc1430230603551d11041c301a820c2a2e6769746875622e636f6d820a6769746875622e636f6d300a06082a8648ce3d040302034800304502204d4e9857f70ea04285bbe15853684007b109c5da74be76e8b7eaf721dcfd9172022100c9e9743bced1f6ad830c6ba69b0be117cae6aa5d69deb0ba9615a9704b4e02a8" +text Tint "3082035f308202e6a003020102021036e059ed888dd57aedd570b6727f9bda300a06082a8648ce3d040303305f310b300906035504061302474231183016060355040a130f5365637469676f204c696d69746564313630340603550403132d5365637469676f205075626c6963205365727665722041757468656e7469636174696f6e20526f6f7420453436301e170d3231303332323030303030305a170d3336303332313233353935395a3060310b300906035504061302474231183016060355040a130f5365637469676f204c696d69746564313730350603550403132e5365637469676f205075626c6963205365727665722041757468656e7469636174696f6e204341204456204533363059301306072a8648ce3d020106082a8648ce3d0301070342000468a1a76c05270589631c39a7ff2521c5edd32f1298bb2cdcf555e849a08457917bdc585f6bf4a2fd132c9b04c55b747db3b27a269619166bb8768def93f56097a38201813082017d301f0603551d23041830168014d122da4c59f14b5f2638aa9dd6eeeb0dc3fba961301d0603551d0e041604141799a804c16fe42d70a80a103d03d3e91ab82663300e0603551d0f0101ff04040302018630120603551d130101ff040830060101ff020100301d0603551d250416301406082b0601050507030106082b06010505070302301b0603551d200414301230060604551d20003008060667810c01020130540603551d1f044d304b3049a047a0458643687474703a2f2f63726c2e7365637469676f2e636f6d2f5365637469676f5075626c696353657276657241757468656e7469636174696f6e526f6f744534362e63726c30818406082b0601050507010104783076304f06082b060105050730028643687474703a2f2f6372742e7365637469676f2e636f6d2f5365637469676f5075626c696353657276657241757468656e7469636174696f6e526f6f744534362e703763302306082b060105050730018617687474703a2f2f6f6373702e7365637469676f2e636f6d300a06082a8648ce3d040303036700306402305b0a9c140387ae25faff9a5185a30c224a40cc475141a67300180c88c9f696d1608b4c088c79c6ed2851beac21f4d7a902303dd75cb0313829d78bbb58497691e074bbec1c02b7bf28322c6ba3314f7104908369c9114fddd51c4134829a6036a755" +text Tcross "30820346308202cba00302010202101a9eafec6de8e19b5c193141b68d90dd300a06082a8648ce3d040303308188310b3009060355040613025553311330110603550408130a4e6577204a6572736579311430120603550407130b4a65727365792043697479311e301c060355040a131554686520555345525452555354204e6574776f726b312e302c06035504031325555345525472757374204543432043657274696669636174696f6e20417574686f72697479301e170d3231303332323030303030305a170d3338303131383233353935395a305f310b300906035504061302474231183016060355040a130f5365637469676f204c696d69746564313630340603550403132d5365637469676f205075626c6963205365727665722041757468656e7469636174696f6e20526f6f74204534363076301006072a8648ce3d020106052b810400220362000476fa99a96e20edf9d777e3073ba8db3d5f38e8ab55a6564fd648eaec7f2daac3b2c579ec99617f1079c7025af90437f534352b77ce7f208f52a30089ecd5a7a26d5be34b9293a080f50194dcf068071ecdeefe2552b520431c1bfeeb19ce43a3a38201203082011c301f0603551d230418301680143ae10986d4cf19c29676744976dce035c663639a301d0603551d0e04160414d122da4c59f14b5f2638aa9dd6eeeb0dc3fba961300e0603551d0f0101ff040403020186300f0603551d130101ff040530030101ff301d0603551d250416301406082b0601050507030106082b0601050507030230110603551d20040a300830060604551d200030500603551d1f044930473045a043a041863f687474703a2f2f63726c2e7573657274727573742e636f6d2f55534552547275737445434343657274696669636174696f6e417574686f726974792e63726c303506082b0601050507010104293027302506082b060105050730018619687474703a2f2f6f6373702e7573657274727573742e636f6d300a06082a8648ce3d04030303690030660231008c0b2062b7df6f5f66daeb11240def983bbbc2d2dc236e4bfd3caa6a186b99eb5259af28c5b29f8316911c942572e27a023100b0bd90d70ff9b62a8d470390649b3ed840e14088d0c3e3d2166b6c1d4fb4770ed3836925c7fc1897bfc7f007db2ee2d5" +text Tok1 "api.github.com" +text Tok2 "API.GitHub.COM" +text Tok3 "*.github.com" +text Tbad1 "*.*.github.com" +text Tbad2 "x.api.github.com" +text Tbad3 "github.com" +text Tbad4 "api.github.com." +text Tbad5 "a*.github.com" +text Tbad6 "api.github.co" +text Tutc1 "260230000000Z" +text Tgen1 "20491231235959Z" +text Tutc2 "2610251200000" +text Tutc3 "261025120000Z" +global Tpos ulong 1 + +fn thexb w ulong i ulong to uchar +if eq w 0 +ret or shl cthexv get Tleaf mul i 2 4 cthexv get Tleaf add mul i 2 1 +end +if eq w 1 +ret or shl cthexv get Tint mul i 2 4 cthexv get Tint add mul i 2 1 +end +ret or shl cthexv get Tcross mul i 2 4 cthexv get Tcross add mul i 2 1 +end + +fn tlen w ulong to ulong +if eq w 0 +ret div len Tleaf 2 +end +if eq w 1 +ret div len Tint 2 +end +ret div len Tcross 2 +end + +fn tbegin to void +for i ulong 65536 +put Certbuf i 0 +end +put Tpos 0 4 +end + +fn tentry w ulong to void +p = get Tpos 0 +n = tlen w +put Certbuf p uchar and shr n 16 255 +put Certbuf add p 1 uchar and shr n 8 255 +put Certbuf add p 2 uchar and n 255 +for i ulong n +put Certbuf add add p 3 i thexb w i +end +put Tpos 0 add add p 5 n +end + +fn tend to void +e = get Tpos 0 +n = sub e 4 +put Certbuf 1 uchar and shr n 16 255 +put Certbuf 2 uchar and shr n 8 255 +put Certbuf 3 uchar and n 255 +put Certlen 0 e +end + +fn tchain to void +tbegin +tentry 0 +tentry 1 +tentry 2 +tend +end + +fn tkey to bool +ok = true +for i ulong 65 +if ne get Certkey i thexb 0 add 224 i +ok = false +end +end +ret ok +end + +note Synthetic DER/name bytes are placed at62000 after the fixture chain; ctdns sees only its range. +fn tdnsok w ulong to bool +n = ulong 0 +if eq w 0 +n = len Tok1 +for i ulong n +put Certbuf add 62000 i get Tok1 i +end +end +if eq w 1 +n = len Tok2 +for i ulong n +put Certbuf add 62000 i get Tok2 i +end +end +if eq w 2 +n = len Tok3 +for i ulong n +put Certbuf add 62000 i get Tok3 i +end +end +ret ctdns 62000 add 62000 n +end + +fn tdnsbad w ulong to bool +n = ulong 0 +if eq w 0 +n = len Tbad1 +for i ulong n +put Certbuf add 62000 i get Tbad1 i +end +end +if eq w 1 +n = len Tbad2 +for i ulong n +put Certbuf add 62000 i get Tbad2 i +end +end +if eq w 2 +n = len Tbad3 +for i ulong n +put Certbuf add 62000 i get Tbad3 i +end +end +if eq w 3 +n = len Tbad4 +for i ulong n +put Certbuf add 62000 i get Tbad4 i +end +end +if eq w 4 +n = len Tbad5 +for i ulong n +put Certbuf add 62000 i get Tbad5 i +end +end +if eq w 5 +n = len Tbad6 +for i ulong n +put Certbuf add 62000 i get Tbad6 i +end +end +ret ctdns 62000 add 62000 n +end + +fn tder a uchar b uchar c uchar to bool +put Certbuf 62000 a +put Certbuf 62001 b +put Certbuf 62002 c +put Certbuf 62003 0 +put Certbuf 62004 0 +ret ctder 62000 62005 +end + +fn ttime w ulong to bool +p = ulong 62002 +n = ulong 13 +put Certbuf 62000 23 +if eq w 0 +for i ulong 13 +put Certbuf add p i get Tutc1 i +end +end +if eq w 1 +put Certbuf 62000 24 +n = 15 +for i ulong 15 +put Certbuf add p i get Tgen1 i +end +end +if eq w 2 +for i ulong 13 +put Certbuf add p i get Tutc2 i +end +end +if eq w 3 +for i ulong 13 +put Certbuf add p i get Tutc3 i +end +end +put Certbuf 62001 uchar n +if not cttime 62000 add p n +ret false +end +ret ne ctepoch 0 +end + +note Leaf parse-only mutants: the fixture leaf begins at Certbuf 7 and ends at 1017. +fn tmut at ulong v uchar to bool +tchain +put Certbuf add 7 at v +ret ctparse 0 7 1017 +end + +fn tsigmsg to void +for i ulong 920 +put Certmsg i thexb 0 add 4 i +end +for j ulong 71 +put Certsig j thexb 0 add 939 j +end +for k ulong 65 +put Cleaf k thexb 1 add 296 k +end +end + +fn main to int +put Certnow 0 1792929600 +tchain +check certcheck 1 +check tkey 2 +check eq get Ccount 0 3 3 +check not ctca 1 1 4 +check ctca 1 0 5 +tsigmsg +check certsig 920 71 6 +put Certmsg 10 xor get Certmsg 10 1 +check not certsig 920 71 7 +put Certmsg 10 xor get Certmsg 10 1 +check not certsig 920 71 8 +certreset +tsigmsg +check not certsig 920 71 9 +put Certnow 0 1788048000 +tchain +check certcheck 10 +put Certnow 0 1788047999 +check not certcheck 11 +put Certnow 0 1795823999 +check certcheck 12 +put Certnow 0 1795824000 +check not certcheck 13 +put Certnow 0 0 +check not certcheck 14 +put Certnow 0 1792929600 +tbegin +tentry 0 +tentry 1 +tend +check certcheck 15 +tbegin +tentry 0 +tend +check not certcheck 16 +tbegin +tentry 1 +tentry 0 +tend +check not certcheck 17 +tbegin +tentry 1 +tend +check not certcheck 18 +tchain +put Certbuf 1016 xor get Certbuf 1016 1 +check not certcheck 19 +tchain +put Certbuf 22 xor get Certbuf 22 1 +check not certcheck 20 +tchain +put Certbuf 1888 xor get Certbuf 1888 1 +check not certcheck 21 +tchain +put Certbuf 1018 1 +check not certcheck 22 +tchain +put Certbuf 0 1 +check not certcheck 23 +tchain +put Certlen 0 add get Certlen 0 1 +check not certcheck 24 +tchain +put Certlen 0 61000 +check not certcheck 25 +tchain +put Certbuf 3 xor get Certbuf 3 1 +check not certcheck 26 +tchain +check ctparse 0 7 1017 27 +check not tmut 336 35 28 +check not tmut 367 127 29 +check tmut 336 126 30 +check not tmut 935 3 31 +check not tmut 1 0 32 +check tmut 911 110 33 +check eq get Cm 18 0 34 +tchain +put Certbuf 918 110 +check not certcheck 35 +check tdnsok 0 36 +check tdnsok 1 37 +check tdnsok 2 38 +check not tdnsbad 0 39 +check not tdnsbad 1 40 +check not tdnsbad 2 41 +check not tdnsbad 3 42 +check not tdnsbad 4 43 +check not tdnsbad 5 44 +check not tder 48 128 0 45 +check not tder 48 129 3 46 +check not tder 31 1 0 47 +check not tder 48 4 0 48 +check tder 48 3 0 49 +check not ttime 0 50 +check not ttime 1 51 +check not ttime 2 52 +check ttime 3 53 +put Certnow 0 253402300800 +tchain +check not certcheck 54 +put Certnow 0 1792929600 +tchain +check certcheck 55 +certreset +check not certsig 920 71 56 +check eq get Certkey 0 0 57 +note Leaf policy without signatures: the SAN mutant parses but must fail the identity check. +tchain +check ctparse 0 7 1017 58 +check ctleaf 59 +check tmut 911 110 60 +check not ctleaf 61 +ret int get Fails 0 +end diff --git a/native/omega/allen/tests/tls-crypto-aead.om b/native/omega/allen/tests/tls-crypto-aead.om new file mode 100644 index 00000000..ed5739bd --- /dev/null +++ b/native/omega/allen/tests/tls-crypto-aead.om @@ -0,0 +1,179 @@ +note SPDX-License-Identifier: AGPL-3.0-or-later +note RFC8439 sections2.3.2/2.8.2 official block and AEAD vectors; negative cases mutate those vectors. +note https://www.rfc-editor.org/rfc/rfc8439 ; attribution/license in tls-crypto-fixture.om. +note Additional zero/partial/full/block-boundary/max-buffer roundtrips are property tests, not oracles. +text Vblock "10f1e7e4d13b5915500fdd1fa32071c4c7d1f4c733c068030422aa9ac3d46c4ed2826446079faa0914c2d705d98b02a2b5129cd1de164eb9cbd083e8a2503c4e" +text Vplain "Ladies and Gentlemen of the class of '99: If I could offer you only one tip for the future, sunscreen would be it." +text Vcipher "d31a8d34648e60db7b86afbc53ef7ec2a4aded51296e08fea9e2b5a736ee62d63dbea45e8ca9671282fafb69da92728b1a71de0a9e060b2905d6a5b67ecd3b3692ddbd7f2d778b8c9803aee328091b58fab324e4fad675945585808b4831d7bc3ff4def08e4b7a9de576d26586cec64b6116" +text Vtag "1ae10b594f09e26a7e902ecbd0600691" +text Vaad "50515253c0c1c2c3c4c5c6c7" + +fn tvblock to void +tcwipe +for i ulong 32 +put Tckey i uchar i +end +put Tciv 3 9 +put Tciv 7 74 +tccblock 1 +for i ulong 64 +p = mul i 2 +v = tvbyte get Vblock p get Vblock add p 1 +tvcheck eq get Tccblk i v 1 +end +tccwipe +tvscrub +end + +fn tvsetup to void +tcwipe +for i ulong 32 +put Tckey i uchar add i 128 +end +put Tciv 0 7 +for i ulong 8 +put Tciv add i 4 uchar add i 64 +end +for i ulong 12 +p = mul i 2 +put Tcaad i tvbyte get Vaad p get Vaad add p 1 +end +for i ulong len Vplain +put Tcbuf i get Vplain i +end +put Tcbuf len Vplain 221 +end + +fn tvcipher to void +for i ulong len Vplain +p = mul i 2 +v = tvbyte get Vcipher p get Vcipher add p 1 +tvcheck eq get Tcbuf i v 2 +end +tvcheck eq get Tcbuf len Vplain 221 3 +tvscrub +end + +fn tvtag to void +for i ulong 16 +p = mul i 2 +v = tvbyte get Vtag p get Vtag add p 1 +tvcheck eq get Tctag i v 4 +end +end + +fn tvbad to void +note Each bit of every tag byte is checked, with ciphertext unchanged after every rejection. +for i ulong 16 +for j ulong 8 +v = shl uchar 1 j +put Tctag i xor get Tctag i v +tvcheck not tcopen len Vplain 12 5 +tvcipher +put Tctag i xor get Tctag i v +end +end +for i ulong 12 +put Tcaad i xor get Tcaad i 1 +tvcheck not tcopen len Vplain 12 6 +tvcipher +put Tcaad i xor get Tcaad i 1 +end +for i ulong 12 +put Tciv i xor get Tciv i 1 +tvcheck not tcopen len Vplain 12 7 +tvcipher +put Tciv i xor get Tciv i 1 +end +for i ulong 32 +put Tckey i xor get Tckey i 1 +tvcheck not tcopen len Vplain 12 8 +tvcipher +put Tckey i xor get Tckey i 1 +end +for i ulong len Vplain +put Tcbuf i xor get Tcbuf i 1 +tvcheck not tcopen len Vplain 12 9 +put Tcbuf i xor get Tcbuf i 1 +tvcipher +end +tvcheck not tcopen sub len Vplain 1 12 10 +tvcipher +tvcheck not tcopen len Vplain 11 11 +tvcipher +tvcheck not tcopen 65537 12 12 +tvcipher +tvcheck not tcopen len Vplain 33 12 +tvcipher +tvcheck not tcopen 18446744073709551615 0 12 +tvcipher +tvcheck not tcseal 65537 12 13 +tvcipher +tvcheck not tcseal len Vplain 33 13 +tvcipher +for i ulong 16 +p = mul i 2 +put Tctag i tvbyte get Vtag p get Vtag add p 1 +end +end + +fn tvround n ulong aadlen ulong to void +tcwipe +for i ulong 32 +put Tckey i uchar i +put Tcaad i uchar add i 32 +end +note Unique deterministic fixture nonce per length/AAD combination; not production randomness. +put Tciv 0 uchar and n 255 +put Tciv 1 uchar and shr n 8 255 +put Tciv 2 uchar and shr n 16 255 +put Tciv 3 uchar aadlen +for i ulong n +put Tcbuf i uchar and i 255 +end +if lt n 65536 +put Tcbuf n 233 +end +tvcheck tcseal n aadlen 30 +tvscrub +tvcheck tcopen n aadlen 31 +tvscrub +for i ulong n +tvcheck eq get Tcbuf i uchar and i 255 32 +end +if lt n 65536 +tvcheck eq get Tcbuf n 233 33 +end +end + +fn main to int +tvblock +tvsetup +tvcheck tcseal len Vplain 12 14 +tvcipher +tvtag +tvbad +tvcheck tcopen len Vplain 12 15 +for i ulong len Vplain +tvcheck eq get Tcbuf i get Vplain i 16 +end +tvscrub +tvround 0 0 +tvround 1 1 +tvround 15 15 +tvround 16 16 +tvround 17 17 +tvround 63 31 +tvround 64 32 +tvround 65 0 +tvround 65536 32 +tcwipe +tvscrub +for i ulong 65536 +tvcheck eq get Tcbuf i 0 34 +end +for i ulong 32 +tvcheck eq get Tckey i 0 35 +end +ret 0 +end diff --git a/native/omega/allen/tests/tls-crypto-fixture.om b/native/omega/allen/tests/tls-crypto-fixture.om new file mode 100644 index 00000000..ba4cb103 --- /dev/null +++ b/native/omega/allen/tests/tls-crypto-fixture.om @@ -0,0 +1,82 @@ +note SPDX-License-Identifier: AGPL-3.0-or-later +note Shared fixture support, concatenate before exactly one tls-crypto-{sha,x25519,aead,poly}.om. +note RFC vectors: RFC4231 M.Nystrom (2005 Internet Society), RFC5869 H.Krawczyk/P.Eronen, +note RFC7748 A.Langley/M.Hamburg/S.Turner, RFC8439 Y.Nir/A.Langley. +note RFC5869/7748/8439 Copyright (c) 2010/2016/2018 IETF Trust and identified authors. +note All rights reserved. Source URLs are included in the individual fixtures. +note RFC Code Components carry the IETF Trust Simplified BSD License: +note Redistribution and use in source and binary forms, with or without modification, are +note permitted provided that the following conditions are met: +note 1. Redistributions of source code must retain the above copyright notice, this list of +note conditions and the following disclaimer. +note 2. Redistributions in binary form must reproduce the above copyright notice, this list of +note conditions and the following disclaimer in the documentation and/or other materials +note provided with the distribution. +note THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY +note EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +note MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +note THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +note SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT +note OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +note HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +note OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +note SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +note This harness is first-party Omega. No fixture executes external code or substitutes runtime bytes. + +fn tvcheck ok bool code int to void +if not ok +exit code +end +end + +fn tvnib c uchar to uchar +if and ge c 48 le c 57 +ret sub c 48 +end +if and ge c 97 le c 102 +ret sub c 87 +end +tvcheck false 99 +ret 0 +end + +fn tvbyte a uchar b uchar to uchar +ret or shl tvnib a 4 tvnib b +end + +fn tvscrub to void +for i ulong 8 +tvcheck eq get H i 0 91 +tvcheck eq get Vv i 0 91 +end +for i ulong 64 +tvcheck eq get W i 0 91 +tvcheck eq get Hb i 0 91 +tvcheck eq get Tccblk i 0 92 +end +for i ulong 32 +tvcheck eq get Tchi i 0 91 +tvcheck eq get Hash i 0 91 +tvcheck eq get Tcxsc i 0 93 +tvcheck eq get Tcxres i 0 93 +tvcheck eq get Tcxt i 0 93 +tvcheck eq get Tcmkey i 0 92 +end +for i ulong 176 +tvcheck eq get Tcxf i 0 93 +end +for i ulong 16 +tvcheck eq get Tccs i 0 92 +tvcheck eq get Tccw i 0 92 +tvcheck eq get Tcmblk i 0 92 +tvcheck eq get Tcmtag i 0 92 +end +for i ulong 10 +tvcheck eq get Tcmr i 0 92 +tvcheck eq get Tcmh i 0 92 +tvcheck eq get Tcmt i 0 92 +tvcheck eq get Tcmg i 0 92 +end +tvcheck eq get Hs 0 0 91 +tvcheck eq get Hs 1 0 91 +end diff --git a/native/omega/allen/tests/tls-crypto-poly.om b/native/omega/allen/tests/tls-crypto-poly.om new file mode 100644 index 00000000..0df80566 --- /dev/null +++ b/native/omega/allen/tests/tls-crypto-poly.om @@ -0,0 +1,133 @@ +note SPDX-License-Identifier: AGPL-3.0-or-later +note RFC8439 section2.5.2 and Appendix A.3 vectors1,5,6,7,8,9,10,11. +note https://www.rfc-editor.org/rfc/rfc8439 ; attribution/license in tls-crypto-fixture.om. +note Internal primitive entry points are used to isolate reduction and final-pad carry bugs. +text Vpk "85d6be7857556d337f4452fe42d506a80103808afb0db2fd4abff6af4149f51b" +text Vpm "Cryptographic Forum Research Group" +text Vpt "a8061dc1305136c6c22b8baf0c0127a9" +text Vred "e33594d7505e43b900000000000000003394d7505e4379cd0100000000000000" + +fn tvpoly n ulong to void +tcminit +p = ulong 0 +while lt p n bound 4 +m = sub n p +if gt m 16 +m = 16 +end +for i ulong m +put Tcmblk i get Tcbuf add p i +end +tcmblock m +p = add p m +end +tcmfinish +end + +fn tvsmall first uchar to void +tvcheck eq get Tcmtag 0 first 40 +for i ulong 15 +tvcheck eq get Tcmtag add i 1 0 41 +end +tccwipe +tvscrub +end + +fn tvreduce last bool to void +tcwipe +put Tcmkey 0 1 +put Tcmkey 8 4 +for i ulong 32 +p = mul i 2 +put Tcbuf i tvbyte get Vred p get Vred add p 1 +end +if last +put Tcbuf 48 1 +tvpoly 64 +tvcheck eq get Tcmtag 0 20 50 +tvcheck eq get Tcmtag 8 85 51 +for i ulong 16 +if and ne i 0 ne i 8 +tvcheck eq get Tcmtag i 0 52 +end +end +else +tvpoly 48 +tvsmall 19 +end +end + +fn main to int +tcwipe +for i ulong 32 +p = mul i 2 +put Tcmkey i tvbyte get Vpk p get Vpk add p 1 +end +for i ulong len Vpm +put Tcbuf i get Vpm i +end +tvpoly len Vpm +for i ulong 16 +p = mul i 2 +v = tvbyte get Vpt p get Vpt add p 1 +tvcheck eq get Tcmtag i v 1 +end +tcwipe +tvpoly 64 +tvsmall 0 +note Appendix A.3 vector5: final 130-bit partial reduction. +tcwipe +put Tcmkey 0 2 +for i ulong 16 +put Tcbuf i 255 +end +tvpoly 16 +tvsmall 3 +note Vector6: addition of pad overflows modulo2^128. +tcwipe +put Tcmkey 0 2 +for i ulong 16 +put Tcmkey add i 16 255 +end +put Tcbuf 0 2 +tvpoly 16 +tvsmall 3 +note Vector7: all-ones limbs with a carry. +tcwipe +put Tcmkey 0 1 +for i ulong 32 +put Tcbuf i 255 +end +put Tcbuf 16 240 +put Tcbuf 32 17 +tvpoly 48 +tvsmall 5 +note Vector8: accumulator exactly p must encode0. +tcwipe +put Tcmkey 0 1 +for i ulong 16 +put Tcbuf i 255 +put Tcbuf add i 16 254 +put Tcbuf add i 32 1 +end +put Tcbuf 16 251 +tvpoly 48 +tvsmall 0 +note Vector9: accumulator exactly p-1 must not reduce to0. +tcwipe +put Tcmkey 0 2 +for i ulong 16 +put Tcbuf i 255 +end +put Tcbuf 0 253 +tvpoly 16 +tvcheck eq get Tcmtag 0 250 60 +for i ulong 15 +tvcheck eq get Tcmtag add i 1 255 61 +end +tvreduce true +tvreduce false +tcwipe +tvscrub +ret 0 +end diff --git a/native/omega/allen/tests/tls-crypto-sha.om b/native/omega/allen/tests/tls-crypto-sha.om new file mode 100644 index 00000000..0776eff8 --- /dev/null +++ b/native/omega/allen/tests/tls-crypto-sha.om @@ -0,0 +1,158 @@ +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 empty/abc/56-byte standard FIPS180-4 examples; RFC4231 sections4.2..4.5 HMAC. +note HKDF RFC5869 Appendix A.1/A.3 extract and both expand blocks via public HMAC API. +note https://www.rfc-editor.org/rfc/rfc4231 https://www.rfc-editor.org/rfc/rfc5869 +note Attribution/license in required tls-crypto-fixture.om. Return0 means every assertion matched. +text Vhash "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1b0344c61d8db38535ca8afceaf0bf12b881dc200c9833da726e9376c2e32cff75bdcc146bf60754e6a042426089575c75a003f089d2739839dec58b964ec3843773ea91e36800e46854db8ebd09181a72959098b3ef8c122d9635514ced565fe82558a389a443c0ea4cc819899f2083a85f0faa3e578f8077a2e3ff46729665b077709362c2e32df0ddc3f0dc47bba6390b6c73bb50f9c3122ec844ad7c2b3e519ef24a32c717b167f33a91d6f648bdf96596776afdb6377ac434c1c293ccb04" +text Vokm "3cb25f25faacd57a90434f64d0362f2a2d2d0a90cf1a5a4c5db02d56ecc4c5bf34007208d5b8871858658da4e775a563c18f715f802a063c5a31b8a11f5c5ee1879ec3454e5f3c738d2d9d201395faa4b61a96c8" +text Vabc "abc" +text Vlong "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" +text Vhi "Hi There" +text Vjefe "Jefe" +text Vwhat "what do ya want for nothing?" + +fn tvhash slot ulong to void +for i ulong 32 +p = add mul slot 64 mul i 2 +v = tvbyte get Vhash p get Vhash add p 1 +tvcheck eq get Tcdigest i v 20 +end +tvscrub +end + +fn tvwipe to void +tcwipe +tvscrub +end + +fn tvsha to void +tvwipe +tvcheck tcsha 0 1 +tvhash 0 +for i ulong 3 +put Tcbuf i get Vabc i +end +put Tcbuf 3 201 +tvcheck tcsha 3 2 +tvhash 1 +for i ulong 3 +tvcheck eq get Tcbuf i get Vabc i 3 +end +tvcheck eq get Tcbuf 3 201 3 +for i ulong len Vlong +put Tcbuf i get Vlong i +end +tvcheck tcsha len Vlong 4 +tvhash 2 +tvcheck not tcsha 65537 5 +for i ulong 32 +tvcheck eq get Tcdigest i 0 5 +end +tvcheck not tcsha 18446744073709551615 5 +tvscrub +end + +fn tvhmac to void +tvwipe +for i ulong 20 +put Tckey i 11 +end +for i ulong len Vhi +put Tcbuf i get Vhi i +end +tvcheck tchmac 20 len Vhi 6 +tvhash 3 +for i ulong len Vhi +tvcheck eq get Tcbuf i get Vhi i 7 +end +for i ulong 4 +put Tckey i get Vjefe i +end +tvcheck tchmac 4 0 8 +for i ulong len Vwhat +put Tcbuf i get Vwhat i +end +tvcheck tchmac 4 len Vwhat 9 +tvhash 4 +for i ulong 20 +put Tckey i 170 +end +for i ulong 50 +put Tcbuf i 221 +end +tvcheck tchmac 20 50 10 +tvhash 5 +for i ulong 25 +put Tckey i uchar add i 1 +end +for i ulong 50 +put Tcbuf i 205 +end +tvcheck tchmac 25 50 11 +tvhash 6 +tvcheck not tchmac 33 50 12 +tvcheck not tchmac 32 65537 12 +tvcheck not tchmac 18446744073709551615 0 12 +for i ulong 32 +tvcheck eq get Tcdigest i 0 13 +end +tvcheck eq get Tcbuf 0 205 13 +tvscrub +end + +fn tvhkdf empty bool to void +tvwipe +for i ulong 22 +put Tcbuf i 11 +end +n = ulong 13 +z = ulong 10 +slot = ulong 7 +base = ulong 0 +if empty +n = 0 +z = 0 +slot = 8 +base = 84 +else +for i ulong 13 +put Tckey i uchar i +end +end +tvcheck tchmac n 22 14 +tvhash slot +for i ulong 32 +put Tckey i get Tcdigest i +end +for i ulong z +put Tcbuf i uchar add i 240 +end +put Tcbuf z 1 +tvcheck tchmac 32 add z 1 15 +for i ulong 32 +p = add base mul i 2 +v = tvbyte get Vokm p get Vokm add p 1 +tvcheck eq get Tcdigest i v 16 +put Tcbuf i get Tcdigest i +end +for i ulong z +put Tcbuf add i 32 uchar add i 240 +end +put Tcbuf add z 32 2 +tvcheck tchmac 32 add z 33 17 +for i ulong 10 +p = add add base 64 mul i 2 +v = tvbyte get Vokm p get Vokm add p 1 +tvcheck eq get Tcdigest i v 18 +end +tvscrub +end + +fn main to int +tvsha +tvhmac +tvhkdf false +tvhkdf true +tvwipe +ret 0 +end diff --git a/native/omega/allen/tests/tls-crypto-x25519-iter.om b/native/omega/allen/tests/tls-crypto-x25519-iter.om new file mode 100644 index 00000000..fbfec8cf --- /dev/null +++ b/native/omega/allen/tests/tls-crypto-x25519-iter.om @@ -0,0 +1,24 @@ +note SPDX-License-Identifier: AGPL-3.0-or-later +note RFC7748 section5.2 official 1000-iteration X25519 vector, separate from short fixtures. +note https://www.rfc-editor.org/rfc/rfc7748 ; attribution/license in tls-crypto-fixture.om. +text Viter "684cf59ba83309552800ef566f2f4d3c1c3887c49360e3875f2eb94d99532c51" +fn main to int +tcwipe +put Tcxpriv 0 9 +put Tcxpeer 0 9 +for j ulong 1000 +tvcheck tcx25519 1 +for i ulong 32 +put Tcxpeer i get Tcxpriv i +put Tcxpriv i get Tcxshare i +end +end +for i ulong 32 +p = mul i 2 +v = tvbyte get Viter p get Viter add p 1 +tvcheck eq get Tcxpriv i v 2 +end +tcwipe +tvscrub +ret 0 +end diff --git a/native/omega/allen/tests/tls-crypto-x25519.om b/native/omega/allen/tests/tls-crypto-x25519.om new file mode 100644 index 00000000..fd4a2edd --- /dev/null +++ b/native/omega/allen/tests/tls-crypto-x25519.om @@ -0,0 +1,106 @@ +note SPDX-License-Identifier: AGPL-3.0-or-later +note RFC7748 sections5.2/6.1 official scalar/u/public/shared vectors. +note https://www.rfc-editor.org/rfc/rfc7748 ; attribution/license in tls-crypto-fixture.om. +note Negative/metamorphic cases exercise specified clamping, top-bit masking, noncanonical input, +note small-order rejection, preserved input buffers, and cleared internal scalar/field scratch. +text Vs "a546e36bf0527c9d3b16154b82465edd62144c0ac1fc5a18506a2244ba449ac44b66e9d4d1b4673c5ad22691957d6af5c11b6421e0ea01d42ca4169e7918ba0d77076d0a7318a57d3c16c17251b26645df4c2f87ebc0992ab177fba51db92c2a5dab087e624a8a4b79e17f8b83800ee66f3bb1292618b6fd1c2f8b27ff88e0eb" +text Vu "e6db6867583030db3594c1a424b15f7c726624ec26b3353b10a903a6d0ab1c4ce5210f12786811d3f4b7959d0538ae2c31dbe7106fc03c3efc4cd549c715a4938520f0098930a754748b7ddcb43ef75a0dbf3a0d26381af4eba4a98eaa9b4e6ade9edb7d7b7dc1b4d35b61c2ece435373f8343c85b78674dadfc7e146f882b4f" +text Vx "c3da55379de9c6908e94ea4df28d084f32eccf03491c71f754b4075577a2855295cbde9476e8907d7aade45cb4b873f88b595a68799fa152e6f8f7647aac79574a5d9d5ba4ce2de1728e3bf480350f25e07e21c947d19e3376f09b3c1e161742422c8e7a6227d7bca1350b3e2bb7279f7897b87bb6854b783c60e80311ae3079" + +fn tvxload slot ulong peer ulong to void +for i ulong 32 +p = add mul slot 64 mul i 2 +put Tcxpriv i tvbyte get Vs p get Vs add p 1 +p = add mul peer 64 mul i 2 +put Tcxpeer i tvbyte get Vu p get Vu add p 1 +end +end + +fn tvxwant slot ulong to void +for i ulong 32 +p = add mul slot 64 mul i 2 +v = tvbyte get Vx p get Vx add p 1 +tvcheck eq get Tcxshare i v 10 +end +tvscrub +end + +fn tvxpub slot ulong to void +for i ulong 32 +p = add mul slot 64 mul i 2 +v = tvbyte get Vu p get Vu add p 1 +tvcheck eq get Tcxpub i v 11 +p = add mul slot 64 mul i 2 +v = tvbyte get Vs p get Vs add p 1 +tvcheck eq get Tcxpriv i v 12 +end +tvscrub +end + +fn tvxzero to void +tvcheck not tcx25519 20 +for i ulong 32 +tvcheck eq get Tcxshare i 0 21 +end +tvscrub +end + +fn main to int +tcwipe +tvxload 0 0 +tvcheck tcx25519 1 +tvxwant 0 +put Tcxpeer 31 xor get Tcxpeer 31 128 +tvcheck tcx25519 2 +tvxwant 0 +put Tcxpriv 0 xor get Tcxpriv 0 7 +put Tcxpriv 31 xor get Tcxpriv 31 192 +tvcheck tcx25519 3 +tvxwant 0 +tvxload 1 1 +tvcheck tcx25519 4 +tvxwant 1 +tvxload 2 3 +tvcheck tcxpublic 5 +tvxpub 2 +tvcheck tcx25519 6 +tvxwant 2 +tvxload 3 2 +tvcheck tcxpublic 7 +tvxpub 3 +tvcheck tcx25519 8 +tvxwant 2 +for i ulong 32 +put Tcxpeer i 0 +end +tvxzero +put Tcxpeer 0 1 +tvxzero +note p and p+1 are noncanonical encodings of small-order u=0 and u=1. +for i ulong 32 +put Tcxpeer i 255 +end +put Tcxpeer 31 127 +put Tcxpeer 0 237 +tvxzero +put Tcxpeer 0 238 +tvxzero +note p+9 is a valid noncanonical encoding of the base point u=9. +put Tcxpeer 0 246 +tvcheck tcx25519 22 +for i ulong 32 +tvcheck eq get Tcxshare i get Tcxpub i 23 +end +tcwipe +put Tcxpriv 0 9 +put Tcxpeer 0 9 +tvcheck tcx25519 24 +tvxwant 3 +tcwipe +tvscrub +for i ulong 32 +tvcheck eq get Tcxshare i 0 25 +tvcheck eq get Tcxpriv i 0 25 +end +ret 0 +end diff --git a/native/omega/allen/tests/tls-session-records.om b/native/omega/allen/tests/tls-session-records.om new file mode 100644 index 00000000..55910b38 --- /dev/null +++ b/native/omega/allen/tests/tls-session-records.om @@ -0,0 +1,256 @@ +note Independent protocol construction per RFC8446 sections5,6; real AEAD, no substituted APIs. +note These isolate record/lifecycle logic with provisioned epoch keys, not certificate authentication. +global Vrec uchar 1024 +global Vhold uchar 256 +global Vn ulong 1 +fn vreset to void +tsclear +put Tlsstate 0 2 +put Tsctl 6 5 +for i ulong 32 +put Tskey add i 96 uchar i +put Tskey add i 64 uchar add i 64 +end +for i ulong 12 +put Tsiv add i 36 uchar add i 32 +put Tsiv add i 24 uchar add i 48 +end +end +note Encode server wire independently of tsseal/tsnonce; Tcbuf content supplied by fixture. +fn vrecord off ulong n ulong typ uchar seq ulong to bool +for i ulong 32 +put Tckey i uchar i +end +for i ulong 12 +put Tciv i uchar add i 32 +end +for i ulong 8 +p = sub ulong 11 i +b = uchar and shr seq mul i 8 255 +put Tciv p xor get Tciv p b +end +put Tcbuf n typ +put Tcaad 0 23 +put Tcaad 1 3 +put Tcaad 2 3 +put Tcaad 3 uchar shr add n 17 8 +put Tcaad 4 uchar and add n 17 255 +if not tcseal add n 1 5 +ret false +end +for i ulong 5 +put Vrec add off i get Tcaad i +end +for i ulong add n 1 +put Vrec add add off 5 i get Tcbuf i +end +for i ulong 16 +p = add add off n 6 +put Vrec add p i get Tctag i +end +put Vn 0 add add off n 22 +ret true +end +fn vfeed off ulong n ulong to void +for i ulong n +put Tlsin i get Vrec add off i +end +tlsinput n +end +fn vabc to void +put Tcbuf 0 97 +put Tcbuf 1 98 +put Tcbuf 2 99 +end +fn main to int +vreset +vabc +if not vrecord 0 3 23 0 +ret 1 +end +for cut ulong 26 +vreset +vfeed 0 cut +if lt cut 25 +if ne get Tlsappn 0 0 +ret 2 +end +end +vfeed cut sub ulong 25 cut +if or ne get Tlsstate 0 2 ne get Tlsappn 0 3 +ret 3 +end +if or ne get Tlsapp 0 97 ne get Tlsapp 2 99 +ret 4 +end +tlsconsume 2 +if or ne get Tlsappn 0 1 ne get Tlsapp 0 99 +ret 5 +end +if ne get Tlsapp 2 0 +ret 6 +end +end +note Coalesced records have independent sequence nonces and accumulate application data. +vreset +vabc +if not vrecord 0 3 23 0 +ret 7 +end +put Tcbuf 0 100 +put Tcbuf 1 101 +if not vrecord 25 2 23 1 +ret 8 +end +vfeed 0 get Vn 0 +if or ne get Tlsappn 0 5 ne get Tlsapp 4 101 +ret 9 +end +note Tampered tag exposes no plaintext and wipes previously queued authenticated bytes too. +vreset +put Vrec 24 xor get Vrec 24 1 +vfeed 0 25 +if or ne get Tlsstate 0 4 ne get Tlsstate 1 6 +ret 10 +end +if ne get Tlsappn 0 0 +ret 11 +end +for i ulong 128 +if ne get Tskey i 0 +ret 12 +end +end +note A fragmented handshake cannot be interleaved with application data. +vreset +put Tcbuf 0 4 +put Tcbuf 1 0 +if not vrecord 0 2 22 0 +ret 13 +end +vabc +if not vrecord 24 3 23 1 +ret 14 +end +vfeed 0 get Vn 0 +if or ne get Tlsstate 0 4 ne get Tlsstate 1 5 +ret 15 +end +note Valid NewSessionTicket split across two records is discarded without resumption. +vreset +for i ulong 8 +put Tcbuf i 0 +end +put Tcbuf 0 4 +put Tcbuf 3 14 +put Tcbuf 7 1 +if not vrecord 0 8 22 0 +ret 16 +end +for i ulong 10 +put Tcbuf i 0 +end +put Tcbuf 6 1 +put Tcbuf 7 99 +if not vrecord 30 10 22 1 +ret 17 +end +vabc +if not vrecord 62 3 23 2 +ret 18 +end +vfeed 0 get Vn 0 +if or ne get Tlsstate 0 2 ne get Tlsappn 0 3 +ret 19 +end +if ne get Tsctl 1 0 +ret 20 +end +note KeyUpdate is explicitly refused, never interpreted under stale keys. +vreset +put Tcbuf 0 24 +put Tcbuf 1 0 +put Tcbuf 2 0 +put Tcbuf 3 1 +put Tcbuf 4 0 +if not vrecord 0 5 22 0 +ret 21 +end +vfeed 0 get Vn 0 +if or ne get Tlsstate 0 4 ne get Tlsstate 1 17 +ret 22 +end +note Inner zero padding is removed; an all-zero inner plaintext has no type and is refused. +vreset +vabc +put Tcbuf 3 23 +put Tcbuf 4 0 +if not vrecord 0 5 0 0 +ret 33 +end +vfeed 0 get Vn 0 +if or ne get Tlsstate 0 2 ne get Tlsappn 0 3 +ret 34 +end +vreset +for i ulong 3 +put Tcbuf i 0 +end +if not vrecord 0 3 0 0 +ret 35 +end +vfeed 0 get Vn 0 +if or ne get Tlsstate 0 4 ne get Tlsstate 1 5 +ret 36 +end +note Authenticated close_notify, unlike transport EOF, sets cleanClose and queues response. +vreset +put Tcbuf 0 1 +put Tcbuf 1 0 +if not vrecord 0 2 21 0 +ret 23 +end +vfeed 0 get Vn 0 +if or ne get Tlsstate 0 3 ne get Tlsstate 2 1 +ret 24 +end +if ne get Tlsoutn 0 24 +ret 25 +end +note New writes and close requests do not overwrite an undelivered record. +vreset +put Tlsplain 0 65 +if not tlswrite 1 +ret 26 +end +for i ulong get Tlsoutn 0 +put Vhold i get Tlsout i +end +put Tlsplain 0 66 +if tlswrite 1 +ret 27 +end +tlsclose +if ne get Tlsoutn 0 23 +ret 28 +end +for i ulong 23 +if ne get Tlsout i get Vhold i +ret 29 +end +end +tlssent +if or ne get Tlsoutn 0 24 ne get Tlsstate 2 0 +ret 30 +end +note Sequence use is refused before overflow; no nonce wraps. +vreset +put Tsseq 0 4294967295 +if tlswrite 0 +ret 31 +end +if or ne get Tlsstate 0 4 ne get Tlsstate 1 13 +ret 32 +end +ret 0 +end diff --git a/native/omega/allen/tests/tls-session-schedule.om b/native/omega/allen/tests/tls-session-schedule.om new file mode 100644 index 00000000..85a655db --- /dev/null +++ b/native/omega/allen/tests/tls-session-schedule.om @@ -0,0 +1,128 @@ +note RFC8448 section3 independent published SHA256 schedule values. +note Concatenate production crypto, cert, tls modules then this fixture. No replacement APIs. +note RFC trace suite1301 uses the same SHA256 schedule; only its 12-byte IV is checked here. +text Vhs "1dc826e93606aa6fdc0aadc12f741b01046aa6b99f691ed221a9f0ca043fbeac" +text Vhash "860c06edc07858ee8e78f0e7428c58edd6b43f2ca3e6e95f02ed063cf0e1cad8" +text Vchs "b3eddb126e067f35a780b3abf45e2d8f3b1a950738f52e9600746a0e27a55a21" +text Vshs "b67b7d690cc16c4e75e54213cb2d37b4e9c912bcded9105d42befd59d391ad38" +text Vder "43de77e0c77713859a944db9db2590b53190a65b3ee2e4f12dd7a0bb7ce254b4" +text Vmaster "18df06843d13a08bf2a449844c5f8a478001bc4d4c627984d5a41da8d0402919" +text Vfkey "008d3b66f816ea559f96b537e885c31fc068bf492c652f01f288a1d8cdc19fc8" +text Vempty "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" +text Viv "5d313eb2671276ee13000b30" +fn vhex c uchar to uchar +if le c 57 +ret sub c 48 +end +ret add sub c 97 10 +end +fn main to int +tsclear +for i ulong 32 +p = mul i 2 +put Tssec i or shl vhex get Vhs p 4 vhex get Vhs add p 1 +put Tshash i or shl vhex get Vhash p 4 vhex get Vhash add p 1 +end +if not tsexpand 1 0 true 32 +ret 1 +end +for i ulong 32 +p = mul i 2 +b = or shl vhex get Vchs p 4 vhex get Vchs add p 1 +if ne get Tcdigest i b +ret 2 +end +end +if not tsexpand 2 0 true 32 +ret 3 +end +for i ulong 32 +p = mul i 2 +b = or shl vhex get Vshs p 4 vhex get Vshs add p 1 +if ne get Tcdigest i b +ret 4 +end +put Tssec add i 64 b +end +if not tsexpand 6 64 false 12 +ret 5 +end +for i ulong 12 +p = mul i 2 +b = or shl vhex get Viv p 4 vhex get Viv add p 1 +if ne get Tcdigest i b +ret 6 +end +end +if not tsexpand 7 64 false 32 +ret 7 +end +for i ulong 32 +p = mul i 2 +b = or shl vhex get Vfkey p 4 vhex get Vfkey add p 1 +if ne get Tcdigest i b +ret 8 +end +end +if not tsempty +ret 9 +end +for i ulong 32 +p = mul i 2 +b = or shl vhex get Vempty p 4 vhex get Vempty add p 1 +if ne get Tshash i b +ret 10 +end +end +if not tsexpand 0 0 true 32 +ret 11 +end +for i ulong 32 +p = mul i 2 +b = or shl vhex get Vder p 4 vhex get Vder add p 1 +if ne get Tcdigest i b +ret 12 +end +put Tckey i get Tcdigest i +put Tcbuf i 0 +end +if not tchmac 32 32 +ret 13 +end +for i ulong 32 +p = mul i 2 +b = or shl vhex get Vmaster p 4 vhex get Vmaster add p 1 +if ne get Tcdigest i b +ret 14 +end +end +note RFC8446 section5.3 sequence is big endian, left-padded to IV length, XOR. +for i ulong 12 +put Tsiv i uchar i +end +tsnonce 0 0 72623859790382856 +for i ulong 4 +if ne get Tciv i uchar i +ret 15 +end +end +for i ulong 8 +b = xor uchar add i 4 uchar add i 1 +if ne get Tciv add i 4 b +ret 16 +end +end +if tsexpand 5 0 false 33 +ret 17 +end +if tsexpand 5 0 false 0 +ret 18 +end +tswipe +for i ulong 192 +if ne get Tssec i 0 +ret 19 +end +end +ret 0 +end diff --git a/native/omega/allen/tests/view.om b/native/omega/allen/tests/view.om new file mode 100644 index 00000000..0cc8107f --- /dev/null +++ b/native/omega/allen/tests/view.om @@ -0,0 +1,25 @@ +text Vtext "one two three\nfour\n\nfive" +fn main to int +codebeg 1 +put C 1 1 +put C 2 len Vtext +put C 4 1 +for i ulong len Vtext +put Code i get Vtext i +end +put C 3 ulong codecrc +check rows 8 4096 901 +check eq get View 0 5 902 +check eq get Rowlen 0 8 903 +check eq get Rowlen 1 5 904 +check eq get Rowline 0 1 905 +check eq get Rowline 1 0 906 +check eq get Rowline 2 2 907 +check eq get Rowlen 3 0 908 +check eq scroll 100 2 3 909 +check eq scroll -1 2 2 910 +check eq scroll -99 2 0 911 +check not rows 0 4096 912 +check eq get View 0 5 913 +ret int get Fails 0 +end diff --git a/native/omega/allen/tls-cert.om b/native/omega/allen/tls-cert.om new file mode 100644 index 00000000..6943ef6b --- /dev/null +++ b/native/omega/allen/tls-cert.om @@ -0,0 +1,1299 @@ +note SPDX-License-Identifier: Apache-2.0 +note Bounded X509/TLS1.3 verifier for api.github.com; RFC5280,5480,5758,8446,9525. +note Supports uncompressed named P256/P384 and ECDSA-SHA256/P256 or ECDSA-SHA384/P384. +note No AIA, CRL/OCSP fetching, RSA, SHA1, explicit curves, policy/name constraints or fallback. +note Unsupported critical extensions and constrained CA paths fail closed, even if noncritical. +note Up to8 peer certificates, each <=8192 bytes, TLS body <=60000,32 extensions/certificate. +note Exact DER issuer/subject matching is deliberately conservative; no ambiguous normalization. +note Trust anchor is the local OS Sectigo Public Server Authentication Root E46 certificate. +note Source /etc/ssl/certs/Sectigo_Public_Server_Authentication_Root_E46.pem, read2026-10-25. +note DER SHA256 C90F26F0FB1B4018B22227519B5CA2B53E2CA5B3BE5CF18EFE1BEF47380C5383. +note Trust is in this root, never in a downloaded self-signed or leaf certificate. +note Root cross-signatures need not validate: path terminates at the locally trusted subject/key. +note Caller must supply trustworthy current Unix seconds. No network time or zero-time bypass. +global Certbuf uchar 65536 +global Certlen ulong 1 +global Certnow ulong 1 +global Certkey uchar 65 +global Cleaf uchar 65 +global Certmsg uchar 4096 +global Certsig uchar 128 +global Cready ulong 1 +global Cd ulong 4 +global Cm ulong 288 +global Ce ulong 64 +global Cen ulong 1 +global Ckey uchar 97 +global Csig uchar 96 +global Chash uchar 48 +global Ctime ulong 8 +global Cchain ulong 8 +global Ccount ulong 1 +text Chost "api.github.com" +text Cwild "*.github.com" + +note Cd: tag,value-start,end. Definite minimal DER only, bounds checked before every access. +fn ctder p ulong e ulong to bool +if or gt e 65536 ge p e +ret false +end +if lt sub e p 2 +ret false +end +t = get Certbuf p +if or eq and t 31 31 eq t 0 +ret false +end +p = add p 1 +n = ulong get Certbuf p +p = add p 1 +if ge n 128 +k = sub n 128 +if or eq k 0 gt k 3 +ret false +end +if gt k sub e p +ret false +end +if eq get Certbuf p 0 +ret false +end +n = 0 +for j ulong k +n = or shl n 8 ulong get Certbuf add p j +end +p = add p k +if lt n 128 +ret false +end +end +if gt n sub e p +ret false +end +put Cd 0 ulong t +put Cd 1 p +put Cd 2 add p n +ret true +end + +fn cttake p ulong e ulong t ulong to bool +if not ctder p e +ret false +end +ret eq get Cd 0 t +end + +fn ctequal a ulong ae ulong b ulong be ulong to bool +if ne sub ae a sub be b +ret false +end +x = uchar 0 +for i ulong sub ae a +u = get Certbuf add a i +v = get Certbuf add b i +x = or x xor u v +end +ret eq x 0 +end + +note Minimal nonnegative DER INTEGER; zero optionally allowed by caller. +fn ctint p ulong e ulong to bool +if ge p e +ret false +end +if ge get Certbuf p 128 +ret false +end +if gt sub e p 1 +if eq get Certbuf p 0 +if lt get Certbuf add p 1 128 +ret false +end +end +end +ret true +end + +note OIDs are canonical base128 subidentifiers; max32 octets in this bounded profile. +fn ctoid p ulong e ulong to bool +if or ge p e gt sub e p 32 +ret false +end +fresh = true +for i ulong sub e p +c = get Certbuf add p i +if and fresh eq c 128 +ret false +end +fresh = eq and c 128 0 +end +ret fresh +end + +fn ctnum p ulong n ulong to ulong +v = ulong 0 +for i ulong n +c = get Certbuf add p i +if or lt c 48 gt c 57 +ret 10000 +end +v = add mul v 10 sub ulong c 48 +end +ret v +end + +fn ctleap y ulong to bool +ret and eq rem y 4 0 or ne rem y 100 0 eq rem y 400 0 +end + +fn ctmonth y ulong m ulong to ulong +if eq m 2 +if ctleap y +ret 29 +end +ret 28 +end +if or or eq m 4 eq m 6 or eq m 9 eq m 11 +ret 30 +end +ret 31 +end + +note Absolute Gregorian seconds since 0001-01-01 avoids negative Unix conversions. +fn cttime p ulong e ulong to bool +if not ctder p e +ret false +end +p = get Cd 1 +n = sub get Cd 2 p +y = ulong 0 +if eq get Cd 0 23 +if ne n 13 +ret false +end +y = ctnum p 2 +if gt y 99 +ret false +end +if lt y 50 +y = add y 2000 +else +y = add y 1900 +end +p = add p 2 +else +if ne get Cd 0 24 +ret false +end +if ne n 15 +ret false +end +y = ctnum p 4 +if or lt y 2050 gt y 9999 +ret false +end +p = add p 4 +end +if ne get Certbuf add p 10 90 +ret false +end +put Ctime 0 y +for i ulong 5 +put Ctime add i 1 ctnum add p mul i 2 2 +end +ret true +end + +fn ctepoch to ulong +y = get Ctime 0 +m = get Ctime 1 +d = get Ctime 2 +if or lt m 1 gt m 12 +ret 0 +end +if or lt d 1 gt d ctmonth y m +ret 0 +end +if gt get Ctime 3 23 +ret 0 +end +if gt get Ctime 4 59 +ret 0 +end +if gt get Ctime 5 59 +ret 0 +end +y = sub y 1 +days = add mul y 365 div y 4 +days = sub days div y 100 +days = add days div y 400 +y = add y 1 +for i ulong sub m 1 +days = add days ctmonth y add i 1 +end +days = add days sub d 1 +v = add mul days 24 get Ctime 3 +v = add mul v 60 get Ctime 4 +ret add mul v 60 get Ctime 5 +end + +fn ctvalid b ulong p ulong e ulong to bool +if not cttake p e 48 +ret false +end +p = get Cd 1 +e = get Cd 2 +if not cttime p e +ret false +end +p = get Cd 2 +put Cm add b 11 ctepoch +if eq get Cm add b 11 0 +ret false +end +if not cttime p e +ret false +end +if ne get Cd 2 e +ret false +end +put Cm add b 12 ctepoch +ret ge get Cm add b 12 get Cm add b 11 +end + +note Signature AlgorithmIdentifier requires absent parameters (RFC5758 section3.2). +fn ctalg p ulong e ulong to ulong +if not cttake p e 48 +ret 0 +end +p = get Cd 1 +e = get Cd 2 +if not cttake p e 6 +ret 0 +end +p = get Cd 1 +if or ne get Cd 2 e ne sub e p 8 +ret 0 +end +if ne get Certbuf p 42 +ret 0 +end +if or ne get Certbuf add p 1 134 ne get Certbuf add p 2 72 +ret 0 +end +if or ne get Certbuf add p 3 206 ne get Certbuf add p 4 61 +ret 0 +end +if or ne get Certbuf add p 5 4 ne get Certbuf add p 6 3 +ret 0 +end +if eq get Certbuf add p 7 2 +ret 32 +end +if eq get Certbuf add p 7 3 +ret 48 +end +ret 0 +end + +note Name RDN/ATV syntax is checked; supported directory strings only. Empty subject is handled by SAN. +fn ctattr p ulong e ulong to bool +if not cttake p e 6 +ret false +end +if not ctoid get Cd 1 get Cd 2 +ret false +end +p = get Cd 2 +if not ctder p e +ret false +end +if ne get Cd 2 e +ret false +end +t = get Cd 0 +if not or or eq t 12 eq t 19 or eq t 20 or eq t 22 eq t 30 +ret false +end +ret gt get Cd 2 get Cd 1 +end + +fn ctname p ulong e ulong to bool +if not cttake p e 48 +ret false +end +p = get Cd 1 +e = get Cd 2 +while lt p e bound 4096 +if not cttake p e 49 +ret false +end +q = get Cd 1 +r = get Cd 2 +if eq q r +ret false +end +p = r +while lt q r bound 4096 +if not cttake q r 48 +ret false +end +q = get Cd 2 +if not ctattr get Cd 1 q +ret false +end +end +end +ret eq p e +end + +note Exact ecPublicKey OID and named curves; no explicit/implicit parameters. +fn ctcurve p ulong e ulong to ulong +if not cttake p e 48 +ret 0 +end +p = get Cd 1 +e = get Cd 2 +if not cttake p e 6 +ret 0 +end +p = get Cd 1 +if ne sub get Cd 2 p 7 +ret 0 +end +if or ne get Certbuf p 42 ne get Certbuf add p 1 134 +ret 0 +end +if or ne get Certbuf add p 2 72 ne get Certbuf add p 3 206 +ret 0 +end +if or ne get Certbuf add p 4 61 ne get Certbuf add p 5 2 +ret 0 +end +if ne get Certbuf add p 6 1 +ret 0 +end +p = get Cd 2 +if not cttake p e 6 +ret 0 +end +p = get Cd 1 +if ne get Cd 2 e +ret 0 +end +if eq sub e p 5 +if or ne get Certbuf p 43 ne get Certbuf add p 1 129 +ret 0 +end +if or ne get Certbuf add p 2 4 ne get Certbuf add p 3 0 +ret 0 +end +if eq get Certbuf add p 4 34 +ret 48 +end +ret 0 +end +if ne sub e p 8 +ret 0 +end +if or ne get Certbuf p 42 ne get Certbuf add p 1 134 +ret 0 +end +if or ne get Certbuf add p 2 72 ne get Certbuf add p 3 206 +ret 0 +end +if or ne get Certbuf add p 4 61 ne get Certbuf add p 5 3 +ret 0 +end +if or ne get Certbuf add p 6 1 ne get Certbuf add p 7 7 +ret 0 +end +ret 32 +end + +fn ctspki b ulong p ulong e ulong to bool +if not cttake p e 48 +ret false +end +p = get Cd 1 +e = get Cd 2 +k = ctcurve p e +if eq k 0 +ret false +end +p = get Cd 2 +if not cttake p e 3 +ret false +end +p = get Cd 1 +if ne get Cd 2 e +ret false +end +if ne sub e p add mul k 2 2 +ret false +end +if ne get Certbuf p 0 +ret false +end +p = add p 1 +if ne get Certbuf p 4 +ret false +end +put Cm add b 7 p +put Cm add b 8 sub e p +put Cm add b 24 k +ret true +end + +note Canonical BIT STRING with at most9 defined KeyUsage bits, named-bit trailing zeros trimmed. +fn ctusage b ulong p ulong e ulong to bool +if not cttake p e 3 +ret false +end +p = get Cd 1 +if ne get Cd 2 e +ret false +end +n = sub e p +if or lt n 2 gt n 3 +ret false +end +u = ulong get Certbuf p +if gt u 7 +ret false +end +last = ulong get Certbuf sub e 1 +if eq last 0 +ret false +end +if ne and last sub shl ulong 1 u 1 0 +ret false +end +if eq and shr last u 1 0 +ret false +end +if eq n 3 +if or ne u 7 ne last 128 +ret false +end +end +put Cm add b 15 ulong get Certbuf add p 1 +put Cm add b 16 1 +ret true +end + +fn ctbasic b ulong p ulong e ulong crit bool to bool +if not cttake p e 48 +ret false +end +p = get Cd 1 +if ne get Cd 2 e +ret false +end +put Cm add b 20 1 +if crit +put Cm add b 21 1 +end +if eq p e +ret true +end +if not cttake p e 1 +ret false +end +if ne sub get Cd 2 get Cd 1 1 +ret false +end +if ne get Certbuf get Cd 1 255 +ret false +end +put Cm add b 13 1 +p = get Cd 2 +if eq p e +ret true +end +if not cttake p e 2 +ret false +end +p = get Cd 1 +if ne get Cd 2 e +ret false +end +if not ctint p e +ret false +end +if gt sub e p 2 +ret false +end +v = ulong 0 +for i ulong sub e p +v = or shl v 8 ulong get Certbuf add p i +end +put Cm add b 14 v +ret true +end + +fn ctdns p ulong e ulong to bool +n = sub e p +if or eq n 0 gt n 253 +ret false +end +for i ulong n +c = get Certbuf add p i +if or eq c 0 ge c 128 +ret false +end +end +if eq n len Chost +ok = true +for j ulong n +c = get Certbuf add p j +if and ge c 65 le c 90 +c = add c 32 +end +if ne c get Chost j +ok = false +end +end +ret ok +end +if eq n len Cwild +ok = true +for j ulong n +c = get Certbuf add p j +if and ge c 65 le c 90 +c = add c 32 +end +if ne c get Cwild j +ok = false +end +end +ret ok +end +ret false +end + +note GeneralName CHOICE tags other than dNSName: [0] [1] [3]-[8] (RFC5280 4.2.1.6). +fn ctgname t ulong to bool +if or eq t 160 eq t 129 +ret true +end +if and ge t 163 le t 165 +ret true +end +ret and ge t 134 le t 136 +end + +fn ctsan b ulong p ulong e ulong to bool +if not cttake p e 48 +ret false +end +p = get Cd 1 +if or ne get Cd 2 e eq p e +ret false +end +put Cm add b 23 1 +while lt p e bound 4096 +if not ctder p e +ret false +end +p = get Cd 2 +t = get Cd 0 +if eq t 130 +if ctdns get Cd 1 p +put Cm add b 18 1 +end +else +note The required identity is DNS. Other legal GeneralName alternatives never match it. +if not ctgname t +ret false +end +end +end +ret eq p e +end + +fn cteku b ulong p ulong e ulong to bool +if not cttake p e 48 +ret false +end +p = get Cd 1 +if or ne get Cd 2 e eq p e +ret false +end +put Cm add b 22 1 +put Cm add b 17 0 +while lt p e bound 4096 +if not cttake p e 6 +ret false +end +p = get Cd 1 +q = get Cd 2 +if not ctoid p q +ret false +end +if eq sub q p 8 +if and eq get Certbuf p 43 eq get Certbuf add p 1 6 +if and eq get Certbuf add p 2 1 eq get Certbuf add p 3 5 +if and eq get Certbuf add p 4 5 eq get Certbuf add p 5 7 +if and eq get Certbuf add p 6 3 eq get Certbuf add p 7 1 +put Cm add b 17 1 +end +end +end +end +end +p = q +end +ret eq p e +end + +note Duplicate extension OIDs, including unknown ones, are refused before interpretation. +fn ctunique p ulong e ulong to bool +if not ctoid p e +ret false +end +n = get Cen 0 +if ge n 32 +ret false +end +for i ulong n +if ctequal p e get Ce mul i 2 get Ce add mul i 2 1 +ret false +end +end +put Ce mul n 2 p +put Ce add mul n 2 1 e +put Cen 0 add n 1 +ret true +end + +fn ctextval b ulong id ulong p ulong e ulong crit bool to bool +if eq id 19 +ret ctbasic b p e crit +end +if eq id 15 +ret ctusage b p e +end +if eq id 17 +ret ctsan b p e +end +if eq id 37 +ret cteku b p e +end +note Constraints needing further path processing cannot be silently ignored even if noncritical. +if or or eq id 30 eq id 33 or eq id 36 eq id 54 +ret false +end +if crit +ret false +end +ret true +end + +fn ctextone b ulong p ulong e ulong to bool +if not cttake p e 6 +ret false +end +p = get Cd 1 +q = get Cd 2 +if not ctunique p q +ret false +end +id = ulong 0 +if eq sub q p 3 +if and eq get Certbuf p 85 eq get Certbuf add p 1 29 +id = ulong get Certbuf add p 2 +end +end +p = q +crit = false +if not ctder p e +ret false +end +if eq get Cd 0 1 +if ne sub get Cd 2 get Cd 1 1 +ret false +end +if ne get Certbuf get Cd 1 255 +ret false +end +crit = true +p = get Cd 2 +end +if not cttake p e 4 +ret false +end +p = get Cd 1 +if ne get Cd 2 e +ret false +end +ret ctextval b id p e crit +end + +fn ctexts b ulong p ulong e ulong to bool +if not cttake p e 163 +ret false +end +p = get Cd 1 +if ne get Cd 2 e +ret false +end +if not cttake p e 48 +ret false +end +p = get Cd 1 +if or ne get Cd 2 e eq p e +ret false +end +put Cen 0 0 +while lt p e bound 4096 +if not cttake p e 48 +ret false +end +p = get Cd 2 +if not ctextone b get Cd 1 p +ret false +end +end +ret eq p e +end + +fn ctfront b ulong p ulong e ulong to ulong +if not cttake p e 160 +ret 0 +end +q = get Cd 1 +p = get Cd 2 +if not cttake q p 2 +ret 0 +end +if or ne get Cd 2 p ne sub p get Cd 1 1 +ret 0 +end +if ne get Certbuf get Cd 1 2 +ret 0 +end +if not cttake p e 2 +ret 0 +end +q = get Cd 1 +p = get Cd 2 +if not ctint q p +ret 0 +end +if or gt sub p q 21 eq sub p q 0 +ret 0 +end +if and eq sub p q 21 ne get Certbuf q 0 +ret 0 +end +v = uchar 0 +for i ulong sub p q +v = or v get Certbuf add q i +end +if eq v 0 +ret 0 +end +put Cm add b 2 ctalg p e +if eq get Cm add b 2 0 +ret 0 +end +ret get Cd 2 +end + +fn ctfields b ulong p ulong e ulong to ulong +put Cm add b 3 p +if not cttake p e 48 +ret 0 +end +p = get Cd 2 +put Cm add b 4 p +if not ctname get Cm add b 3 p +ret 0 +end +if not cttake p e 48 +ret 0 +end +q = get Cd 2 +if not ctvalid b p q +ret 0 +end +p = q +put Cm add b 5 p +if not cttake p e 48 +ret 0 +end +p = get Cd 2 +put Cm add b 6 p +if not ctname get Cm add b 5 p +ret 0 +end +if not cttake p e 48 +ret 0 +end +q = get Cd 2 +if not ctspki b p q +ret 0 +end +ret q +end + +fn ctparse idx ulong p ulong e ulong to bool +b = mul idx 32 +for i ulong 32 +put Cm add b i 0 +end +put Cm add b 14 8 +put Cm add b 17 1 +if not cttake p e 48 +ret false +end +if ne get Cd 2 e +ret false +end +p = get Cd 1 +put Cm b p +if not cttake p e 48 +ret false +end +q = get Cd 2 +put Cm add b 1 q +p = ctfront b get Cd 1 q +if eq p 0 +ret false +end +p = ctfields b p q +if eq p 0 +ret false +end +if lt p q +if not ctexts b p q +ret false +end +end +p = q +if ne ctalg p e get Cm add b 2 +ret false +end +p = get Cd 2 +if not cttake p e 3 +ret false +end +p = get Cd 1 +if or ne get Cd 2 e ge p e +ret false +end +if ne get Certbuf p 0 +ret false +end +put Cm add b 9 add p 1 +put Cm add b 10 e +put Cm add b 25 1 +ret true +end + +fn ctrawint p ulong e ulong width ulong off ulong to bool +if not ctint p e +ret false +end +if eq get Certbuf p 0 +p = add p 1 +end +n = sub e p +if or eq n 0 gt n width +ret false +end +for i ulong n +put Csig add off add sub width n i get Certbuf add p i +end +ret true +end + +fn ctrawsig p ulong e ulong width ulong to bool +for i ulong 96 +put Csig i 0 +end +if not cttake p e 48 +ret false +end +p = get Cd 1 +if ne get Cd 2 e +ret false +end +if not cttake p e 2 +ret false +end +p = get Cd 1 +q = get Cd 2 +if not ctrawint p q width 0 +ret false +end +if not cttake q e 2 +ret false +end +p = get Cd 1 +if ne get Cd 2 e +ret false +end +ret ctrawint p e width width +end + +fn ctsha256 p ulong e ulong to void +constants +hinit +for i ulong sub e p +hbyte get Certbuf add p i +end +finish +for j ulong 32 +put Chash j get Hash j +end +end + +fn ctsha384 p ulong e ulong to void +m = new uchar 65536 0 +d = new uchar 64 0 +for i ulong sub e p +put m i get Certbuf add p i +end +cs384hash m sub e p d +for j ulong 48 +put Chash j get d j +end +end + +fn ctvp256 to bool +w = new ulong 1024 0 +b = new uchar 4096 0 +for i ulong 65 +put b add 3072 i get Ckey i +end +for j ulong 64 +put b add 3200 j get Csig j +end +for k ulong 32 +put b add 3296 k get Chash k +end +cp2init w +ret eq cp2vrfy w b 1 +end + +fn ctvp384 to bool +w = new ulong 1536 0 +b = new uchar 4096 0 +for i ulong 97 +put b add 3072 i get Ckey i +end +for j ulong 96 +put b add 3200 j get Csig j +end +for k ulong 48 +put b add 3296 k get Chash k +end +cp3init w +ret eq cp3vrfy w b 1 +end + +fn ctchecksig child ulong issuer ulong to bool +c = mul child 32 +b = mul issuer 32 +width = get Cm add c 2 +if ne width get Cm add b 24 +ret false +end +if not ctrawsig get Cm add c 9 get Cm add c 10 width +ret false +end +ko = get Cm add b 7 +kn = get Cm add b 8 +for i ulong kn +put Ckey i get Certbuf add ko i +end +if eq width 32 +ctsha256 get Cm c get Cm add c 1 +ret ctvp256 +end +ctsha384 get Cm c get Cm add c 1 +ret ctvp384 +end + +fn ctclock idx ulong to bool +b = mul idx 32 +if gt get Certnow 0 253402300799 +ret false +end +now = add get Certnow 0 62135596800 +ret and ge now get Cm add b 11 le now get Cm add b 12 +end + +fn ctca idx ulong below ulong to bool +b = mul idx 32 +if not ctclock idx +ret false +end +if or ne get Cm add b 13 1 ne get Cm add b 21 1 +ret false +end +if or ne get Cm add b 16 1 eq and get Cm add b 15 4 0 +ret false +end +if gt below get Cm add b 14 +ret false +end +ret eq get Cm add b 17 1 +end + +fn ctleaf to bool +if not ctclock 0 +ret false +end +if ne get Cm 24 32 +ret false +end +if ne get Cm 13 0 +ret false +end +if or ne get Cm 16 1 eq and get Cm 15 128 0 +ret false +end +if ne and get Cm 15 4 0 +ret false +end +if or ne get Cm 22 1 ne get Cm 17 1 +ret false +end +if or ne get Cm 23 1 ne get Cm 18 1 +ret false +end +w = new ulong 1024 0 +b = new uchar 4096 0 +cp2init w +for i ulong 65 +put b add 3072 i get Certbuf add get Cm 7 i +end +cp2ld w C2X b 3073 +cp2ld w C2Y b 3105 +ret cp2oncv w +end + +fn certreset to void +put Cready 0 0 +for i ulong 65 +put Certkey i 0 +put Cleaf i 0 +end +for i ulong 97 +put Ckey i 0 +end +for i ulong 96 +put Csig i 0 +end +for i ulong 48 +put Chash i 0 +end +for i ulong 4096 +put Certmsg i 0 +end +for i ulong 128 +put Certsig i 0 +end +for i ulong 288 +put Cm i 0 +end +for i ulong 64 +put Ce i 0 +end +for i ulong 8 +put Cchain i 0 +put Ctime i 0 +end +put Cen 0 0 +put Ccount 0 0 +end + +fn ctbe p ulong n ulong to ulong +v = ulong 0 +for i ulong n +v = or shl v 8 ulong get Certbuf add p i +end +ret v +end + +note Certificate-entry extensions are not negotiated by this client; unsolicited ones fail closed. +fn ctlist to bool +e = get Certlen 0 +if or lt e 4 gt e 60000 +ret false +end +if ne get Certbuf 0 0 +ret false +end +if ne ctbe 1 3 sub e 4 +ret false +end +p = ulong 4 +n = ulong 0 +while lt p e bound 9 +if or ge n 8 lt sub e p 5 +ret false +end +k = ctbe p 3 +p = add p 3 +if or eq k 0 gt k 8192 +ret false +end +if gt k sub e p +ret false +end +q = add p k +note Unused extra certificates may use unsupported algorithms; only parsed ones can be issuers. +if not ctparse n p q +if eq n 0 +ret false +end +end +p = q +if lt sub e p 2 +ret false +end +if ne ctbe p 2 0 +ret false +end +p = add p 2 +n = add n 1 +end +put Ccount 0 n +ret and eq p e gt n 0 +end + +note Path building uses only supplied certificates plus the local root. Anchor is tried first. +note Child's exact issuer Name DER equals candidate parent's subject Name DER. +fn ctissued child ulong parent ulong to bool +c = mul child 32 +q = mul parent 32 +ret ctequal get Cm add c 3 get Cm add c 4 get Cm add q 5 get Cm add q 6 +end + +fn ctpath to bool +if not ctleaf +ret false +end +idx = ulong 0 +below = ulong 0 +for depth ulong 8 +if ne get Cchain idx 0 +ret false +end +put Cchain idx 1 +if ctissued idx 8 +if not ctca 8 below +ret false +end +ret ctchecksig idx 8 +end +next = ulong 8 +for j ulong get Ccount 0 +ok = eq get Cm add mul j 32 25 1 +if and ok ctissued idx j +if ne next 8 +ret false +end +next = j +end +end +if eq next 8 +ret false +end +if not ctca next below +ret false +end +if not ctchecksig idx next +ret false +end +idx = next +below = add below 1 +end +ret false +end + +fn cthexv c uchar to uchar +if and ge c 48 le c 57 +ret sub c 48 +end +if and ge c 97 le c 102 +ret sub c 87 +end +trap 5 +end + +note Decode vendor/cert-root.om Croot to Certbuf 64000..64574, above every accepted peer byte. +fn ctroot to bool +if ne len Croot 1148 +ret false +end +for i ulong 574 +h = cthexv get Croot mul i 2 +l = cthexv get Croot add mul i 2 1 +put Certbuf add 64000 i or shl h 4 l +end +ret true +end + +fn certcheck to bool +certreset +if not ctroot +ret false +end +note The DER root is local and already trusted; parsing only exposes its subject, key and limits. +if not ctparse 8 64000 64574 +ret false +end +if not ctlist +ret false +end +if not ctpath +ret false +end +for i ulong 65 +put Certkey i get Certbuf add get Cm 7 i +put Cleaf i get Certkey i +end +put Cready 0 1 +ret true +end + +note TLS CertificateVerify: current validated leaf required, DER signature and SHA256 message. +fn certsig n ulong siglen ulong to bool +if ne get Cready 0 1 +ret false +end +if or gt n 4096 or eq siglen 0 gt siglen 128 +certreset +ret false +end +for i ulong siglen +put Certbuf add 60000 i get Certsig i +end +if not ctrawsig 60000 add 60000 siglen 32 +certreset +ret false +end +constants +hinit +for j ulong n +hbyte get Certmsg j +end +finish +for k ulong 32 +put Chash k get Hash k +end +note Private copy: later caller writes to exported Certkey cannot change the authenticated key. +for m ulong 65 +put Ckey m get Cleaf m +end +ok = ctvp256 +if not ok +certreset +end +ret ok +end diff --git a/native/omega/allen/tls-crypto.om b/native/omega/allen/tls-crypto.om new file mode 100644 index 00000000..f19b9bfc --- /dev/null +++ b/native/omega/allen/tls-crypto.om @@ -0,0 +1,628 @@ +note SPDX-License-Identifier: AGPL-3.0-or-later +note Allen bounded TLS cryptography. Concatenate vendor/sha256-core.om before this unit. +note SHA256 reuses the existing first-party core and its provenance/license unchanged. +note X25519 follows RFC7748 sections 5/6 and native/net/x25519.c's Montgomery ladder. +note Unsigned radix-65536 field representation follows the first-party omnet field bounds; +note no verification-only branches, allocations, or point routines are reused. +note ChaCha20/Poly1305 are implemented from RFC8439 sections 2.1/2.3/2.5/2.8 equations. +note uint arithmetic wraps modulo 2^32 per OMEGESE 9.3; narrowing conversions are masked. +note No secret-indexed accesses or secret-dependent loop counts. Compiler/machine timing is unaudited. +note Single caller, nonreentrant; all input/output arrays are disjoint fixed globals, no caller aliases. +note Caller owns key/nonce uniqueness and entropy. Public calls preserve key/private input until tcwipe. +note tcsha/tchmac preserve Tcbuf; tcopen verifies the full tag BEFORE touching ciphertext. +note All public bool functions reject invalid lengths. HMAC accepts keys of 0..32 bytes only. +note HKDF-Extract/Expand RFC5869 is composed by tls.om using tchmac. +note Scratch globals are wiped after calls. tcwipe also clears caller-visible secrets and plaintext. + +global Tcbuf uchar 65536 +global Tckey uchar 32 +global Tciv uchar 12 +global Tcaad uchar 32 +global Tctag uchar 16 +global Tcdigest uchar 32 +global Tcxpriv uchar 32 +global Tcxpub uchar 32 +global Tcxpeer uchar 32 +global Tcxshare uchar 32 + +global Tchi uchar 32 +global Tcxf ulong 176 +global Tcxt ulong 32 +global Tcxsc uchar 32 +global Tcxres uchar 32 +global Tccs uint 16 +global Tccw uint 16 +global Tccblk uchar 64 +global Tcmkey uchar 32 +global Tcmblk uchar 16 +global Tcmtag uchar 16 +global Tcmr ulong 10 +global Tcmh ulong 10 +global Tcmt ulong 10 +global Tcmg ulong 10 + +fn tcshwipe to void +for i ulong 8 +put H i 0 +put Vv i 0 +end +for i ulong 64 +put W i 0 +put Hb i 0 +end +put Hs 0 0 +put Hs 1 0 +for i ulong 32 +put Hash i 0 +put Tchi i 0 +end +end + +fn tcsha n ulong to bool +for i ulong 32 +put Tcdigest i 0 +end +tcshwipe +if gt n 65536 +ret false +end +constants +hinit +for i ulong n +hbyte get Tcbuf i +end +finish +for i ulong 32 +put Tcdigest i get Hash i +end +tcshwipe +ret true +end + +fn tchmac keylen ulong n ulong to bool +for i ulong 32 +put Tcdigest i 0 +end +tcshwipe +if or gt keylen 32 gt n 65536 +ret false +end +constants +hinit +for i ulong 64 +v = uchar 54 +if lt i keylen +v = xor v get Tckey i +end +hbyte v +end +for i ulong n +hbyte get Tcbuf i +end +finish +for i ulong 32 +put Tchi i get Hash i +end +hinit +for i ulong 64 +v = uchar 92 +if lt i keylen +v = xor v get Tckey i +end +hbyte v +end +for i ulong 32 +hbyte get Tchi i +end +finish +for i ulong 32 +put Tcdigest i get Hash i +end +tcshwipe +ret true +end + +note Field slots: x0,a16,b32,c48,d64,e80,f96,k112,inverse128,canonical144,subtract160. +note A mul input limb is below 2^21; folded convolution below 2^52, so ulong never overflows. +note Mul gives limbs <=65535 except limb0<=65573. Sub adds 8p, keeping intermediates positive. +fn tcxwipe to void +for i ulong 176 +put Tcxf i 0 +end +for i ulong 32 +put Tcxt i 0 +put Tcxsc i 0 +put Tcxres i 0 +end +end + +fn tcfcopy o ulong a ulong to void +for i ulong 16 +put Tcxf add o i get Tcxf add a i +end +end + +fn tcfadd o ulong a ulong b ulong to void +for i ulong 16 +v = add get Tcxf add a i get Tcxf add b i +put Tcxf add o i v +end +end + +fn tcfprime i ulong to ulong +if eq i 0 +ret 65517 +end +if eq i 15 +ret 32767 +end +ret 65535 +end + +fn tcfsub o ulong a ulong b ulong to void +for i ulong 16 +v = add get Tcxf add a i mul tcfprime i 8 +put Tcxf add o i sub v get Tcxf add b i +end +end + +fn tcfcarry o ulong to void +for i ulong 15 +p = add o i +v = get Tcxf p +put Tcxf add p 1 add get Tcxf add p 1 shr v 16 +put Tcxf p and v 65535 +end +v = get Tcxf add o 15 +put Tcxf add o 15 and v 65535 +put Tcxf o add get Tcxf o mul shr v 16 38 +end + +fn tcfmul o ulong a ulong b ulong to void +for i ulong 32 +put Tcxt i 0 +end +for i ulong 16 +x = get Tcxf add a i +for j ulong 16 +p = add i j +v = mul x get Tcxf add b j +put Tcxt p add get Tcxt p v +end +end +for i ulong 15 +v = add get Tcxt i mul 38 get Tcxt add i 16 +put Tcxf add o i v +end +put Tcxf add o 15 get Tcxt 15 +tcfcarry o +tcfcarry o +end + +fn tcfswap a ulong b ulong bit ulong to void +mask = sub ulong 0 bit +for i ulong 16 +x = get Tcxf add a i +y = get Tcxf add b i +v = and mask xor x y +put Tcxf add a i xor x v +put Tcxf add b i xor y v +end +end + +fn tcflad bit ulong to void +tcfswap 16 32 bit +tcfswap 48 64 bit +tcfadd 80 16 48 +tcfsub 16 16 48 +tcfadd 48 32 64 +tcfsub 32 32 64 +tcfmul 64 80 80 +tcfmul 96 16 16 +tcfmul 16 48 16 +tcfmul 48 32 80 +tcfadd 80 16 48 +tcfsub 16 16 48 +tcfmul 32 16 16 +tcfsub 48 64 96 +tcfmul 16 48 112 +tcfadd 16 16 64 +tcfmul 48 48 16 +tcfmul 16 64 96 +tcfmul 64 32 0 +tcfmul 32 80 80 +tcfswap 16 32 bit +tcfswap 48 64 bit +end + +fn tcfinv to void +tcfcopy 128 48 +for i ulong 254 +j = sub 253 i +tcfmul 128 128 128 +note Branch uses fixed public exponent p-2, not any secret bit. +if and ne j 2 ne j 4 +tcfmul 128 128 48 +end +end +tcfmul 16 16 128 +end + +fn tcfpack to void +tcfcopy 144 16 +tcfcarry 144 +tcfcarry 144 +tcfcarry 144 +for j ulong 2 +borrow = ulong 0 +for i ulong 16 +v = add get Tcxf add 144 i 65536 +v = sub sub v tcfprime i borrow +put Tcxf add 160 i and v 65535 +borrow = sub 1 shr v 16 +end +tcfswap 144 160 sub 1 borrow +end +for i ulong 16 +v = get Tcxf add 144 i +put Tcxres mul i 2 uchar and v 255 +put Tcxres add mul i 2 1 uchar and shr v 8 255 +end +end + +fn tcxrun base bool to bool +tcxwipe +for i ulong 32 +put Tcxsc i get Tcxpriv i +end +put Tcxsc 0 and get Tcxsc 0 248 +put Tcxsc 31 or and get Tcxsc 31 127 64 +if base +put Tcxf 0 9 +else +for i ulong 16 +v = ulong get Tcxpeer mul i 2 +v = or v shl ulong get Tcxpeer add mul i 2 1 8 +put Tcxf i v +end +put Tcxf 15 and get Tcxf 15 32767 +end +tcfcopy 32 0 +put Tcxf 16 1 +put Tcxf 64 1 +put Tcxf 112 56129 +put Tcxf 113 1 +for i ulong 255 +j = sub 254 i +v = ulong get Tcxsc div j 8 +tcflad and shr v rem j 8 1 +end +tcfinv +tcfpack +acc = uchar 0 +for i ulong 32 +acc = or acc get Tcxres i +end +ret ne acc 0 +end + +fn tcx25519 to bool +ok = tcxrun false +for i ulong 32 +put Tcxshare i get Tcxres i +end +tcxwipe +ret ok +end + +fn tcxpublic to bool +ok = tcxrun true +for i ulong 32 +put Tcxpub i get Tcxres i +end +tcxwipe +ret ok +end + +fn tccwipe to void +for i ulong 16 +put Tccs i 0 +put Tccw i 0 +put Tcmblk i 0 +put Tcmtag i 0 +end +for i ulong 64 +put Tccblk i 0 +end +for i ulong 32 +put Tcmkey i 0 +end +for i ulong 10 +put Tcmr i 0 +put Tcmh i 0 +put Tcmt i 0 +put Tcmg i 0 +end +end + +fn tclrot x uint n uint to uint +ret or shl x n shr x sub 32 n +end + +fn tccqr a ulong b ulong c ulong d ulong to void +put Tccw a add get Tccw a get Tccw b +put Tccw d tclrot xor get Tccw d get Tccw a 16 +put Tccw c add get Tccw c get Tccw d +put Tccw b tclrot xor get Tccw b get Tccw c 12 +put Tccw a add get Tccw a get Tccw b +put Tccw d tclrot xor get Tccw d get Tccw a 8 +put Tccw c add get Tccw c get Tccw d +put Tccw b tclrot xor get Tccw b get Tccw c 7 +end + +fn tccinit to void +put Tccs 0 1634760805 +put Tccs 1 857760878 +put Tccs 2 2036477234 +put Tccs 3 1797285236 +for i ulong 8 +v = uint 0 +for j ulong 4 +b = uint get Tckey add mul i 4 j +v = or v shl b mul j 8 +end +put Tccs add i 4 v +end +for i ulong 3 +v = uint 0 +for j ulong 4 +b = uint get Tciv add mul i 4 j +v = or v shl b mul j 8 +end +put Tccs add i 13 v +end +end + +fn tccgen ctr uint to void +put Tccs 12 ctr +for i ulong 16 +put Tccw i get Tccs i +end +for i ulong 10 +tccqr 0 4 8 12 +tccqr 1 5 9 13 +tccqr 2 6 10 14 +tccqr 3 7 11 15 +tccqr 0 5 10 15 +tccqr 1 6 11 12 +tccqr 2 7 8 13 +tccqr 3 4 9 14 +end +for i ulong 16 +v = add get Tccw i get Tccs i +for j ulong 4 +put Tccblk add mul i 4 j uchar and shr v mul j 8 255 +end +end +end + +note Standalone block entry for primitive qualification; AEAD initializes the key only once. +fn tccblock ctr uint to void +tccinit +tccgen ctr +end + +note At most 1024 payload blocks: counters 1..1024, never 0 or a wrapped uint. +fn tccxor n ulong to void +p = ulong 0 +ctr = uint 1 +while lt p n bound 1024 +tccgen ctr +m = sub n p +if gt m 64 +m = 64 +end +for i ulong m +v = xor get Tcbuf add p i get Tccblk i +put Tcbuf add p i v +end +p = add p m +ctr = add ctr 1 +end +end + +note Poly1305 radix 2^13: 10 limbs, B^10 = 5 mod p. Folded products <2^40. +note Tcmkey is the one-time key, Tcmblk a block, Tcmh the accumulator. No secret tables. +fn tcminit to void +for i ulong 10 +put Tcmr i 0 +put Tcmh i 0 +end +for i ulong 16 +v = ulong get Tcmkey i +if eq rem i 4 3 +v = and v 15 +end +if and ne i 0 eq rem i 4 0 +v = and v 252 +end +j = div mul i 8 13 +v = shl v rem mul i 8 13 +put Tcmr j or get Tcmr j and v 8191 +if lt j 9 +put Tcmr add j 1 or get Tcmr add j 1 shr v 13 +end +end +end + +fn tcmcarry to void +for i ulong 9 +v = get Tcmh i +put Tcmh i and v 8191 +put Tcmh add i 1 add get Tcmh add i 1 shr v 13 +end +v = get Tcmh 9 +put Tcmh 9 and v 8191 +put Tcmh 0 add get Tcmh 0 mul shr v 13 5 +end + +fn tcmblock n ulong to void +for i ulong n +j = div mul i 8 13 +v = shl ulong get Tcmblk i rem mul i 8 13 +put Tcmh j add get Tcmh j and v 8191 +if lt j 9 +put Tcmh add j 1 add get Tcmh add j 1 shr v 13 +end +end +top = div mul n 8 13 +v = shl ulong 1 rem mul n 8 13 +put Tcmh top add get Tcmh top v +for i ulong 10 +put Tcmt i 0 +end +for i ulong 10 +for j ulong 10 +p = add i j +v = mul get Tcmh i get Tcmr j +if ge p 10 +p = sub p 10 +v = mul v 5 +end +put Tcmt p add get Tcmt p v +end +end +for i ulong 10 +put Tcmh i get Tcmt i +end +tcmcarry +tcmcarry +tcmcarry +end + +fn tcmfinish to void +note h is normalized below B^10; h+5 overflows exactly when h >= p. +v = ulong 5 +for i ulong 10 +v = add v get Tcmh i +put Tcmg i and v 8191 +v = shr v 13 +end +mask = sub ulong 0 v +for i ulong 10 +v = xor get Tcmg i get Tcmh i +put Tcmh i xor get Tcmh i and mask v +end +carry = ulong 0 +for i ulong 16 +j = div mul i 8 13 +s = rem mul i 8 13 +v = shr get Tcmh j s +if lt j 9 +v = or v shl get Tcmh add j 1 sub 13 s +end +v = add and v 255 carry +v = add v ulong get Tcmkey add i 16 +put Tcmtag i uchar and v 255 +carry = shr v 8 +end +end + +fn tcmauth n ulong aadlen ulong to void +tccgen 0 +for i ulong 32 +put Tcmkey i get Tccblk i +end +tcminit +p = ulong 0 +while lt p aadlen bound 2 +for i ulong 16 +put Tcmblk i 0 +if lt add p i aadlen +put Tcmblk i get Tcaad add p i +end +end +tcmblock 16 +p = add p 16 +end +p = 0 +while lt p n bound 4096 +for i ulong 16 +put Tcmblk i 0 +if lt add p i n +put Tcmblk i get Tcbuf add p i +end +end +tcmblock 16 +p = add p 16 +end +for i ulong 8 +put Tcmblk i uchar and shr aadlen mul i 8 255 +put Tcmblk add i 8 uchar and shr n mul i 8 255 +end +tcmblock 16 +tcmfinish +end + +fn tcseal n ulong aadlen ulong to bool +tccwipe +for i ulong 16 +put Tctag i 0 +end +if or gt n 65536 gt aadlen 32 +ret false +end +tccinit +tccxor n +tcmauth n aadlen +for i ulong 16 +put Tctag i get Tcmtag i +end +tccwipe +ret true +end + +fn tcopen n ulong aadlen ulong to bool +tccwipe +if or gt n 65536 gt aadlen 32 +ret false +end +tccinit +tcmauth n aadlen +v = uchar 0 +for i ulong 16 +v = or v xor get Tctag i get Tcmtag i +end +note Only the final accumulated authentication result branches; no partial tag comparison. +if ne v 0 +tccwipe +ret false +end +tccxor n +tccwipe +ret true +end + +fn tcwipe to void +tcshwipe +tcxwipe +tccwipe +for i ulong 65536 +put Tcbuf i 0 +end +for i ulong 32 +put Tckey i 0 +put Tcaad i 0 +put Tcdigest i 0 +put Tcxpriv i 0 +put Tcxpub i 0 +put Tcxpeer i 0 +put Tcxshare i 0 +end +for i ulong 12 +put Tciv i 0 +end +for i ulong 16 +put Tctag i 0 +end +end diff --git a/native/omega/allen/tls-p384.om b/native/omega/allen/tls-p384.om new file mode 100644 index 00000000..e9f77453 --- /dev/null +++ b/native/omega/allen/tls-p384.om @@ -0,0 +1,471 @@ +note SPDX-License-Identifier: Apache-2.0 +note Modified 2026-10-25: public verification subset of aien-dev/spark-rsi-mv om/p256/p256.om (P256 arithmetic adapted to P384). +note Source commit bba3877510daeb8a0e070a781a689bcf1952b6f6, SHA256 +note 92da68007af091ccfbe01aa845be779502130e02bf57e9550332d669905db958. +note Adapted to P384, names prefixed cp3/C3, digest supplied by caller; signing, HMAC, nonce and private-key APIs removed. +note Public ECDSA inputs only. 32-bit-limb Montgomery arithmetic and complete a=-3 point addition. +note Renes-Costello-Batina 2015 algorithm 4; SEC2 v2 section 2.5.1 parameters. +note Byte buffer: key3072 (97 bytes), raw signature3200 (96), prehash3296 (48). +note No secret-key or constant-time compiler claim. Apache license in CERT-APACHE-LICENSE. + +const C3MP ulong 0 +const C3MN ulong 72 +const C3ONE1 ulong 144 +const C3BM ulong 156 +const C3GX ulong 180 +const C3W1 ulong 240 +const C3W2 ulong 252 +const C3XX ulong 264 +const C3YY ulong 276 +const C3ZZ ulong 288 +const C3XY ulong 300 +const C3YZ ulong 312 +const C3XZ ulong 324 +const C3U ulong 336 +const C3V ulong 348 +const C3YM ulong 360 +const C3YP ulong 372 +const C3BX3 ulong 384 +const C3XX3 ulong 396 +const C3ZZ3 ulong 408 +const C3RX ulong 420 +const C3ACC ulong 456 +const C3TMP ulong 492 +const C3BASE ulong 528 +const C3ZI ulong 564 +const C3Z ulong 792 +const C3R ulong 804 +const C3S ulong 816 +const C3U1 ulong 828 +const C3U2 ulong 840 +const C3T1 ulong 864 +const C3T2 ulong 876 +const C3T3 ulong 888 +const C3X ulong 912 +const C3Y ulong 924 +const C3Q ulong 960 +const C3P1 ulong 996 +const C3P2 ulong 1032 +const C3BPUB ulong 3072 +const C3BSIG ulong 3200 +const C3BDIG ulong 3296 + +fn cp3cpy w edit ulong 1536 o ulong a ulong to void +for i ulong 12 +put w add o i get w add a i +end +end + +fn cp3pcpy w edit ulong 1536 o ulong a ulong to void +for i ulong 36 +put w add o i get w add a i +end +end + +fn cp3set w edit ulong 1536 o ulong v ulong to void +put w o v +for i ulong 11 +put w add o add i 1 0 +end +end + +fn cp3red w edit ulong 1536 o ulong t view ulong 14 m ulong to void +u = new ulong 12 0 +bw = ulong 0 +x = ulong 0 +for i ulong 12 +x = sub sub get t i get w add m i bw +put u i and x 4294967295 +bw = shr x 63 +end +sel = or get t 12 xor bw 1 +mk = sub 0 sel +for j ulong 12 +y = and get u j mk +put w add o j or y and get t j not mk +end +end + +fn cp3mrow t edit ulong 14 w edit ulong 1536 a ulong bi ulong to void +c = ulong 0 +x = ulong 0 +for j ulong 12 +x = add add get t j mul get w add a j bi c +put t j and x 4294967295 +c = shr x 32 +end +x = add get t 12 c +put t 12 and x 4294967295 +put t 13 shr x 32 +end + +fn cp3mred t edit ulong 14 w edit ulong 1536 m ulong to void +q = and mul get t 0 get w add m 12 4294967295 +x = add get t 0 mul q get w m +c = shr x 32 +j1 = ulong 0 +for k ulong 11 +j1 = add k 1 +x = add add get t j1 mul q get w add m j1 c +put t k and x 4294967295 +c = shr x 32 +end +x = add get t 12 c +put t 11 and x 4294967295 +put t 12 add get t 13 shr x 32 +end + +fn cp3mul w edit ulong 1536 o ulong a ulong b ulong m ulong to void +t = new ulong 14 0 +for i ulong 12 +cp3mrow t w a get w add b i +cp3mred t w m +end +cp3red w o t m +end + +fn cp3add w edit ulong 1536 o ulong a ulong b ulong m ulong to void +t = new ulong 14 0 +c = ulong 0 +x = ulong 0 +for i ulong 12 +x = add add get w add a i get w add b i c +put t i and x 4294967295 +c = shr x 32 +end +put t 12 c +cp3red w o t m +end + +fn cp3sub w edit ulong 1536 o ulong a ulong b ulong m ulong to void +t = new ulong 12 0 +bw = ulong 0 +x = ulong 0 +for i ulong 12 +x = sub sub get w add a i get w add b i bw +put t i and x 4294967295 +bw = shr x 63 +end +mk = sub 0 bw +c = ulong 0 +for j ulong 12 +x = add add get t j and get w add m j mk c +put w add o j and x 4294967295 +c = shr x 32 +end +end + +fn cp3modr w edit ulong 1536 o ulong m ulong to void +t = new ulong 14 0 +for i ulong 12 +put t i get w add o i +end +cp3red w o t m +end + +fn cp3lt w edit ulong 1536 a ulong m ulong to bool +bw = ulong 0 +x = ulong 0 +for i ulong 12 +x = sub sub get w add a i get w add m i bw +bw = shr x 63 +end +ret eq bw 1 +end + +fn cp3isz w edit ulong 1536 a ulong to bool +v = ulong 0 +for i ulong 12 +v = or v get w add a i +end +ret eq v 0 +end + +fn cp3eqv w edit ulong 1536 a ulong b ulong to bool +v = ulong 0 +for i ulong 12 +v = or v xor get w add a i get w add b i +end +ret eq v 0 +end + +fn cp3rng w edit ulong 1536 a ulong to bool +ret and not cp3isz w a cp3lt w a C3MN +end + +fn cp3pow w edit ulong 1536 o ulong a ulong e ulong m ulong to void +cp3cpy w C3W2 a +cp3cpy w C3W1 add m 36 +i = ulong 0 +bit = ulong 0 +for j ulong 384 +i = sub 383 j +cp3mul w C3W1 C3W1 C3W1 m +bit = and shr get w add e shr i 5 and i 31 1 +if eq bit 1 +cp3mul w C3W1 C3W1 C3W2 m +end +end +cp3cpy w o C3W1 +end + +fn cp3inv w edit ulong 1536 o ulong a ulong m ulong to void +cp3pow w o a add m 48 m +end + +fn cp3tom w edit ulong 1536 o ulong a ulong m ulong to void +cp3mul w o a add m 24 m +end + +fn cp3frm w edit ulong 1536 o ulong a ulong m ulong to void +cp3mul w o a C3ONE1 m +end + +fn cp3mod w edit ulong 1536 m ulong to void +m0 = get w m +x = m0 +for i ulong 5 +x = mul x sub 2 mul m0 x +end +put w add m 12 and sub 0 x 4294967295 +cp3set w add m 24 1 +for j ulong 768 +cp3add w add m 24 add m 24 add m 24 m +end +cp3mul w add m 36 C3ONE1 add m 24 m +cp3cpy w add m 48 m +put w add m 48 sub get w add m 48 2 +end + +fn cp3init w edit ulong 1536 to void +for i ulong 1536 +put w i 0 +end +put w 0 4294967295 +put w 1 0 +put w 2 0 +put w 3 4294967295 +put w 4 4294967294 +put w 5 4294967295 +put w 6 4294967295 +put w 7 4294967295 +put w 8 4294967295 +put w 9 4294967295 +put w 10 4294967295 +put w 11 4294967295 +put w 72 3435473267 +put w 73 3974895978 +put w 74 1219536762 +put w 75 1478102450 +put w 76 4097256927 +put w 77 3345173889 +put w 78 4294967295 +put w 79 4294967295 +put w 80 4294967295 +put w 81 4294967295 +put w 82 4294967295 +put w 83 4294967295 +put w C3ONE1 1 +cp3mod w C3MP +cp3mod w C3MN +put w 864 3555470063 +put w 865 713410797 +put w 866 2318324125 +put w 867 3327539597 +put w 868 1343457114 +put w 869 51644559 +put w 870 4269883666 +put w 871 404593774 +put w 872 3824692505 +put w 873 2559444331 +put w 874 3795773412 +put w 875 3006345127 +cp3tom w C3BM C3T1 C3MP +put w 864 1920338615 +put w 865 978607672 +put w 866 3210029420 +put w 867 1426256477 +put w 868 2186553912 +put w 869 1509376480 +put w 870 2343017368 +put w 871 1847409506 +put w 872 4079005044 +put w 873 2394015518 +put w 874 3196781879 +put w 875 2861025826 +cp3tom w C3GX C3T1 C3MP +put w 864 2431258207 +put w 865 2051218812 +put w 866 494829981 +put w 867 174109134 +put w 868 3052452032 +put w 869 3923390739 +put w 870 681186428 +put w 871 4176747965 +put w 872 2459098153 +put w 873 1570674879 +put w 874 2519084143 +put w 875 907533898 +cp3tom w add C3GX 12 C3T1 C3MP +cp3cpy w add C3GX 24 add C3MP 36 +cp3set w C3T1 0 +end + +fn cp3padd w edit ulong 1536 o ulong a ulong q ulong to void +cp3mul w C3XX a q C3MP +cp3mul w C3YY add a 12 add q 12 C3MP +cp3mul w C3ZZ add a 24 add q 24 C3MP +cp3add w C3U a add a 12 C3MP +cp3add w C3V q add q 12 C3MP +cp3mul w C3XY C3U C3V C3MP +cp3add w C3U C3XX C3YY C3MP +cp3sub w C3XY C3XY C3U C3MP +cp3add w C3U add a 12 add a 24 C3MP +cp3add w C3V add q 12 add q 24 C3MP +cp3mul w C3YZ C3U C3V C3MP +cp3add w C3U C3YY C3ZZ C3MP +cp3sub w C3YZ C3YZ C3U C3MP +cp3add w C3U a add a 24 C3MP +cp3add w C3V q add q 24 C3MP +cp3mul w C3XZ C3U C3V C3MP +cp3add w C3U C3XX C3ZZ C3MP +cp3sub w C3XZ C3XZ C3U C3MP +note bzz3 = 3 (xz - b zz); ym = yy - bzz3; yp = yy + bzz3 +cp3mul w C3U C3BM C3ZZ C3MP +cp3sub w C3U C3XZ C3U C3MP +cp3add w C3V C3U C3U C3MP +cp3add w C3U C3V C3U C3MP +cp3sub w C3YM C3YY C3U C3MP +cp3add w C3YP C3YY C3U C3MP +note zz3 = 3 zz; bxz3 = 3 (b xz - (zz3 + xx)); xx3 = 3 xx - zz3 +cp3add w C3ZZ3 C3ZZ C3ZZ C3MP +cp3add w C3ZZ3 C3ZZ3 C3ZZ C3MP +cp3mul w C3U C3BM C3XZ C3MP +cp3add w C3V C3ZZ3 C3XX C3MP +cp3sub w C3U C3U C3V C3MP +cp3add w C3V C3U C3U C3MP +cp3add w C3BX3 C3V C3U C3MP +cp3add w C3V C3XX C3XX C3MP +cp3add w C3V C3V C3XX C3MP +cp3sub w C3XX3 C3V C3ZZ3 C3MP +note X3 = yp xy - yz bxz3; Y3 = yp ym + xx3 bxz3; Z3 = ym yz + xy xx3 +cp3mul w C3U C3YP C3XY C3MP +cp3mul w C3V C3YZ C3BX3 C3MP +cp3sub w C3RX C3U C3V C3MP +cp3mul w C3U C3YP C3YM C3MP +cp3mul w C3V C3XX3 C3BX3 C3MP +cp3add w add C3RX 12 C3U C3V C3MP +cp3mul w C3U C3YM C3YZ C3MP +cp3mul w C3V C3XY C3XX3 C3MP +cp3add w add C3RX 24 C3U C3V C3MP +cp3pcpy w o C3RX +end + +fn cp3psel w edit ulong 1536 bit ulong to void +mk = sub 0 bit +nm = not mk +for c ulong 36 +y = and get w add C3TMP c mk +put w add C3ACC c or y and get w add C3ACC c nm +end +end + +fn cp3smul w edit ulong 1536 o ulong k ulong p ulong to void +cp3pcpy w C3BASE p +cp3set w C3ACC 0 +cp3cpy w add C3ACC 12 add C3MP 36 +cp3set w add C3ACC 24 0 +i = ulong 0 +for j ulong 384 +i = sub 383 j +cp3padd w C3ACC C3ACC C3ACC +cp3padd w C3TMP C3ACC C3BASE +cp3psel w and shr get w add k shr i 5 and i 31 1 +end +cp3pcpy w o C3ACC +end + +fn cp3aff w edit ulong 1536 x ulong y ulong p ulong to void +cp3inv w C3ZI add p 24 C3MP +cp3mul w x p C3ZI C3MP +cp3frm w x x C3MP +cp3mul w y add p 12 C3ZI C3MP +cp3frm w y y C3MP +end + +fn cp3ld w edit ulong 1536 o ulong b edit uchar 4096 off ulong to void +q = ulong 0 +v = ulong 0 +for i ulong 12 +q = add off sub 44 mul i 4 +v = ulong get b q +v = or shl v 8 ulong get b add q 1 +v = or shl v 8 ulong get b add q 2 +v = or shl v 8 ulong get b add q 3 +put w add o i v +end +end + +fn cp3oncv w edit ulong 1536 to bool +if not cp3lt w C3X C3MP +ret false +end +if not cp3lt w C3Y C3MP +ret false +end +cp3tom w C3T1 C3X C3MP +cp3tom w C3T2 C3Y C3MP +cp3mul w C3T3 C3T2 C3T2 C3MP +cp3mul w C3T2 C3T1 C3T1 C3MP +cp3mul w C3T2 C3T2 C3T1 C3MP +cp3sub w C3T2 C3T2 C3T1 C3MP +cp3sub w C3T2 C3T2 C3T1 C3MP +cp3sub w C3T2 C3T2 C3T1 C3MP +cp3add w C3T2 C3T2 C3BM C3MP +ret cp3eqv w C3T2 C3T3 +end + +fn cp3vrfy w edit ulong 1536 b edit uchar 4096 to ulong +if ne get b C3BPUB 4 +ret 0 +end +cp3ld w C3X b add C3BPUB 1 +cp3ld w C3Y b add C3BPUB 49 +if not cp3oncv w +ret 0 +end +cp3ld w C3R b C3BSIG +cp3ld w C3S b add C3BSIG 48 +if not cp3rng w C3R +ret 0 +end +if not cp3rng w C3S +ret 0 +end +cp3ld w C3Z b C3BDIG +cp3modr w C3Z C3MN +cp3tom w C3T1 C3S C3MN +cp3inv w C3T1 C3T1 C3MN +cp3tom w C3T2 C3Z C3MN +cp3mul w C3U1 C3T2 C3T1 C3MN +cp3frm w C3U1 C3U1 C3MN +cp3tom w C3T2 C3R C3MN +cp3mul w C3U2 C3T2 C3T1 C3MN +cp3frm w C3U2 C3U2 C3MN +cp3tom w C3Q C3X C3MP +cp3tom w add C3Q 12 C3Y C3MP +cp3cpy w add C3Q 24 add C3MP 36 +cp3smul w C3P1 C3U1 C3GX +cp3smul w C3P2 C3U2 C3Q +cp3padd w C3P1 C3P1 C3P2 +if cp3isz w add C3P1 24 +ret 0 +end +cp3aff w C3X C3Y C3P1 +cp3modr w C3X C3MN +if cp3eqv w C3X C3R +ret 1 +end +ret 0 +end + diff --git a/native/omega/allen/tls.om b/native/omega/allen/tls.om new file mode 100644 index 00000000..4660fa15 --- /dev/null +++ b/native/omega/allen/tls.om @@ -0,0 +1,1303 @@ +note RFC8446 bounded TLS1.3 client: api.github.com, X25519, 1303, CV0403. +note Concatenate tls-crypto.om and tls-cert.om before this file. No platform I/O. +note tlsinput(n): NEW bytes in Tlsin[0..n); internal residual retained; Tlsinlen becomes0. +note tlswrite(n)->bool: atomic acceptance, n<=16384; false means retain plaintext. +note tlssent acknowledges the ENTIRE output queue, then pumps deferred work. +note Tlsstate:0 lifecycle idle0 handshake1 open2 closed3 error4;1 error;2 peer close_notify. +note Errors:1 API bounds,2 capacity,3 crypto,4 record overflow,5 unexpected record, +note 6 bad MAC,7 malformed,8 unsupported,9 transcript cap,10 certificate,11 CV, +note 12 Finished,13 sequence limit,14 peer alert,15 HRR unsupported,16 key boundary, +note 17 KeyUpdate unsupported,18 absent time. Fatal/reset discards and wipes all queues. +note Limits: handshake and transcript65536, ciphertext16640, record plaintext16384, +note receive residual65536, app262144, epoch2^32-1 records. No tickets used or early data. +global Tlsin uchar 65536 +global Tlsout uchar 65536 +global Tlsplain uchar 65536 +global Tlsapp uchar 262144 +global Tlsrand uchar 64 +global Tlsinlen ulong 1 +global Tlsoutn ulong 1 +global Tlsappn ulong 1 +global Tlsstate ulong 8 +global Tsrecv uchar 65536 +global Tshand uchar 65536 +global Tstrans uchar 65536 +global Tsmsg uchar 1024 +global Tssec uchar 192 +global Tskey uchar 128 +global Tsiv uchar 48 +global Tshash uchar 32 +global Tslbl uchar 16 +global Tsseen uchar 8192 +global Tsseq ulong 2 +note Tsctl:0 recvlen,1 handlen,2 transcriptlen,3 localclose requested, +note 4 localclose queued,5 peerclose,6 phase,7 msglen,8 labellen,9 validated epoch time. +note phase0 SH,1 EE,2 Certificate,3 CV,4 Finished,5 application,6 client Finished pending. +global Tsctl ulong 10 +text Tshost "api.github.com" +text Tsalpn "http/1.1" +text Tsprefix "tls13 " +text Tsderiv "derived" +text Tschs "c hs traffic" +text Tsshs "s hs traffic" +text Tscap "c ap traffic" +text Tssap "s ap traffic" +text Tsklab "key" +text Tsvlab "iv" +text Tsflab "finished" +text Tscvctx "TLS 1.3, server CertificateVerify" +text Tshrr "cf21ad74e59a6111be1d8c021e65b891c2a211167abb8c5e079e09e2c8a8339c" +fn tshex c uchar to uchar +if le c 57 +ret sub c 48 +end +ret sub c 87 +end +fn tswipe to void +for i ulong 192 +put Tssec i 0 +end +for i ulong 128 +put Tskey i 0 +end +for i ulong 48 +put Tsiv i 0 +end +for i ulong 32 +put Tshash i 0 +end +for i ulong 16 +put Tslbl i 0 +end +for i ulong 2 +put Tsseq i 0 +end +tcwipe +certreset +end +fn tsclear to void +tswipe +for i ulong 65536 +put Tlsin i 0 +put Tlsout i 0 +put Tlsplain i 0 +put Tsrecv i 0 +put Tshand i 0 +put Tstrans i 0 +end +for i ulong 262144 +put Tlsapp i 0 +end +for i ulong 1024 +put Tsmsg i 0 +end +for i ulong 8192 +put Tsseen i 0 +end +for i ulong 10 +put Tsctl i 0 +end +for i ulong 8 +put Tlsstate i 0 +end +put Tlsinlen 0 0 +put Tlsoutn 0 0 +put Tlsappn 0 0 +end +fn tsfail code ulong to void +tsclear +for i ulong 64 +put Tlsrand i 0 +end +put Tlsstate 0 4 +put Tlsstate 1 code +end +fn tsh16 p ulong to ulong +ret add shl ulong get Tshand p 8 ulong get Tshand add p 1 +end +fn tsh24 p ulong to ulong +ret add shl ulong get Tshand p 16 tsh16 add p 1 +end +fn tsput c uchar to void +p = get Tsctl 7 +put Tsmsg p c +put Tsctl 7 add p 1 +end +fn tsu16 x ulong to void +tsput uchar and shr x 8 255 +tsput uchar and x 255 +end +fn tsu24 x ulong to void +tsput uchar and shr x 16 255 +tsu16 and x 65535 +end +fn tshashdo to bool +n = get Tsctl 2 +for i ulong n +put Tcbuf i get Tstrans i +end +if not tcsha n +ret false +end +for i ulong 32 +put Tshash i get Tcdigest i +end +ret true +end +fn tsempty to bool +if not tcsha 0 +ret false +end +for i ulong 32 +put Tshash i get Tcdigest i +end +ret true +end +fn tssave p ulong to void +for i ulong 32 +put Tssec add p i get Tcdigest i +end +end +fn tslab which ulong to void +put Tsctl 8 0 +if eq which 0 +for i ulong len Tsderiv +put Tslbl i get Tsderiv i +end +put Tsctl 8 len Tsderiv +end +if eq which 1 +for i ulong len Tschs +put Tslbl i get Tschs i +end +put Tsctl 8 len Tschs +end +if eq which 2 +for i ulong len Tsshs +put Tslbl i get Tsshs i +end +put Tsctl 8 len Tsshs +end +if eq which 3 +for i ulong len Tscap +put Tslbl i get Tscap i +end +put Tsctl 8 len Tscap +end +if eq which 4 +for i ulong len Tssap +put Tslbl i get Tssap i +end +put Tsctl 8 len Tssap +end +if eq which 5 +for i ulong len Tsklab +put Tslbl i get Tsklab i +end +put Tsctl 8 len Tsklab +end +if eq which 6 +for i ulong len Tsvlab +put Tslbl i get Tsvlab i +end +put Tsctl 8 len Tsvlab +end +if eq which 7 +for i ulong len Tsflab +put Tslbl i get Tsflab i +end +put Tsctl 8 len Tsflab +end +end +note All expansions <=Hash.length, so RFC5869 has exactly one block T(1). +fn tsexpand which ulong secat ulong ctx bool olen ulong to bool +if or eq olen 0 gt olen 32 +ret false +end +tslab which +n = get Tsctl 8 +if eq n 0 +ret false +end +for i ulong 32 +put Tckey i get Tssec add secat i +end +put Tcbuf 0 0 +put Tcbuf 1 uchar olen +put Tcbuf 2 uchar add n 6 +for i ulong 6 +put Tcbuf add i 3 get Tsprefix i +end +for i ulong n +put Tcbuf add i 9 get Tslbl i +end +p = add n 9 +put Tcbuf p 0 +if ctx +put Tcbuf p 32 +p = add p 1 +for i ulong 32 +put Tcbuf add p i get Tshash i +end +p = add p 32 +else +p = add p 1 +end +put Tcbuf p 1 +ret tchmac 32 add p 1 +end +fn tstraff secat ulong keyat ulong ivat ulong to bool +if not tsexpand 5 secat false 32 +ret false +end +for i ulong 32 +put Tskey add keyat i get Tcdigest i +end +if not tsexpand 6 secat false 12 +ret false +end +for i ulong 12 +put Tsiv add ivat i get Tcdigest i +end +ret true +end +fn tshkeys to bool +note HKDF-Extract(zeros32,zeros32), then Derive-Secret early derived Hash(empty). +for i ulong 32 +put Tckey i 0 +put Tcbuf i 0 +end +if not tchmac 32 32 +ret false +end +tssave 0 +if not tsempty +ret false +end +if not tsexpand 0 0 true 32 +ret false +end +for i ulong 32 +put Tckey i get Tcdigest i +put Tcbuf i get Tcxshare i +end +if not tchmac 32 32 +ret false +end +tssave 0 +if not tshashdo +ret false +end +if not tsexpand 1 0 true 32 +ret false +end +tssave 32 +if not tsexpand 2 0 true 32 +ret false +end +tssave 64 +if not tstraff 32 0 0 +ret false +end +if not tstraff 64 32 12 +ret false +end +if not tsempty +ret false +end +if not tsexpand 0 0 true 32 +ret false +end +for i ulong 32 +put Tckey i get Tcdigest i +put Tcbuf i 0 +end +if not tchmac 32 32 +ret false +end +tssave 96 +for i ulong 32 +put Tssec i 0 +put Tcxpriv i 0 +put Tcxshare i 0 +end +put Tsseq 0 0 +put Tsseq 1 0 +ret true +end +fn tsakeys to bool +if not tshashdo +ret false +end +if not tsexpand 3 96 true 32 +ret false +end +tssave 128 +if not tsexpand 4 96 true 32 +ret false +end +tssave 160 +if not tstraff 128 64 24 +ret false +end +if not tstraff 160 96 36 +ret false +end +for i ulong 32 +put Tssec add i 96 0 +end +put Tsseq 1 0 +ret true +end +fn tsfinmac secat ulong to bool +if not tshashdo +ret false +end +if not tsexpand 7 secat false 32 +ret false +end +for i ulong 32 +put Tckey i get Tcdigest i +put Tcbuf i get Tshash i +end +ret tchmac 32 32 +end +fn tsnonce keyat ulong ivat ulong seq ulong to void +for i ulong 32 +put Tckey i get Tskey add keyat i +end +for i ulong 12 +put Tciv i get Tsiv add ivat i +end +for i ulong 8 +p = sub ulong 11 i +b = uchar and shr seq mul i 8 255 +put Tciv p xor get Tciv p b +end +end +note Tcbuf contains plaintext before tsseal; queue is published only after authentication. +fn tsseal n ulong typ uchar epoch ulong to bool +if ne get Tlsoutn 0 0 +ret false +end +if gt n 16384 +ret false +end +s = get Tsseq 0 +if ge s 4294967295 +ret false +end +tsnonce mul epoch 64 mul epoch 24 s +put Tcbuf n typ +put Tcaad 0 23 +put Tcaad 1 3 +put Tcaad 2 3 +put Tcaad 3 uchar shr add n 17 8 +put Tcaad 4 uchar and add n 17 255 +if not tcseal add n 1 5 +ret false +end +for i ulong 5 +put Tlsout i get Tcaad i +end +for i ulong add n 1 +put Tlsout add i 5 get Tcbuf i +end +for i ulong 16 +put Tlsout add add n 6 i get Tctag i +end +put Tlsoutn 0 add n 22 +put Tsseq 0 add s 1 +ret true +end +fn tstradd n ulong to bool +p = get Tsctl 2 +if gt n sub ulong 65536 p +ret false +end +for i ulong n +put Tstrans add p i get Tshand i +end +put Tsctl 2 add p n +ret true +end +fn tsseen0 to void +for i ulong 8192 +put Tsseen i 0 +end +end +fn tsunique typ ulong to bool +p = div typ 8 +b = uchar shl ulong 1 rem typ 8 +if ne and get Tsseen p b 0 +ret false +end +put Tsseen p or get Tsseen p b +ret true +end +fn tsshare p ulong n ulong to bool +if ne n 36 +ret false +end +if or ne tsh16 p 29 ne tsh16 add p 2 32 +ret false +end +for i ulong 32 +put Tcxpeer i get Tshand add add p 4 i +end +ret true +end +fn tssh n ulong to bool +if lt n 44 +ret false +end +if ne tsh16 4 771 +ret false +end +note Exact HRR random is refused; never interpreted as an ordinary random. +d = uchar 0 +for i ulong 32 +b = add shl tshex get Tshrr mul i 2 4 tshex get Tshrr add mul i 2 1 +d = or d xor get Tshand add i 6 b +end +if eq d 0 +tsfail 15 +ret false +end +if ne get Tshand 38 0 +ret false +end +if or ne tsh16 39 4867 ne get Tshand 41 0 +ret false +end +if ne tsh16 42 sub n 44 +ret false +end +tsseen0 +p = ulong 44 +flags = ulong 0 +while lt p n bound 16384 +if lt sub n p 4 +ret false +end +t = tsh16 p +z = tsh16 add p 2 +p = add p 4 +if gt z sub n p +ret false +end +if not tsunique t +ret false +end +if eq t 43 +if ne z 2 +ret false +end +if ne tsh16 p 772 +ret false +end +flags = or flags 1 +else +if eq t 51 +if not tsshare p z +ret false +end +flags = or flags 2 +else +ret false +end +end +p = add p z +end +ret eq flags 3 +end +fn tsext p ulong z ulong typ ulong to bool +if eq typ 0 +ret eq z 0 +end +if eq typ 16 +if ne z 11 +ret false +end +if or ne tsh16 p 9 ne get Tshand add p 2 8 +ret false +end +for i ulong 8 +if ne get Tshand add add p 3 i get Tsalpn i +ret false +end +end +ret true +end +if eq typ 10 +if lt z 4 +ret false +end +if or ne rem z 2 0 ne tsh16 p sub z 2 +ret false +end +ret true +end +ret false +end +fn tsee n ulong to bool +if lt n 6 +ret false +end +if ne tsh16 4 sub n 6 +ret false +end +tsseen0 +p = ulong 6 +while lt p n bound 16384 +if lt sub n p 4 +ret false +end +t = tsh16 p +z = tsh16 add p 2 +p = add p 4 +if gt z sub n p +ret false +end +if not tsunique t +ret false +end +if not tsext p z t +ret false +end +p = add p z +end +ret true +end +fn tscert n ulong to bool +z = sub n 4 +for i ulong z +put Certbuf i get Tshand add i 4 +end +put Certlen 0 z +note Cert owner may reset its state; supply this session's time immediately before checking. +put Certnow 0 get Tsctl 9 +ret certcheck +end +fn tscv n ulong to bool +if lt n 8 +ret false +end +if ne tsh16 4 1027 +ret false +end +z = tsh16 6 +if or gt z 128 ne z sub n 8 +ret false +end +if not tshashdo +ret false +end +for i ulong 64 +put Certmsg i 32 +end +for i ulong len Tscvctx +put Certmsg add i 64 get Tscvctx i +end +p = add ulong 64 len Tscvctx +put Certmsg p 0 +p = add p 1 +for i ulong 32 +put Certmsg add p i get Tshash i +end +for i ulong z +put Certsig i get Tshand add i 8 +end +ret certsig add p 32 z +end +note NewSessionTicket syntax is checked, including duplicate extensions; nothing is retained. +fn tsticket n ulong to bool +if lt n 17 +ret false +end +life = add shl tsh16 4 16 tsh16 6 +if gt life 604800 +ret false +end +p = add ulong 13 ulong get Tshand 12 +if gt p n +ret false +end +if lt sub n p 2 +ret false +end +z = tsh16 p +p = add p 2 +if or eq z 0 gt z sub n p +ret false +end +p = add p z +if lt sub n p 2 +ret false +end +z = tsh16 p +p = add p 2 +if ne z sub n p +ret false +end +tsseen0 +while lt p n bound 16384 +if lt sub n p 4 +ret false +end +t = tsh16 p +z = tsh16 add p 2 +p = add p 4 +if gt z sub n p +ret false +end +if not tsunique t +ret false +end +if and eq t 42 ne z 4 +ret false +end +p = add p z +end +ret true +end +fn tsfinish n ulong to bool +if ne n 36 +ret false +end +if not tsfinmac 64 +ret false +end +d = uchar 0 +for i ulong 32 +d = or d xor get Tcdigest i get Tshand add i 4 +end +ret eq d 0 +end +fn tshmsg n ulong to void +p = get Tsctl 6 +t = get Tshand 0 +if eq p 5 +if eq t 4 +if not tsticket n +tsfail 7 +end +ret +end +if eq t 24 +tsfail 17 +ret +end +tsfail 8 +ret +end +if eq p 0 +if ne t 2 +tsfail 8 +ret +end +if not tssh n +if ne get Tlsstate 0 4 +tsfail 7 +end +ret +end +if not tcx25519 +tsfail 3 +ret +end +d = uchar 0 +for i ulong 32 +d = or d get Tcxshare i +end +if eq d 0 +tsfail 3 +ret +end +else +if eq p 1 +if ne t 8 +tsfail 8 +ret +end +if not tsee n +tsfail 7 +ret +end +else +if eq p 2 +if ne t 11 +tsfail 8 +ret +end +if not tscert n +tsfail 10 +ret +end +else +if eq p 3 +if ne t 15 +tsfail 8 +ret +end +if not tscv n +tsfail 11 +ret +end +else +if ne t 20 +tsfail 8 +ret +end +if not tsfinish n +tsfail 12 +ret +end +end +end +end +end +if not tstradd n +tsfail 9 +ret +end +if eq p 0 +if not tshkeys +tsfail 3 +ret +end +end +if eq p 4 +if not tsakeys +tsfail 3 +ret +end +put Tsctl 6 6 +else +put Tsctl 6 add p 1 +end +end +fn tshfeed n ulong to void +if eq n 0 +tsfail 5 +ret +end +p = get Tsctl 1 +if gt n sub ulong 65536 p +tsfail 2 +ret +end +for i ulong n +put Tshand add p i get Tcbuf i +end +put Tsctl 1 add p n +while ge get Tsctl 1 4 bound 16384 +z = add ulong 4 tsh24 1 +if gt z 65536 +tsfail 2 +ret +end +p = get Tsctl 1 +if gt z p +ret +end +t = get Tshand 0 +if or or eq t 2 eq t 20 eq t 24 +if ne z p +tsfail 16 +ret +end +end +tshmsg z +if eq get Tlsstate 0 4 +ret +end +p = sub p z +for i ulong p +put Tshand i get Tshand add i z +end +for i ulong z +put Tshand add p i 0 +end +put Tsctl 1 p +end +end +fn tsalert n ulong secure bool to void +if ne n 2 +tsfail 7 +ret +end +if ne get Tsctl 1 0 +tsfail 16 +ret +end +if or eq get Tcbuf 0 0 gt get Tcbuf 0 2 +tsfail 7 +ret +end +if eq get Tcbuf 1 0 +if or not secure ne get Tsctl 6 5 +tsfail 5 +ret +end +put Tsctl 5 1 +put Tsctl 3 1 +put Tlsstate 0 3 +put Tlsstate 2 1 +ret +end +a = ulong get Tcbuf 1 +tsfail 14 +put Tlsstate 3 a +end +fn tsinner n ulong to void +while gt n 0 bound 16640 +if ne get Tcbuf sub n 1 0 +break +end +n = sub n 1 +end +if eq n 0 +tsfail 5 +ret +end +n = sub n 1 +t = get Tcbuf n +if gt n 16384 +tsfail 4 +ret +end +if eq t 22 +tshfeed n +ret +end +if eq t 21 +tsalert n true +ret +end +if ne t 23 +tsfail 5 +ret +end +if or ne get Tsctl 6 5 ne get Tsctl 1 0 +tsfail 5 +ret +end +if ne get Tsctl 5 0 +tsfail 5 +ret +end +p = get Tlsappn 0 +if gt n sub ulong 262144 p +tsfail 2 +ret +end +for i ulong n +put Tlsapp add p i get Tcbuf i +end +put Tlsappn 0 add p n +end +fn tsopen n ulong to void +if lt n 17 +tsfail 7 +ret +end +if eq get Tsctl 6 0 +tsfail 5 +ret +end +s = get Tsseq 1 +if ge s 4294967295 +tsfail 13 +ret +end +epoch = ulong 0 +if eq get Tsctl 6 5 +epoch = 1 +end +tsnonce add ulong 32 mul epoch 64 add ulong 12 mul epoch 24 s +for i ulong 5 +put Tcaad i get Tsrecv i +end +n = sub n 16 +for i ulong n +put Tcbuf i get Tsrecv add i 5 +end +for i ulong 16 +put Tctag i get Tsrecv add add i n 5 +end +if not tcopen n 5 +tsfail 6 +ret +end +put Tsseq 1 add s 1 +tsinner n +end +fn tsrecord n ulong to void +t = get Tsrecv 0 +if eq t 20 +if or ne n 1 ne get Tsrecv 5 1 +tsfail 5 +ret +end +if or ne get Tlsstate 0 1 ne get Tsctl 1 0 +tsfail 5 +ret +end +if eq get Tsctl 6 6 +tsfail 5 +end +ret +end +if eq t 23 +if or ne get Tsrecv 1 3 ne get Tsrecv 2 3 +tsfail 7 +ret +end +tsopen n +ret +end +if ne get Tsctl 6 0 +tsfail 5 +ret +end +for i ulong n +put Tcbuf i get Tsrecv add i 5 +end +if eq t 22 +tshfeed n +ret +end +if eq t 21 +tsalert n false +ret +end +tsfail 5 +end +fn tssendf to void +if not tsfinmac 32 +tsfail 3 +ret +end +put Tsmsg 0 20 +put Tsmsg 1 0 +put Tsmsg 2 0 +put Tsmsg 3 32 +for i ulong 32 +put Tsmsg add i 4 get Tcdigest i +end +for i ulong 36 +put Tcbuf i get Tsmsg i +end +if not tsseal 36 22 0 +tsfail 3 +ret +end +note No resumption/exporter: discard transcript and handshake secrets after client Finished. +for i ulong 192 +put Tssec i 0 +end +for i ulong 64 +put Tskey i 0 +end +for i ulong 24 +put Tsiv i 0 +end +for i ulong 65536 +put Tstrans i 0 +end +put Tsctl 2 0 +put Tsseq 0 0 +put Tsctl 6 5 +put Tlsstate 0 2 +tcwipe +certreset +end +fn tsclosing to void +if eq get Tsctl 3 0 +ret +end +if ne get Tsctl 4 0 +if ne get Tsctl 5 0 +tswipe +end +ret +end +if ne get Tlsoutn 0 0 +ret +end +put Tcbuf 0 1 +put Tcbuf 1 0 +if not tsseal 2 21 1 +tsfail 3 +ret +end +put Tsctl 4 1 +put Tlsstate 0 3 +if ne get Tsctl 5 0 +tswipe +end +end +fn tspump to void +if or eq get Tlsstate 0 0 eq get Tlsstate 0 4 +ret +end +if eq get Tsctl 6 6 +if ne get Tlsoutn 0 0 +ret +end +tssendf +if eq get Tlsstate 0 4 +ret +end +end +while ge get Tsctl 0 5 bound 13108 +if ne get Tsctl 5 0 +break +end +n = add shl ulong get Tsrecv 3 8 ulong get Tsrecv 4 +lim = ulong 16384 +if eq get Tsrecv 0 23 +lim = 16640 +end +if gt n lim +tsfail 4 +ret +end +z = add n 5 +if gt z get Tsctl 0 +break +end +tsrecord n +if eq get Tlsstate 0 4 +ret +end +p = sub get Tsctl 0 z +for i ulong p +put Tsrecv i get Tsrecv add i z +end +for i ulong z +put Tsrecv add p i 0 +end +put Tsctl 0 p +if eq get Tsctl 6 6 +if ne get Tlsoutn 0 0 +ret +end +tssendf +if eq get Tlsstate 0 4 +ret +end +end +end +if ne get Tsctl 5 0 +for i ulong get Tsctl 0 +put Tsrecv i 0 +end +put Tsctl 0 0 +end +if eq get Tsctl 6 5 +tsclosing +end +end +fn tlsinput n ulong to void +if gt n 65536 +tsfail 1 +ret +end +if or eq get Tlsstate 0 0 eq get Tlsstate 0 4 +ret +end +if ne get Tsctl 5 0 +for i ulong n +put Tlsin i 0 +end +put Tlsinlen 0 0 +ret +end +p = get Tsctl 0 +if gt n sub ulong 65536 p +tsfail 2 +ret +end +for i ulong n +put Tsrecv add p i get Tlsin i +put Tlsin i 0 +end +put Tsctl 0 add p n +put Tlsinlen 0 0 +tspump +end +fn tlssent to void +n = get Tlsoutn 0 +for i ulong n +put Tlsout i 0 +end +put Tlsoutn 0 0 +tspump +end +fn tlswrite n ulong to bool +if or ne get Tlsstate 0 2 ne get Tsctl 3 0 +ret false +end +if ne get Tlsoutn 0 0 +ret false +end +if gt n 16384 +ret false +end +if ge get Tsseq 0 4294967295 +tsfail 13 +ret false +end +for i ulong n +put Tcbuf i get Tlsplain i +end +if not tsseal n 23 1 +tsfail 3 +ret false +end +for i ulong n +put Tlsplain i 0 +end +tcwipe +ret true +end +fn tlsconsume n ulong to void +p = get Tlsappn 0 +if gt n p +tsfail 1 +ret +end +p = sub p n +for i ulong p +put Tlsapp i get Tlsapp add i n +end +for i ulong n +put Tlsapp add p i 0 +end +put Tlsappn 0 p +end +fn tlsclose to void +if or eq get Tlsstate 0 0 eq get Tlsstate 0 4 +ret +end +if eq get Tlsstate 0 1 +tsclear +for i ulong 64 +put Tlsrand i 0 +end +put Tlsstate 0 3 +ret +end +put Tsctl 3 1 +tsclosing +end +fn tshello to void +put Tsctl 7 0 +tsput 1 +tsu24 0 +tsu16 771 +for i ulong 32 +tsput get Tlsrand i +end +tsput 0 +tsu16 2 +tsu16 4867 +tsput 1 +tsput 0 +note Extension total patched after serializing exact offered values. +tsu16 0 +tsu16 0 +tsu16 add ulong 5 len Tshost +tsu16 add ulong 3 len Tshost +tsput 0 +tsu16 len Tshost +for i ulong len Tshost +tsput get Tshost i +end +tsu16 43 +tsu16 3 +tsput 2 +tsu16 772 +tsu16 10 +tsu16 4 +tsu16 2 +tsu16 29 +tsu16 13 +tsu16 4 +tsu16 2 +tsu16 1027 +tsu16 50 +tsu16 6 +tsu16 4 +tsu16 1027 +tsu16 1283 +tsu16 51 +tsu16 38 +tsu16 36 +tsu16 29 +tsu16 32 +for i ulong 32 +tsput get Tcxpub i +end +tsu16 16 +tsu16 11 +tsu16 9 +tsput 8 +for i ulong 8 +tsput get Tsalpn i +end +n = get Tsctl 7 +put Tsmsg 1 uchar and shr sub n 4 16 255 +put Tsmsg 2 uchar and shr sub n 4 8 255 +put Tsmsg 3 uchar and sub n 4 255 +put Tsmsg 45 uchar shr sub n 47 8 +put Tsmsg 46 uchar and sub n 47 255 +for i ulong n +put Tstrans i get Tsmsg i +put Tlsout add i 5 get Tsmsg i +end +put Tsctl 2 n +put Tlsout 0 22 +put Tlsout 1 3 +put Tlsout 2 1 +put Tlsout 3 uchar shr n 8 +put Tlsout 4 uchar and n 255 +put Tlsoutn 0 add n 5 +end +fn tlsinit now ulong to void +note Parent supplies FRESH secure Tlsrand before every init; reset preserves only this input. +tsclear +if eq now 0 +tsfail 18 +ret +end +z1 = true +z2 = true +for i ulong 32 +if ne get Tlsrand i 0 +z1 = false +end +if ne get Tlsrand add i 32 0 +z2 = false +end +end +if or z1 z2 +tsfail 3 +ret +end +put Tsctl 9 now +for i ulong 32 +put Tcxpriv i get Tlsrand add i 32 +end +if not tcxpublic +tsfail 3 +ret +end +tshello +for i ulong 64 +put Tlsrand i 0 +end +put Tlsstate 0 1 +end diff --git a/native/omega/allen/vendor/CERT-APACHE-LICENSE b/native/omega/allen/vendor/CERT-APACHE-LICENSE new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/native/omega/allen/vendor/CERT-APACHE-LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/native/omega/allen/vendor/OMEGA-LICENSE b/native/omega/allen/vendor/OMEGA-LICENSE new file mode 100644 index 00000000..be3f7b28 --- /dev/null +++ b/native/omega/allen/vendor/OMEGA-LICENSE @@ -0,0 +1,661 @@ + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU Affero General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU AGPL, see +. diff --git a/native/omega/allen/vendor/PROVENANCE.md b/native/omega/allen/vendor/PROVENANCE.md new file mode 100644 index 00000000..67d62646 --- /dev/null +++ b/native/omega/allen/vendor/PROVENANCE.md @@ -0,0 +1,41 @@ +# Native SHA256 reuse + +Exact upstream `seed/native/sha256.om` from omega-osc-manual-migration commit +8f8be9a676b94197e5cb363d2dcbca113e208f09, last file commit at read-only checkout +9b072eb492e106d23f7eed984c5645251601adee. Its core comes from native Omega TRN1 +12251e3403d42931ada27dc1c54b3b610954be5d. `sha256.om` preserves that whole file. +`sha256-core.om` is its byte-exact prefix before the handwritten standalone stream +interface comment (no algorithm changes). Build-time concatenation is not a new +language import/compiler feature. No primitive was reimplemented. Qualification +here includes independently constructed SHA-sealed record bytes and hash mutants. +The upstream AGPL licence is preserved as OMEGA-LICENSE. Imported sources retain +SPDX identifiers. No keyed authentication/freshness claim follows from these tests. + +Compiler is immutable omega-bridge-native-development commit +0fc7d8662cb799e7c206b17c18ea4c3ec2b8fea9, omc SHA256 +191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9. +Fresh source-only bootstrap from git archive at that pin passed, stage1==stage2, +and its omc hash matched the brief's compiler. No C parent or compiler edits. + +# Certificate verification reuse + +All three files below are public-input verification code. They contain no signing or private-key code. + +- `cert-p256.om`: the verification subset of `om/p256/p256.om` from aien-dev/spark-rsi-mv, local + checkout commit bba3877510daeb8a0e070a781a689bcf1952b6f6, source SHA256 + 92da68007af091ccfbe01aa845be779502130e02bf57e9550332d669905db958. The names were prefixed + (`cp2`/`C2`), the caller now supplies the digest, and signing, HMAC, RFC 6979 and public-key + derivation were removed. +- `../tls-p384.om`: the same Montgomery and complete-addition code, adapted to 12 limbs with the + SEC 2 v2 section 2.5.1 P-384 constants. +- `cert-sha384.om`: `om/sha512/sha512.om` from aien-dev/omnet + a14ff7efc94ea56530a61e0d91675dc970e7d806, source SHA256 + 069a54b75484221bc7dbacfbea744ca9002c295f4f34f2c3905b0776450e3ce2, with the FIPS 180-4 + section 5.3.4 SHA-384 IV. Only the first 48 output bytes are used. + +These sources are Apache-2.0. Their licence text is `CERT-APACHE-LICENSE`. + +`cert-root.om` holds the public trust anchor read from the local OS store on 2026-10-25: +`/etc/ssl/certs/Sectigo_Public_Server_Authentication_Root_E46.pem`, DER SHA256 +c90f26f0fb1b4018b22227519b5ca2b53e2ca5b3be5cf18efe1bef47380c5383. This is a root anchor, not a +peer, leaf or SPKI pin. diff --git a/native/omega/allen/vendor/cert-p256.om b/native/omega/allen/vendor/cert-p256.om new file mode 100644 index 00000000..b96e23b2 --- /dev/null +++ b/native/omega/allen/vendor/cert-p256.om @@ -0,0 +1,447 @@ +note SPDX-License-Identifier: Apache-2.0 +note Modified 2026-10-25: public verification subset of aien-dev/spark-rsi-mv om/p256/p256.om. +note Source commit bba3877510daeb8a0e070a781a689bcf1952b6f6, SHA256 +note 92da68007af091ccfbe01aa845be779502130e02bf57e9550332d669905db958. +note Names prefixed cp2/C2, digest supplied by caller; signing, HMAC, nonce and private-key APIs removed. +note Public ECDSA inputs only. 32-bit-limb Montgomery arithmetic and complete a=-3 point addition. +note Renes-Costello-Batina 2015 algorithm 4; SEC2 v2 section 2.4.2 parameters. +note Byte buffer: key3072 (65 bytes), raw signature3200 (64), prehash3296 (32). +note No secret-key or constant-time compiler claim. Apache license in CERT-APACHE-LICENSE. + +const C2MP ulong 0 +const C2MN ulong 48 +const C2ONE1 ulong 96 +const C2BM ulong 104 +const C2GX ulong 120 +const C2W1 ulong 160 +const C2W2 ulong 168 +const C2XX ulong 176 +const C2YY ulong 184 +const C2ZZ ulong 192 +const C2XY ulong 200 +const C2YZ ulong 208 +const C2XZ ulong 216 +const C2U ulong 224 +const C2V ulong 232 +const C2YM ulong 240 +const C2YP ulong 248 +const C2BX3 ulong 256 +const C2XX3 ulong 264 +const C2ZZ3 ulong 272 +const C2RX ulong 280 +const C2ACC ulong 304 +const C2TMP ulong 328 +const C2BASE ulong 352 +const C2ZI ulong 376 +const C2Z ulong 528 +const C2R ulong 536 +const C2S ulong 544 +const C2U1 ulong 552 +const C2U2 ulong 560 +const C2T1 ulong 576 +const C2T2 ulong 584 +const C2T3 ulong 592 +const C2X ulong 608 +const C2Y ulong 616 +const C2Q ulong 640 +const C2P1 ulong 664 +const C2P2 ulong 688 +const C2BPUB ulong 3072 +const C2BSIG ulong 3200 +const C2BDIG ulong 3296 + +fn cp2cpy w edit ulong 1024 o ulong a ulong to void +for i ulong 8 +put w add o i get w add a i +end +end + +fn cp2pcpy w edit ulong 1024 o ulong a ulong to void +for i ulong 24 +put w add o i get w add a i +end +end + +fn cp2set w edit ulong 1024 o ulong v ulong to void +put w o v +for i ulong 7 +put w add o add i 1 0 +end +end + +fn cp2red w edit ulong 1024 o ulong t view ulong 10 m ulong to void +u = new ulong 8 0 +bw = ulong 0 +x = ulong 0 +for i ulong 8 +x = sub sub get t i get w add m i bw +put u i and x 4294967295 +bw = shr x 63 +end +sel = or get t 8 xor bw 1 +mk = sub 0 sel +for j ulong 8 +y = and get u j mk +put w add o j or y and get t j not mk +end +end + +fn cp2mrow t edit ulong 10 w edit ulong 1024 a ulong bi ulong to void +c = ulong 0 +x = ulong 0 +for j ulong 8 +x = add add get t j mul get w add a j bi c +put t j and x 4294967295 +c = shr x 32 +end +x = add get t 8 c +put t 8 and x 4294967295 +put t 9 shr x 32 +end + +fn cp2mred t edit ulong 10 w edit ulong 1024 m ulong to void +q = and mul get t 0 get w add m 8 4294967295 +x = add get t 0 mul q get w m +c = shr x 32 +j1 = ulong 0 +for k ulong 7 +j1 = add k 1 +x = add add get t j1 mul q get w add m j1 c +put t k and x 4294967295 +c = shr x 32 +end +x = add get t 8 c +put t 7 and x 4294967295 +put t 8 add get t 9 shr x 32 +end + +fn cp2mul w edit ulong 1024 o ulong a ulong b ulong m ulong to void +t = new ulong 10 0 +for i ulong 8 +cp2mrow t w a get w add b i +cp2mred t w m +end +cp2red w o t m +end + +fn cp2add w edit ulong 1024 o ulong a ulong b ulong m ulong to void +t = new ulong 10 0 +c = ulong 0 +x = ulong 0 +for i ulong 8 +x = add add get w add a i get w add b i c +put t i and x 4294967295 +c = shr x 32 +end +put t 8 c +cp2red w o t m +end + +fn cp2sub w edit ulong 1024 o ulong a ulong b ulong m ulong to void +t = new ulong 8 0 +bw = ulong 0 +x = ulong 0 +for i ulong 8 +x = sub sub get w add a i get w add b i bw +put t i and x 4294967295 +bw = shr x 63 +end +mk = sub 0 bw +c = ulong 0 +for j ulong 8 +x = add add get t j and get w add m j mk c +put w add o j and x 4294967295 +c = shr x 32 +end +end + +fn cp2modr w edit ulong 1024 o ulong m ulong to void +t = new ulong 10 0 +for i ulong 8 +put t i get w add o i +end +cp2red w o t m +end + +fn cp2lt w edit ulong 1024 a ulong m ulong to bool +bw = ulong 0 +x = ulong 0 +for i ulong 8 +x = sub sub get w add a i get w add m i bw +bw = shr x 63 +end +ret eq bw 1 +end + +fn cp2isz w edit ulong 1024 a ulong to bool +v = ulong 0 +for i ulong 8 +v = or v get w add a i +end +ret eq v 0 +end + +fn cp2eqv w edit ulong 1024 a ulong b ulong to bool +v = ulong 0 +for i ulong 8 +v = or v xor get w add a i get w add b i +end +ret eq v 0 +end + +fn cp2rng w edit ulong 1024 a ulong to bool +ret and not cp2isz w a cp2lt w a C2MN +end + +fn cp2pow w edit ulong 1024 o ulong a ulong e ulong m ulong to void +cp2cpy w C2W2 a +cp2cpy w C2W1 add m 24 +i = ulong 0 +bit = ulong 0 +for j ulong 256 +i = sub 255 j +cp2mul w C2W1 C2W1 C2W1 m +bit = and shr get w add e shr i 5 and i 31 1 +if eq bit 1 +cp2mul w C2W1 C2W1 C2W2 m +end +end +cp2cpy w o C2W1 +end + +fn cp2inv w edit ulong 1024 o ulong a ulong m ulong to void +cp2pow w o a add m 32 m +end + +fn cp2tom w edit ulong 1024 o ulong a ulong m ulong to void +cp2mul w o a add m 16 m +end + +fn cp2frm w edit ulong 1024 o ulong a ulong m ulong to void +cp2mul w o a C2ONE1 m +end + +fn cp2mod w edit ulong 1024 m ulong to void +m0 = get w m +x = m0 +for i ulong 5 +x = mul x sub 2 mul m0 x +end +put w add m 8 and sub 0 x 4294967295 +cp2set w add m 16 1 +for j ulong 512 +cp2add w add m 16 add m 16 add m 16 m +end +cp2mul w add m 24 C2ONE1 add m 16 m +cp2cpy w add m 32 m +put w add m 32 sub get w add m 32 2 +end + +fn cp2init w edit ulong 1024 to void +for i ulong 1024 +put w i 0 +end +put w 0 4294967295 +put w 1 4294967295 +put w 2 4294967295 +put w 6 1 +put w 7 4294967295 +put w 48 4234356049 +put w 49 4089039554 +put w 50 2803342980 +put w 51 3169254061 +put w 52 4294967295 +put w 53 4294967295 +put w 55 4294967295 +put w C2ONE1 1 +cp2mod w C2MP +cp2mod w C2MN +put w C2T1 668098635 +put w 577 1003371582 +put w 578 3428036854 +put w 579 1696401072 +put w 580 1989707452 +put w 581 3018571093 +put w 582 2855965671 +put w 583 1522939352 +cp2tom w C2BM C2T1 C2MP +put w C2T1 3633889942 +put w 577 4104206661 +put w 578 770388896 +put w 579 1996717441 +put w 580 1671708914 +put w 581 4173129445 +put w 582 3777774151 +put w 583 1796723186 +cp2tom w C2GX C2T1 C2MP +put w C2T1 935285237 +put w 577 3417718888 +put w 578 1798397646 +put w 579 734933847 +put w 580 2081398294 +put w 581 2397563722 +put w 582 4263149467 +put w 583 1340293858 +cp2tom w add C2GX 8 C2T1 C2MP +cp2cpy w add C2GX 16 add C2MP 24 +cp2set w C2T1 0 +end + +fn cp2padd w edit ulong 1024 o ulong a ulong q ulong to void +cp2mul w C2XX a q C2MP +cp2mul w C2YY add a 8 add q 8 C2MP +cp2mul w C2ZZ add a 16 add q 16 C2MP +cp2add w C2U a add a 8 C2MP +cp2add w C2V q add q 8 C2MP +cp2mul w C2XY C2U C2V C2MP +cp2add w C2U C2XX C2YY C2MP +cp2sub w C2XY C2XY C2U C2MP +cp2add w C2U add a 8 add a 16 C2MP +cp2add w C2V add q 8 add q 16 C2MP +cp2mul w C2YZ C2U C2V C2MP +cp2add w C2U C2YY C2ZZ C2MP +cp2sub w C2YZ C2YZ C2U C2MP +cp2add w C2U a add a 16 C2MP +cp2add w C2V q add q 16 C2MP +cp2mul w C2XZ C2U C2V C2MP +cp2add w C2U C2XX C2ZZ C2MP +cp2sub w C2XZ C2XZ C2U C2MP +note bzz3 = 3 (xz - b zz); ym = yy - bzz3; yp = yy + bzz3 +cp2mul w C2U C2BM C2ZZ C2MP +cp2sub w C2U C2XZ C2U C2MP +cp2add w C2V C2U C2U C2MP +cp2add w C2U C2V C2U C2MP +cp2sub w C2YM C2YY C2U C2MP +cp2add w C2YP C2YY C2U C2MP +note zz3 = 3 zz; bxz3 = 3 (b xz - (zz3 + xx)); xx3 = 3 xx - zz3 +cp2add w C2ZZ3 C2ZZ C2ZZ C2MP +cp2add w C2ZZ3 C2ZZ3 C2ZZ C2MP +cp2mul w C2U C2BM C2XZ C2MP +cp2add w C2V C2ZZ3 C2XX C2MP +cp2sub w C2U C2U C2V C2MP +cp2add w C2V C2U C2U C2MP +cp2add w C2BX3 C2V C2U C2MP +cp2add w C2V C2XX C2XX C2MP +cp2add w C2V C2V C2XX C2MP +cp2sub w C2XX3 C2V C2ZZ3 C2MP +note X3 = yp xy - yz bxz3; Y3 = yp ym + xx3 bxz3; Z3 = ym yz + xy xx3 +cp2mul w C2U C2YP C2XY C2MP +cp2mul w C2V C2YZ C2BX3 C2MP +cp2sub w C2RX C2U C2V C2MP +cp2mul w C2U C2YP C2YM C2MP +cp2mul w C2V C2XX3 C2BX3 C2MP +cp2add w add C2RX 8 C2U C2V C2MP +cp2mul w C2U C2YM C2YZ C2MP +cp2mul w C2V C2XY C2XX3 C2MP +cp2add w add C2RX 16 C2U C2V C2MP +cp2pcpy w o C2RX +end + +fn cp2psel w edit ulong 1024 bit ulong to void +mk = sub 0 bit +nm = not mk +for c ulong 24 +y = and get w add C2TMP c mk +put w add C2ACC c or y and get w add C2ACC c nm +end +end + +fn cp2smul w edit ulong 1024 o ulong k ulong p ulong to void +cp2pcpy w C2BASE p +cp2set w C2ACC 0 +cp2cpy w add C2ACC 8 add C2MP 24 +cp2set w add C2ACC 16 0 +i = ulong 0 +for j ulong 256 +i = sub 255 j +cp2padd w C2ACC C2ACC C2ACC +cp2padd w C2TMP C2ACC C2BASE +cp2psel w and shr get w add k shr i 5 and i 31 1 +end +cp2pcpy w o C2ACC +end + +fn cp2aff w edit ulong 1024 x ulong y ulong p ulong to void +cp2inv w C2ZI add p 16 C2MP +cp2mul w x p C2ZI C2MP +cp2frm w x x C2MP +cp2mul w y add p 8 C2ZI C2MP +cp2frm w y y C2MP +end + +fn cp2ld w edit ulong 1024 o ulong b edit uchar 4096 off ulong to void +q = ulong 0 +v = ulong 0 +for i ulong 8 +q = add off sub 28 mul i 4 +v = ulong get b q +v = or shl v 8 ulong get b add q 1 +v = or shl v 8 ulong get b add q 2 +v = or shl v 8 ulong get b add q 3 +put w add o i v +end +end + +fn cp2oncv w edit ulong 1024 to bool +if not cp2lt w C2X C2MP +ret false +end +if not cp2lt w C2Y C2MP +ret false +end +cp2tom w C2T1 C2X C2MP +cp2tom w C2T2 C2Y C2MP +cp2mul w C2T3 C2T2 C2T2 C2MP +cp2mul w C2T2 C2T1 C2T1 C2MP +cp2mul w C2T2 C2T2 C2T1 C2MP +cp2sub w C2T2 C2T2 C2T1 C2MP +cp2sub w C2T2 C2T2 C2T1 C2MP +cp2sub w C2T2 C2T2 C2T1 C2MP +cp2add w C2T2 C2T2 C2BM C2MP +ret cp2eqv w C2T2 C2T3 +end + +fn cp2vrfy w edit ulong 1024 b edit uchar 4096 to ulong +if ne get b C2BPUB 4 +ret 0 +end +cp2ld w C2X b add C2BPUB 1 +cp2ld w C2Y b add C2BPUB 33 +if not cp2oncv w +ret 0 +end +cp2ld w C2R b C2BSIG +cp2ld w C2S b add C2BSIG 32 +if not cp2rng w C2R +ret 0 +end +if not cp2rng w C2S +ret 0 +end +cp2ld w C2Z b C2BDIG +cp2modr w C2Z C2MN +cp2tom w C2T1 C2S C2MN +cp2inv w C2T1 C2T1 C2MN +cp2tom w C2T2 C2Z C2MN +cp2mul w C2U1 C2T2 C2T1 C2MN +cp2frm w C2U1 C2U1 C2MN +cp2tom w C2T2 C2R C2MN +cp2mul w C2U2 C2T2 C2T1 C2MN +cp2frm w C2U2 C2U2 C2MN +cp2tom w C2Q C2X C2MP +cp2tom w add C2Q 8 C2Y C2MP +cp2cpy w add C2Q 16 add C2MP 24 +cp2smul w C2P1 C2U1 C2GX +cp2smul w C2P2 C2U2 C2Q +cp2padd w C2P1 C2P1 C2P2 +if cp2isz w add C2P1 16 +ret 0 +end +cp2aff w C2X C2Y C2P1 +cp2modr w C2X C2MN +if cp2eqv w C2X C2R +ret 1 +end +ret 0 +end + diff --git a/native/omega/allen/vendor/cert-root.om b/native/omega/allen/vendor/cert-root.om new file mode 100644 index 00000000..e2e9b5a6 --- /dev/null +++ b/native/omega/allen/vendor/cert-root.om @@ -0,0 +1,9 @@ +note SPDX-License-Identifier: Apache-2.0 +note Public trust anchor data, not a peer certificate or leaf pin. +note Sectigo Public Server Authentication Root E46, system CA store read2026-10-25. +note Source /etc/ssl/certs/Sectigo_Public_Server_Authentication_Root_E46.pem. +note Exact DER SHA256 C90F26F0FB1B4018B22227519B5CA2B53E2CA5B3BE5CF18EFE1BEF47380C5383. +note Subject/issuer C=GB,O=Sectigo Limited,CN=Sectigo Public Server Authentication Root E46. +note Validity 2021-03-22T00:00:00Z through2046-03-21T23:59:59Z. +note Public root DER encoded as hex solely for Omega text literal portability. +text Croot "3082023a308201c1a003020102021042f2ccda1b6937445f15fe752810b8f4300a06082a8648ce3d040303305f310b300906035504061302474231183016060355040a130f5365637469676f204c696d69746564313630340603550403132d5365637469676f205075626c6963205365727665722041757468656e7469636174696f6e20526f6f7420453436301e170d3231303332323030303030305a170d3436303332313233353935395a305f310b300906035504061302474231183016060355040a130f5365637469676f204c696d69746564313630340603550403132d5365637469676f205075626c6963205365727665722041757468656e7469636174696f6e20526f6f74204534363076301006072a8648ce3d020106052b810400220362000476fa99a96e20edf9d777e3073ba8db3d5f38e8ab55a6564fd648eaec7f2daac3b2c579ec99617f1079c7025af90437f534352b77ce7f208f52a30089ecd5a7a26d5be34b9293a080f50194dcf068071ecdeefe2552b520431c1bfeeb19ce43a3a3423040301d0603551d0e04160414d122da4c59f14b5f2638aa9dd6eeeb0dc3fba961300e0603551d0f0101ff040403020186300f0603551d130101ff040530030101ff300a06082a8648ce3d0403030367003064023027eea45aa821bbe947979489a574206d794fc8bd935e5818fb2d1a006ac9b83dd0a44f4447940156a2f833250c42dfaa02301deae12e882ee1f9a71d02324ef29f6c5574e3aeaefba51aeeedd2fcc20311eb455c60103d5c7f99035b6d5448018a73" diff --git a/native/omega/allen/vendor/cert-sha384.om b/native/omega/allen/vendor/cert-sha384.om new file mode 100644 index 00000000..e09bce09 --- /dev/null +++ b/native/omega/allen/vendor/cert-sha384.om @@ -0,0 +1,333 @@ +note SPDX-License-Identifier: Apache-2.0 +note Modified 2026-10-25: SHA384 from aien-dev/omnet om/sha512/sha512.om. +note Source a14ff7efc94ea56530a61e0d91675dc970e7d806; file SHA256 +note 069a54b75484221bc7dbacfbea744ca9002c295f4f34f2c3905b0776450e3ce2. +note SHA384 IV per FIPS180-4 section 5.3.4; only first48 output bytes are SHA384. +note Compression/padding reused; names cs384, no signing. CERT-APACHE-LICENSE applies. +note SPDX-License-Identifier: Apache-2.0 +note sha512.om: SHA-512 (FIPS 180-4 section 6.4) as a library unit: functions only, no main, no +note globals. Every function name starts with cs384. +note +note API (one shot): +note fn cs384hash m view uchar 65536 n ulong o edit uchar 64 to void +note writes SHA-512(m[0..n)) as 64 bytes to o[0..64); n > 65536 traps 3. +note fn cs384pre p view uchar 64 m view uchar 65536 n ulong o edit uchar 64 to void +note writes SHA-512(p[0..64) || m[0..n)) to o[0..64); n > 65536 traps 3. +note +note Words are ulong (64-bit unsigned, wrapping add is the mod 2^64 addition of FIPS 180-4 section 3.2). +note Omega has no rotate word, so ROTR^r(x) = (x >> r) | (x << (64 - r)) (FIPS 180-4 section 3.2 item 4). +note Not constant-time audited. + +note K{512}[0..80): first 64 bits of the fractional parts of the cube roots of the first 80 primes +note (FIPS 180-4 section 4.2.3) +fn cs384k k edit ulong 80 to void +put k 0 4794697086780616226 +put k 1 8158064640168781261 +put k 2 13096744586834688815 +put k 3 16840607885511220156 +put k 4 4131703408338449720 +put k 5 6480981068601479193 +put k 6 10538285296894168987 +put k 7 12329834152419229976 +put k 8 15566598209576043074 +put k 9 1334009975649890238 +put k 10 2608012711638119052 +put k 11 6128411473006802146 +put k 12 8268148722764581231 +put k 13 9286055187155687089 +put k 14 11230858885718282805 +put k 15 13951009754708518548 +put k 16 16472876342353939154 +put k 17 17275323862435702243 +put k 18 1135362057144423861 +put k 19 2597628984639134821 +put k 20 3308224258029322869 +put k 21 5365058923640841347 +put k 22 6679025012923562964 +put k 23 8573033837759648693 +put k 24 10970295158949994411 +put k 25 12119686244451234320 +put k 26 12683024718118986047 +put k 27 13788192230050041572 +put k 28 14330467153632333762 +put k 29 15395433587784984357 +put k 30 489312712824947311 +put k 31 1452737877330783856 +put k 32 2861767655752347644 +put k 33 3322285676063803686 +put k 34 5560940570517711597 +put k 35 5996557281743188959 +put k 36 7280758554555802590 +put k 37 8532644243296465576 +put k 38 9350256976987008742 +put k 39 10552545826968843579 +put k 40 11727347734174303076 +put k 41 12113106623233404929 +put k 42 14000437183269869457 +put k 43 14369950271660146224 +put k 44 15101387698204529176 +put k 45 15463397548674623760 +put k 46 17586052441742319658 +put k 47 1182934255886127544 +put k 48 1847814050463011016 +put k 49 2177327727835720531 +put k 50 2830643537854262169 +put k 51 3796741975233480872 +put k 52 4115178125766777443 +put k 53 5681478168544905931 +put k 54 6601373596472566643 +put k 55 7507060721942968483 +put k 56 8399075790359081724 +put k 57 8693463985226723168 +put k 58 9568029438360202098 +put k 59 10144078919501101548 +put k 60 10430055236837252648 +put k 61 11840083180663258601 +put k 62 13761210420658862357 +put k 63 14299343276471374635 +put k 64 14566680578165727644 +put k 65 15097957966210449927 +put k 66 16922976911328602910 +put k 67 17689382322260857208 +put k 68 500013540394364858 +put k 69 748580250866718886 +put k 70 1242879168328830382 +put k 71 1977374033974150939 +put k 72 2944078676154940804 +put k 73 3659926193048069267 +put k 74 4368137639120453308 +put k 75 4836135668995329356 +put k 76 5532061633213252278 +put k 77 6448918945643986474 +put k 78 6902733635092675308 +put k 79 7801388544844847127 +end + +note H(0) for SHA-512: first 64 bits of the fractional parts of the square roots of the first 8 primes +note (FIPS 180-4 section 5.3.5) +fn cs384iv h edit ulong 8 to void +put h 0 14680500436340154072 +put h 1 7105036623409894663 +put h 2 10473403895298186519 +put h 3 1526699215303891257 +put h 4 7436329637833083697 +put h 5 10282925794625328401 +put h 6 15784041429090275239 +put h 7 5167115440072839076 +end + +note upper-case Sigma0{512}(x) = ROTR^28 ^ ROTR^34 ^ ROTR^39 (FIPS 180-4 section 4.1.3, (4.10)) +fn cs384bs0 x ulong to ulong +r = or shr x 28 shl x 36 +r = xor r or shr x 34 shl x 30 +r = xor r or shr x 39 shl x 25 +ret r +end + +note upper-case Sigma1{512}(x) = ROTR^14 ^ ROTR^18 ^ ROTR^41 (section 4.1.3, (4.11)) +fn cs384bs1 x ulong to ulong +r = or shr x 14 shl x 50 +r = xor r or shr x 18 shl x 46 +r = xor r or shr x 41 shl x 23 +ret r +end + +note lower-case sigma0{512}(x) = ROTR^1 ^ ROTR^8 ^ SHR^7 (section 4.1.3, (4.12)) +fn cs384ss0 x ulong to ulong +r = or shr x 1 shl x 63 +r = xor r or shr x 8 shl x 56 +r = xor r shr x 7 +ret r +end + +note lower-case sigma1{512}(x) = ROTR^19 ^ ROTR^61 ^ SHR^6 (section 4.1.3, (4.13)) +fn cs384ss1 x ulong to ulong +r = or shr x 19 shl x 45 +r = xor r or shr x 61 shl x 3 +r = xor r shr x 6 +ret r +end + +note Ch(x,y,z) = (x and y) xor (not x and z), written as z xor (x and (y xor z)) (section 4.1.3, (4.8)) +fn cs384ch x ulong y ulong z ulong to ulong +ret xor z and x xor y z +end + +note Maj(x,y,z) = (x and y) xor (x and z) xor (y and z), written as (x and y) or (z and (x or y)) +note (section 4.1.3, (4.9)) +fn cs384mj x ulong y ulong z ulong to ulong +ret or and x y and z or x y +end + +note big-endian 64-bit word of the 8 bytes at m[q..q+8) (section 3.1 item 3) +fn cs384bem m view uchar 65536 q ulong to ulong +v = ulong 0 +for j ulong 8 +v = or shl v 8 ulong get m add q j +end +ret v +end + +note the same for the 256-byte padding buffer +fn cs384bep p view uchar 256 q ulong to ulong +v = ulong 0 +for j ulong 8 +v = or shl v 8 ulong get p add q j +end +ret v +end + +note the same for the 64-byte prefix +fn cs384bex p view uchar 64 q ulong to ulong +v = ulong 0 +for j ulong 8 +v = or shl v 8 ulong get p add q j +end +ret v +end + +note message block M(i) at byte o of the stream p[0..pl) || m into w[0..16) (section 6.4.2 step 1, +note t = 0..15). pl is 0 or 64 and o is a multiple of 128, so every word lies wholly in p or in m. +fn cs384ldm p view uchar 64 pl ulong m view uchar 65536 o ulong w edit ulong 80 to void +for i ulong 16 +q = add o mul i 8 +if lt q pl +put w i cs384bex p q +else +put w i cs384bem m sub q pl +end +end +end + +note the block at byte o of the padding buffer pb into w[0..16) +fn cs384ldp pb view uchar 256 o ulong w edit ulong 80 to void +for i ulong 16 +put w i cs384bep pb add o mul i 8 +end +end + +note one SHA-512 compression (section 6.4.2 steps 1-4); w[0..16) holds the block on entry +fn cs384blk h edit ulong 8 w edit ulong 80 k view ulong 80 to void +for i ulong 64 +t = add i 16 +v = cs384ss1 get w sub t 2 +v = add v get w sub t 7 +v = add v cs384ss0 get w sub t 15 +v = add v get w i +put w t v +end +a = get h 0 +b = get h 1 +c = get h 2 +d = get h 3 +e = get h 4 +f = get h 5 +g = get h 6 +x = get h 7 +for i ulong 80 +t = add x cs384bs1 e +t = add t cs384ch e f g +t = add t get k i +t = add t get w i +u = add cs384bs0 a cs384mj a b c +x = g +g = f +f = e +e = add d t +d = c +c = b +b = a +a = add t u +end +put h 0 add get h 0 a +put h 1 add get h 1 b +put h 2 add get h 2 c +put h 3 add get h 3 d +put h 4 add get h 4 e +put h 5 add get h 5 f +put h 6 add get h 6 g +put h 7 add get h 7 x +end + +note Padding (section 5.1.2) of the stream p[0..pl) || m, tot bytes long, whose bytes from off on +note (fewer than 128) are not yet compressed: they go to pb[0..r), then one 1 bit (byte 128), zero bytes +note up to 112 mod 128, then l = 8 * tot as a 128-bit big-endian integer. pb must be all zero on entry. +note Returns the padded length, 128 when r < 112, else 256. The upper 64 bits of l are always 0 here +note because tot <= 65600. +fn cs384pad p view uchar 64 pl ulong m view uchar 65536 off ulong tot ulong pb edit uchar 256 to ulong +r = sub tot off +for i ulong r +q = add off i +if lt q pl +put pb i get p q +else +put pb i get m sub q pl +end +end +put pb r 128 +e = ulong 128 +if ge r 112 +e = 256 +end +cs384len pb e mul tot 8 +ret e +end + +note the low 64 bits of the 128-bit big-endian length field ending at pb[e-1] +fn cs384len pb edit uchar 256 e ulong bits ulong to void +for i ulong 8 +y = sub sub e 1 i +put pb y uchar and shr bits mul i 8 255 +end +end + +note H(N) as the 64-byte big-endian digest (section 6.4.2, final hash value) +fn cs384out h view ulong 8 o edit uchar 64 to void +for i ulong 8 +v = get h i +for j ulong 8 +put o add mul i 8 j uchar and shr v mul sub 7 j 8 255 +end +end +end + +note SHA-512 of the stream p[0..pl) || m[0..n), pl 0 or 64 (else trap 3), n <= 65536 (else trap 3), +note digest to o[0..64). +fn cs384core p view uchar 64 pl ulong m view uchar 65536 n ulong o edit uchar 64 to void +if gt n 65536 +trap 3 +end +if ne pl 0 +if ne pl 64 +trap 3 +end +end +h = new ulong 8 0 +w = new ulong 80 0 +k = new ulong 80 0 +pb = new uchar 256 0 +cs384k k +cs384iv h +tot = add pl n +off = ulong 0 +while le add off 128 tot bound 514 +cs384ldm p pl m off w +cs384blk h w k +off = add off 128 +end +e = cs384pad p pl m off tot pb +cs384ldp pb 0 w +cs384blk h w k +if eq e 256 +cs384ldp pb 128 w +cs384blk h w k +end +cs384out h o +end + +note SHA-512(m[0..n)), n <= 65536 (else trap 3), digest to o[0..64) +fn cs384hash m view uchar 65536 n ulong o edit uchar 64 to void +z = new uchar 64 0 +cs384core z 0 m n o +end + diff --git a/native/omega/allen/vendor/sha256-core.om b/native/omega/allen/vendor/sha256-core.om new file mode 100644 index 00000000..db069dcb --- /dev/null +++ b/native/omega/allen/vendor/sha256-core.om @@ -0,0 +1,179 @@ +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + diff --git a/native/omega/allen/vendor/sha256.om b/native/omega/allen/vendor/sha256.om new file mode 100644 index 00000000..594ef68d --- /dev/null +++ b/native/omega/allen/vendor/sha256.om @@ -0,0 +1,213 @@ +note SPDX-License-Identifier: AGPL-3.0-or-later +note SHA256 core reused byte-for-byte from native Omega TRN1 at 12251e3403d42931ada27dc1c54b3b610954be5d. +note Reads stdin up to 8 MiB and emits lowercase hex plus LF only after successful EOF. +global Buf uchar 8192 +global H uint 8 +global Vv uint 8 +global W uint 64 +global K uint 64 +global Hb uchar 64 +global Hs ulong 2 +global Hash uchar 32 +global Out uchar 65 +text Hex "0123456789abcdef" + +fn rotate x uint n uint to uint +ret or shr x n shl x sub 32 n +end + +fn round i ulong to void +e = get Vv 4 +a = get Vv 0 +s = xor xor rotate e 6 rotate e 11 rotate e 25 +c = xor and e get Vv 5 and not e get Vv 6 +t = add add get Vv 7 s add c add get K i get W i +s = xor xor rotate a 2 rotate a 13 rotate a 22 +c = and a get Vv 1 +c = xor c and a get Vv 2 +c = xor c and get Vv 1 get Vv 2 +u = add s c +put Vv 7 get Vv 6 +put Vv 6 get Vv 5 +put Vv 5 e +put Vv 4 add get Vv 3 t +put Vv 3 get Vv 2 +put Vv 2 get Vv 1 +put Vv 1 a +put Vv 0 add t u +end + +fn block to void +for i ulong 16 +x = uint 0 +for j ulong 4 +x = or shl x 8 uint get Hb add mul i 4 j +end +put W i x +end +for j ulong 48 +i = add j 16 +x = get W sub i 15 +y = get W sub i 2 +s = xor xor rotate x 7 rotate x 18 shr x 3 +t = xor xor rotate y 17 rotate y 19 shr y 10 +put W i add add get W sub i 16 s add get W sub i 7 t +end +for i ulong 8 +put Vv i get H i +end +for i ulong 64 +round i +end +for i ulong 8 +put H i add get H i get Vv i +end +end + +fn hinit to void +put H 0 1779033703 +put H 1 3144134277 +put H 2 1013904242 +put H 3 2773480762 +put H 4 1359893119 +put H 5 2600822924 +put H 6 528734635 +put H 7 1541459225 +put Hs 0 0 +put Hs 1 0 +end + +fn hbyte c uchar to void +p = get Hs 0 +put Hb p c +p = add p 1 +put Hs 1 add get Hs 1 1 +if eq p 64 +block +p = 0 +end +put Hs 0 p +end + +fn update off ulong count ulong to void +for i ulong count +hbyte get Buf add off i +end +end + +fn finish to void +bits = mul get Hs 1 8 +hbyte 128 +while ne get Hs 0 56 +hbyte 0 +end +for i ulong 8 +hbyte uchar and shr bits mul sub 7 i 8 255 +end +for i ulong 32 +x = get H div i 4 +put Hash i uchar and shr x uint mul sub 3 rem i 4 8 255 +end +end + +fn constants to void +put K 0 1116352408 +put K 1 1899447441 +put K 2 3049323471 +put K 3 3921009573 +put K 4 961987163 +put K 5 1508970993 +put K 6 2453635748 +put K 7 2870763221 +put K 8 3624381080 +put K 9 310598401 +put K 10 607225278 +put K 11 1426881987 +put K 12 1925078388 +put K 13 2162078206 +put K 14 2614888103 +put K 15 3248222580 +put K 16 3835390401 +put K 17 4022224774 +put K 18 264347078 +put K 19 604807628 +put K 20 770255983 +put K 21 1249150122 +put K 22 1555081692 +put K 23 1996064986 +put K 24 2554220882 +put K 25 2821834349 +put K 26 2952996808 +put K 27 3210313671 +put K 28 3336571891 +put K 29 3584528711 +put K 30 113926993 +put K 31 338241895 +put K 32 666307205 +put K 33 773529912 +put K 34 1294757372 +put K 35 1396182291 +put K 36 1695183700 +put K 37 1986661051 +put K 38 2177026350 +put K 39 2456956037 +put K 40 2730485921 +put K 41 2820302411 +put K 42 3259730800 +put K 43 3345764771 +put K 44 3516065817 +put K 45 3600352804 +put K 46 4094571909 +put K 47 275423344 +put K 48 430227734 +put K 49 506948616 +put K 50 659060556 +put K 51 883997877 +put K 52 958139571 +put K 53 1322822218 +put K 54 1537002063 +put K 55 1747873779 +put K 56 1955562222 +put K 57 2024104815 +put K 58 2227730452 +put K 59 2361852424 +put K 60 2428436474 +put K 61 2756734187 +put K 62 3204031479 +put K 63 3329325298 +end + +note Handwritten stream interface around the pinned native Omega SHA256 core. +fn main to int +constants +hinit +total = ulong 0 +n = read 0 Buf 0 len Buf +while gt n 0 +if gt ulong n sub ulong 8388608 total +ret 3 +end +update 0 ulong n +total = add total ulong n +n = read 0 Buf 0 len Buf +end +if lt n 0 +ret 2 +end +finish +for i ulong 32 +c = get Hash i +put Out mul i 2 get Hex ulong shr c 4 +put Out add mul i 2 1 get Hex ulong and c 15 +end +put Out 64 uchar 10 +sent = ulong 0 +while lt sent 65 +w = write 1 Out sent sub ulong 65 sent +if le w 0 +ret 2 +end +sent = add sent ulong w +end +ret 0 +end diff --git a/native/omega/allen/view.om b/native/omega/allen/view.om new file mode 100644 index 00000000..c221d158 --- /dev/null +++ b/native/omega/allen/view.om @@ -0,0 +1,98 @@ +note Exact legacy code row wrapping, at most4096 rows; full code retained. +global Rowst ulong 4096 +global Rowlen ulong 4096 +global Rowline ulong 4096 +global View ulong 4 +global Vwork ulong 6 +note Vwork cols,maxrows,line,start,end. +fn onerow s ulong first bool to ulong +take = sub get Vwork 4 s +cols = get Vwork 0 +if gt take cols +take = cols +j = cols +while gt j div cols 2 +if eq get Code sub add s j 1 32 +take = j +j = 0 +else +j = sub j 1 +end +end +end +slot = get View 0 +put Rowst slot s +put Rowlen slot take +put Rowline slot 0 +if first +put Rowline slot get Vwork 2 +end +put View 0 add slot 1 +ret add s take +end +fn rowroom pos ulong to bool +ret and lt pos get C 2 lt get View 0 get Vwork 1 +end +fn moreline s ulong to bool +ret and lt s get Vwork 4 lt get View 0 get Vwork 1 +end +fn rows cols ulong maxrows ulong to bool +if or eq cols 0 gt maxrows 4096 +ret false +end +if ne codestat 2 +ret false +end +put Vwork 0 cols +put Vwork 1 maxrows +put Vwork 2 1 +put View 0 0 +put View 1 0 +pos = ulong 0 +while rowroom pos +stop = pos +while lt stop get C 2 +if eq get Code stop 10 +put Vwork 4 stop +stop = get C 2 +else +stop = add stop 1 +put Vwork 4 stop +end +end +s = pos +if lt get View 0 maxrows +s = onerow s true +end +while moreline s +s = onerow s false +end +pos = add get Vwork 4 1 +put Vwork 2 add get Vwork 2 1 +end +ret true +end +fn scroll delta long page ulong to ulong +last = ulong 0 +if gt get View 0 page +last = sub get View 0 page +end +if gt get View 1 last +put View 1 last +end +top = long get View 1 +if lt delta 0 +if lt delta neg top +put View 1 0 +ret 0 +end +else +if gt ulong delta sub last get View 1 +put View 1 last +ret last +end +end +top = add top delta +put View 1 ulong top +ret ulong top +end