Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-mv/patches/277eba7f65feea34 # omega-mv Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance. Brought by drakestapleton Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers ## Run Omega serving and inference directly in an ARM64 UEFI guest open `277eba7f65feea34` #1053 · opened 2026-11-06 19:18 UTC Imported from GitHub aien-dev/omega-mv#1053, by drakestapleton Base `fd3751b314299f16a624aefb0cc1bb919e7fa65f` · Head `b6411ca0a6e299a8da8803654cd6d52adde2372f` drakestapleton wrote on 2026-11-06 19:18 UTC Omega's existing firmware path requires x86 emulation on an ARM64 Mac. This adds `target aarch64efi` with ARM64 PE32+, the firmware ABI, bounded file/network operations and event waits, plus ordered binary64 `vmadd2`/`vdot4` kernels. HTTP/SSE protocol code now has a transport boundary while the existing Linux `http.om` remains its exact compatibility concatenation. Verification at source `0b17fda6a7b80e1ca5b82c3e38fa7bc862889b16`, compiler SHA256 `c54c9a149a23fc86fb96e08b433e09b555f690a0266c43a4b0e6095449035496`: - `quiet-build sh seed/omega-from-seed.sh`: seeded fixpoint PASS. - `quiet-build sh seed/host/check.sh`: full host suite PASS, including HTTP transport and negative controls. C executables are comparison oracles only. - `tests/aarch64efi/run.py`: ARM64 Mac HVF execution PASS for ABI-sensitive floats, files/repeated waits, vector corner cases, bounds, target refusals and deliberately incorrect arithmetic. Wrong compiler pin rejected before output creation. - Pinned crumb verification PASS. Logs, source/binary hashes and limitations are in `evidence/ARM64-EFI-20261106/qualification.997ca6e49dc0fcafa69aa8e2ea09bb53a0724fd1eb4680021d329464601e2ac1.json`. Measurements preceded the source commit and are tied to the exact input hashes; the receipt was created from a clean committed tree. Physical ARM firmware, real device IRQ/GPU execution and a standalone kernel are NOT_RUN. Wycheproof's absent fixture and live external TLS remain excluded. Aienux application/browser qualification and Linux performance acceptance are separate consumer gates; this draft makes no speed claim or default rollout. Existing bridge/generated-unit consumers keep their own pins. The inherited seed rung already supports 4096 functions and is unchanged here; compiler function count is 516. Companion branches: `aien-dev/aien-train:feat/astra-inference-cache`, `aien-dev/aienux:feat/arm64-model`, and `aien-dev/omega-harness:docs/arm64-omega-ui`. Harness guidance is being updated alongside the consumer receipts. ### Apply it ``` git checkout -b patch-277eba7f65feea34 fd3751b314299f16a624aefb0cc1bb919e7fa65f curl -fsSL https://interplane.io/drakestapleton/omega-mv/patches/277eba7f65feea34.patch | git am ``` Raw patch (mbox) · Diff ### Provenance This proposal is imported from GitHub; it is not signed by its author. Its import statement and source record: ``` github-import 1 aien-dev/omega-mv 1053 b6411ca0a6e299a8da8803654cd6d52adde2372f ``` ``` {"kind":"github-import","owner":"aien-dev","repo":"omega-mv","number":1053,"url":"https://github.com/aien-dev/omega-mv/pull/1053","export_sha256":"7319147b350ad908bf0b731068ec3be7b8dee848041dc862f71455e8e4680140","imported_utc":"2026-11-18T16:35:40Z"} ``` ### Changes ``` diff --git a/.crumb b/.crumb index 0820f2f27..d99e672f7 100644 --- a/.crumb +++ b/.crumb @@ -47,7 +47,7 @@ "purpose": "Directory calibration. Purpose not yet described by a human." }, { - "digest": "7ea98a34750464c170bc103e362495ca893b72a7fae9baf192ad8b2606a9551f", + "digest": "ede56e783621f4e6ab9afec319a99de5d51f81355f3f9eaa46d290980082968f", "last_commit": "369f3d486", "name": "docs", "purpose": "Directory docs. Purpose not yet described by a human." @@ -95,7 +95,7 @@ "purpose": "Directory src. Purpose not yet described by a human." }, { - "digest": "30ff9017b760b1486add5c105f2a3b2bd3c4bf9b7e2cb656d666d87a6c6289eb", + "digest": "9389099648c968b6e6942664491b7488140fbf60dbbfd372097d4fb60e0ed178", "last_commit": "e45dbca35", "name": "tests", "purpose": "Directory tests. Purpose not yet described by a human." @@ -107,15 +107,15 @@ "purpose": "Directory tools. Purpose not yet described by a human." } ], - "children_root": "sha256:8084c656403a38acf240dd756007e260ff260d66077c2ecf6f4996386bb11c76", - "compiled_at": "2026-11-06T15:48:00Z", + "children_root": "sha256:869136b92f4fe675ec3b4e9923b8f5d49856969478e22ac65b61d536bfa24243", + "compiled_at": "2026-11-06T19:04:53Z", "compiler": "crumb-compile/1", - "digest": "sha256:a9ae4f71727af4cbb5999a3b2aaf7b151634468de7d8927267c42cf7bbbae486", + "digest": "sha256:fa1b822a99ae21fe4627ece5f5a6b48e617d68336e23ba71afec0b8018817ed6", "evidence_files": 15689, "evidence_root": "sha256:0876d6812111ecacc32cfca21d6c14a1e817034d86eab1200d2832403414185d", - "files": 24223, - "generated_at_commit": "c93a46d5b6723c12fc0e55dbb055d59a8ee07b34", - "source_tree": "sha256:aaf1be41915304989d7ccbcd0f2da9521fa5bff8f70bc1fa5c6b96d5cd910393" + "files": 24233, + "generated_at_commit": "fd3751b314299f16a624aefb0cc1bb919e7fa65f", + "source_tree": "sha256:965cd4fb7cf96f19794fe86958fc36524baeafe0398a40904f5407187642fb18" }, "owner_lane": "", "provenance": { diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index dfb2f0078..312fbb917 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -133,3 +133,4 @@ Update this table in the same commit as the work it credits. | Claude Opus 5.5 (BridgeHost, via omp) | Stacked the hosted-x86 device lowerers and fixtures on the exact aien-gpu ABI1 allowlist profile, preserving frozen compiler profiles and rebuilding the superset from seed0; qualification remains host/emulator-only. | | Claude Opus 5.5 | Fixed float literal rounding in omc (#1024): `fbits` now divides exact 32-bit-limb integers (`fbmul`/`fbpow`/`fbsub` replace `fmul10`/`fmn10`/`fdiv10`) and rounds once to nearest even; refused integer literals under a float type with error 7 (#1026); added gate8 `lit_round` (512 literals) and `neg_int_*`, and `seed/omc/float-lits.py` (exact rational oracle, randomized differential: 1,000,000 literals, 0 mismatches). | | Codex | Reused #1027's exact-limb float converter on main 5287336a and added explicit AArch64 `fma` (227), same-type/refusal fixtures and seeded wrong-opcode/unfused/rounding mutants. Wolfram independently checks the inherited 512 literal expectations and fused counterexamples. Candidate-only profile: active bridge and generated-unit pins remain integration-owned. | +| Codex | Added the ARM64 EFI application target, firmware ABI and event/network/file adapters, ordered binary64 NEON kernels, and HTTP transport separation. Qualification includes seeded fixpoint, host checks, HVF execution, scalar parity, bounds and deliberately incorrect-code controls; application performance is a separate consumer gate. | diff --git a/docs/.crumb b/docs/.crumb index 55e757f2e..50634a054 100644 --- a/docs/.crumb +++ b/docs/.crumb @@ -46,92 +46,92 @@ "children": [ { "digest": "640f6b7b818c769ab0dcd91437d58dd3251044084d2ae3785f000d30d2bb768a", - "last_commit": "a927bd6c", + "last_commit": "a927bd6c2", "name": "adr", "purpose": "Directory docs/adr. Purpose not yet described by a human." }, { "digest": "e7ac2460455a35b96b01dab649dcdc2cdf5bb4657bf230b91272c64fe1bf82cf", - "last_commit": "d48ab89e", + "last_commit": "d48ab89e5", "name": "autodiff", "purpose": "M21 OMEGA_AUTODIFF scope, op and error-contract table, status (not qualified)" }, { "digest": "7506b1a8659e6de84e1be31a281c8d046e4946de6ed29451155bb56cda5cb365", - "last_commit": "6637b32b", + "last_commit": "6637b32b6", "name": "brownian", "purpose": "Directory docs/brownian. Purpose not yet described by a human." }, { "digest": "1b01542d91e3b1c7c5263d6b393338a3d9d40e138a12ec833ce7852d83887ce2", - "last_commit": "5901baa5", + "last_commit": "5901baa51", "name": "crumbs", "purpose": "Directory docs/crumbs. Purpose not yet described by a human." }, { "digest": "e9baaaeec04be41a57c4a2d6a540b01a682c70d4db96cb4af4e1a9912a133aa9", - "last_commit": "55d05d6a", + "last_commit": "55d05d6a5", "name": "dual", "purpose": "DUAL (ARCH-0031) documents in omega: applicability experiment method and findings (APPLICABILITY" }, { "digest": "56a5a999ce726e90d89c1c88b9e20c81857c8e6ee82af8d651ac80ea70e2c46d", - "last_commit": "38a6a569", + "last_commit": "38a6a569b", "name": "estimation", "purpose": "Directory docs/estimation. Purpose not yet described by a human." }, { "digest": "a42a389a4759996ebf8e4f949b3e763189ca135edede5b344f50f22abf8daa6c", - "last_commit": "e673cbb5", + "last_commit": "e673cbb52", "name": "numeric", "purpose": "Directory docs/numeric. Purpose not yet described by a human." }, { "digest": "1a26b15f795aa3581a03400a21d5635e85c71f3f544fcc3676fa58064402c7ad", - "last_commit": "968734c7", + "last_commit": "968734c7e", "name": "osc", "purpose": "Directory docs/osc. Purpose not yet described by a human." }, { "digest": "645b6abb9d46a13dff6c9091d79acf0318fcfdc447a2dc50a3b70cd0dcfaa548", - "last_commit": "968734c7", + "last_commit": "968734c7e", "name": "polyglot", "purpose": "Directory docs/polyglot. Purpose not yet described by a human." }, { "digest": "46d3e2d59a468271e044ccd2398eb32345df6436c15eb6d8c703953c838023a9", - "last_commit": "dd67f6bd", + "last_commit": "dd67f6bd7", "name": "reservoir", "purpose": "Reservoir reference and contracts (omega#440): RESERVOIR_REFERENCE.md pins the authors' paper an" }, { "digest": "0ac79e08651d371318bb0c1bd8b750017a12273c68a4357eee744a8d927ad5f0", - "last_commit": "43529f85", + "last_commit": "43529f85f", "name": "tensor", "purpose": "M20 OMEGA_TENSOR spec and qualification checklist" }, { "digest": "41ab5cf8617e9583dcda75292e1e851e1ec4187b69d5d00b5eb354f1ee55c9d5", - "last_commit": "54826a37", + "last_commit": "54826a37f", "name": "train", "purpose": "Directory docs/train. Purpose not yet described by a human." }, { "digest": "5db2869ff0b78866ad0ce38f77b262e81fdbc89408e94968491c4e6548177278", - "last_commit": "968734c7", + "last_commit": "968734c7e", "name": "turing", "purpose": "Directory docs/turing. Purpose not yet described by a human." } ], "children_root": "sha256:d25011adea349d458cc24cb696a242a665e67fc241f3942fbb88af6897e08b6b", - "compiled_at": "2026-11-06T15:08:32Z", + "compiled_at": "2026-11-06T19:04:53Z", "compiler": "crumb-compile/1", - "digest": "sha256:7ea98a34750464c170bc103e362495ca893b72a7fae9baf192ad8b2606a9551f", + "digest": "sha256:ede56e783621f4e6ab9afec319a99de5d51f81355f3f9eaa46d290980082968f", "evidence_files": 34, "evidence_root": "sha256:589d8b3706e6d7a202ab20b278dac5fc5bafc973f1c2a867b2668aa7210b65cc", - "files": 149, - "generated_at_commit": "016006168fa90a10a6cbab21628da4ad7e8a6e5c", - "source_tree": "sha256:b14e27b1504e4cf3e54fbfa5c99ece160afaf773f975ad06b5367eefbb73e6c0" + "files": 150, + "generated_at_commit": "fd3751b314299f16a624aefb0cc1bb919e7fa65f", + "source_tree": "sha256:a16800f6470eba68bfd9da639e346b68f0e6b1eb46ca2512f349f54571edb4bc" }, "owner_lane": "", "provenance": { diff --git a/docs/ARM64-EFI.md b/docs/ARM64-EFI.md new file mode 100644 index 000000000..567ce929f --- /dev/null +++ b/docs/ARM64-EFI.md @@ -0,0 +1,85 @@ +# ARM64 EFI application target + +`target aarch64efi` selects a whole-program PE32+ EFI application (COFF +machine `0xaa64`, subsystem 10). It reuses the AArch64 instruction generator. +This is an application under UEFI boot services, not a standalone kernel. +Linux host words and bare units are refused with compiler error 25. No Linux +syscall or C runtime supplies the firmware operations. + +The entry adapter preserves x19..x30, d8..d15, FPCR and FPSR, installs IEEE +round-to-nearest floating-point state, disables the firmware watchdog, and +uses an 8 MiB private stack with a 16 KiB reserved floor. Image-relative +ADRP/ADD addresses are relocated; numeric constants are not. Return, explicit +exit and traps restore the firmware register/stack state and release owned +file, timer-event and network resources. Trap T returns EFI_STATUS +`2^63 | (100 + T)`. + +## Firmware interface + +`r = efi OP ARG A OFF N` checks the buffer range before calling firmware. +The result is `ulong`; bit 63 indicates an error. OP must be a literal. + +| OP | ARM64 behavior | +|---|---| +| 0 | 64-byte boot/network information, including the active SNP MAC | +| 1 | Console key input | +| 2 | Firmware Stall, retained for callers that explicitly need it | +| 5 | Firmware RNG protocol | +| 6 | SNP receive into a bounded caller buffer with an eight-byte length prefix | +| 7 | SNP transmit through a bounded private copy, retained until firmware returns ownership | +| 8 | Enumerate, validate and exclusively open an Ethernet SNP candidate | +| 10 | Monotonic firmware milliseconds, eight-byte little-endian result | +| 12 | Read-only files on the boot volume; write/create modes refused | +| 13 | Firmware text console output | +| 15 | Event wait, ARG milliseconds in 0..1000, using a firmware timer event | + +Other declared operations return an explicit unsupported error. OP 15 caches +its timer event and optional Timer Architectural Protocol. A nonzero wait +adjusts the firmware tick to at most 100 ms, retaining the original period +for restoration on image exit. It calls WaitForEvent rather than a Stall +loop. Network receive is pumped by the caller; the wait does not register SNP +WaitForPacket, avoiding duplicate polling by firmware event callbacks. Firmware that polls SNP still requires bounded wakeups; this interface +does not promise hardware packet interrupts or an idle-CPU result. + +SNP selection checks Ethernet address size, interface type and receive filter +support. It bounds enumeration, frees the handle list, cleans up a rejected +candidate, and never closes another application's protocol ownership. + +## Ordered vector kernels + +Both new statements require binary64 arrays and AArch64 program mode, +including `aarch64efi`. x86 targets refuse them with error 25; IR mode refuses +with error 9. Read-only destinations are error 20. Operands are evaluated and +ranges checked before stores. Frozen/unknown-initialization arrays are +conservatively refused as for other bulk operations. + +- `vmadd2 D DI W WI A` computes two independent lanes + `D[DI+j] = D[DI+j] + A * W[WI+j]`. DI and WI are `ulong`, A is `f64`. + Both source lanes and destination lanes are read before stores, including + when they alias. Separate FMUL and FADD preserve binary64 rounding. +- `vdot4 D X XO W WO ROWS STRIDE` computes four independent dot products + into D[0..3]. Each starts at positive zero and visits rows in ascending + order, multiplying X[XO+r] by W[WO+r*STRIDE+j]. All integer operands are + `ulong`. Nonzero rows require STRIDE >= 4. ROWS is at most 999999 (trap 4); + invalid array ranges trap 3. Zero rows write four positive zeros and do + not read X or W. All four results are stored after all reads, so aliases + preserve the original input. There is no fused arithmetic or reassociation. + +`seed/net/http-core.om` contains HTTP and SSE protocol logic. The transport +contract is implemented by `http-linux.om`; `http.om` remains their exact +concatenation for existing Linux consumers. An EFI consumer supplies the +same transport functions using its network implementation. + +## Qualification + +`tests/aarch64efi/run.py` checks the compiler pin before creating output and +requires an ARM64 Mac with QEMU HVF. It checks ARM PE headers, ABI-sensitive +floating-point execution, file access, repeated event waits, bounds and +refusals, 41 scalar floating-point outputs, ordered vector corner cases, +and deliberately incorrect arithmetic instructions. Each run uses a fresh +output directory and retains compile diagnostics and serial logs. + +The seeded compiler and host suites run separately on ARM64 Linux. Host +results do not qualify physical ARM firmware, and HVF execution does not +qualify a standalone kernel. Application performance, idle CPU and browser +behavior belong to the Aienux consumer's separate acceptance measurements. diff --git a/docs/one_layer/OMEGESE.md b/docs/one_layer/OMEGESE.md index 1b09d23ee..01cbeada8 100644 --- a/docs/one_layer/OMEGESE.md +++ b/docs/one_layer/OMEGESE.md @@ -460,6 +460,14 @@ and a call to it is error 3): `r = efi OP ARG A OFF N`, OP a literal 0..14 (a li EFI_STATUS `2^63 | (100 + T)`. See [the x86efi design and evidence](../X86-EFI.md) for the operations, the efi 12 file contract and qualification status. +An initial line `target aarch64efi` selects the ARM64 PE32+ UEFI application +backend. It accepts whole programs, preserves AAPCS64 firmware state, and +refuses Linux host words and bare units with error 25. The target-scoped +`efi OP ARG A OFF N` interface supports the operations documented in +[ARM64 EFI](../ARM64-EFI.md), including event wait OP 15. The same document +specifies the AArch64-only ordered binary64 `vmadd2` and `vdot4` statements; +they use separate multiply and add instructions, with checked array ranges. + ### 9.2 Functions and calls - `fn` may appear many times. A names pass reads every signature before any code is written, so a call diff --git a/evidence/ARM64-EFI-20261106/L899-host-final3.log.fcf7cb624d0dff00fc9bfef2df8ab570869fc507f903dc57dad260f0fef2d574.txt b/evidence/ARM64-EFI-20261106/L899-host-final3.log.fcf7cb624d0dff00fc9bfef2df8ab570869fc507f903dc57dad260f0fef2d574.txt new file mode 100644 index 000000000..fccf6f9f6 --- /dev/null +++ b/evidence/ARM64-EFI-20261106/L899-host-final3.log.fcf7cb624d0dff00fc9bfef2df8ab570869fc507f903dc57dad260f0fef2d574.txt @@ -0,0 +1,947 @@ +PASS seed0 408 bytes, rebuilds itself +PASS hex1 776 bytes, born from seed0 +PASS asm2 2464 bytes, born from hex1 +PASS om4 om4.bin 14224 bytes +PASS omc fixpoint c54c9a149a23fc86fb96e08b433e09b555f690a0266c43a4b0e6095449035496 +PASS fwd exit 0 +PASS fwd runs, exit 7 +PASS mut exit 0 +PASS mut runs, exit 0 +PASS cycle exit 9 +PASS assign exit 7 +RC=0 +PASS fixpoint c54c9a149a23fc86fb96e08b433e09b555f690a0266c43a4b0e6095449035496 build/seed/ir/stage3 +OK bytes=133 functions=1 +PASS dev01 identical; checker2 ACCEPT +OK bytes=120 functions=1 +PASS dev02 identical; checker2 ACCEPT +OK bytes=243 functions=1 +PASS dev03 identical; checker2 ACCEPT +OK bytes=205 functions=1 +PASS dev04 identical; checker2 ACCEPT +OK bytes=58 functions=1 +PASS dev05 identical; checker2 ACCEPT +OK bytes=55 functions=1 +PASS dev06 identical; checker2 ACCEPT +OK bytes=244 functions=1 +PASS dev07 identical; checker2 ACCEPT +OK bytes=331 functions=1 +PASS dev08 identical; checker2 ACCEPT +OK bytes=203 functions=1 +PASS dev09 identical; checker2 ACCEPT +OK bytes=48 functions=1 +PASS dev10 identical; checker2 ACCEPT +PASS mul-to-add mutant differs +PASS struct_decl refused 9 +PASS global_decl refused 9 +PASS text_decl refused 9 +PASS float_use refused 3 +PASS continue_use refused 3 +PASS requires_line refused 30 +PASS ensures_line refused 30 +PASS invariant_line refused 30 +PASS integer constant folds to the literal IR +PASS trap_const constant folds to the literal IR +PASS bound_const constant folds to the literal IR +PASS for_const constant folds to the literal IR +PASS for_bound_const constant folds to the literal IR +PASS for_bound_default constant folds to the literal IR +PASS for_bound_zero refused 8 +PASS for_bound_over refused 8 +PASS for_num_bound guarded; checker2 ACCEPT +PASS while_bound_max identical; checker2 ACCEPT +PASS while_bound_over refused 8 +PASS for_bound_max guarded; checker2 ACCEPT +PASS for_bound_c2 refused 8 +PASS for_count_max identical; checker2 ACCEPT +PASS for_count_over refused 8 +PASS for_count_neg refused 8 +PASS for_count_negzero refused 8 +PASS for_count_const_over refused 8 +PASS float_const refused 9 +PASS call_self refused 3 +PASS call_forward refused 3 +PASS call_nonvoid_stmt refused 7 +PASS call_void_value refused 7 +PASS call_arg_type refused 7 +PASS call_arg_local refused 7 +PASS call_result_type refused 7 +PASS break_outside refused 9 +PASS after_break refused 17 +PASS bin_type_local refused 7 +PASS bin_bool refused 7 +PASS bin_shift_bool refused 7 +PASS bin_result_type refused 7 +PASS cmp_assign_type refused 7 +PASS bool_result refused 7 +PASS neg_bool refused 7 +PASS cond_type refused 7 +PASS ret_type_local refused 7 +PASS neg_bool_local refused 7 +PASS trailing_value refused 5 +PASS untyped_new refused 11 +PASS missing_operand refused 4 +PASS bare_neg refused 11 +PASS end_trailing refused 5 +PASS while_trailing refused 5 +PASS ret_missing refused 4 +PASS ret_void_value refused 5 +PASS keyword_name refused 16 +PASS stmt_number refused 16 +PASS shadow_param_for refused 10 +PASS shadow_nested_for refused 10 +PASS param_dup refused 10 +PASS param_fn_name refused 10 +PASS param_self_name refused 10 +PASS scope_if refused 3 +PASS scope_else refused 3 +PASS scope_for refused 3 +PASS fallthrough refused 18 +PASS float_param refused 9 +PASS float_ret refused 9 +PASS else_twice refused 15 +PASS else_outside refused 15 +PASS eof_in_fn refused 15 +PASS range_typed refused 8 +PASS range_bare refused 8 +PASS range_bare_left refused 8 +PASS range_negative refused 8 +PASS cast_lit_range refused 8 +PASS cast_opnd_range refused 8 +PASS cast_signed_range refused 8 +PASS cast_bool_num refused 9 +PASS cast_num_bool refused 9 +PASS cast_cmp_bool refused 9 +PASS long_local refused 13 +PASS long_param refused 13 +PASS long_for refused 13 +PASS long_prefix_ref refused 3 +PASS note_dead same IR +OK bytes=109 functions=2 +PASS call_value IR identical; checker2 ACCEPT +OK bytes=100 functions=2 +PASS call_void IR identical; checker2 ACCEPT +OK bytes=83 functions=2 +PASS call_zero IR identical; checker2 ACCEPT +OK bytes=113 functions=2 +PASS call_two IR identical; checker2 ACCEPT +OK bytes=119 functions=2 +PASS call_long IR identical; checker2 ACCEPT +OK bytes=118 functions=2 +PASS call_nested IR identical; checker2 ACCEPT +OK bytes=139 functions=2 +PASS call_expr IR identical; checker2 ACCEPT +OK bytes=260 functions=2 +PASS call_loop IR identical; checker2 ACCEPT +OK bytes=209 functions=2 +PASS call_six IR identical; checker2 ACCEPT +OK bytes=267 functions=1 +PASS break_while IR identical; checker2 ACCEPT +OK bytes=212 functions=1 +PASS break_for IR identical; checker2 ACCEPT +OK bytes=378 functions=1 +PASS break_nested IR identical; checker2 ACCEPT +OK bytes=70 functions=1 +PASS shift_mixed IR identical; checker2 ACCEPT +OK bytes=78 functions=1 +PASS cmp_assign IR identical; checker2 ACCEPT +OK bytes=55 functions=1 +PASS cast_ret IR identical; checker2 ACCEPT +OK bytes=65 functions=1 +PASS cast_wide IR identical; checker2 ACCEPT +OK bytes=65 functions=1 +PASS cast_left IR identical; checker2 ACCEPT +OK bytes=65 functions=1 +PASS cast_u2s IR identical; checker2 ACCEPT +OK bytes=65 functions=1 +PASS cast_s2s IR identical; checker2 ACCEPT +OK bytes=65 functions=1 +PASS cast_s2u IR identical; checker2 ACCEPT +OK bytes=65 functions=1 +PASS cast_narrow IR identical; checker2 ACCEPT +OK bytes=65 functions=1 +PASS cast_narrow_s IR identical; checker2 ACCEPT +OK bytes=65 functions=1 +PASS cast_same_ty IR identical; checker2 ACCEPT +OK bytes=51 functions=1 +PASS cast_un IR identical; checker2 ACCEPT +OK bytes=102 functions=2 +PASS cast_call IR identical; checker2 ACCEPT +OK bytes=65 functions=1 +PASS cast_assign IR identical; checker2 ACCEPT +OK bytes=71 functions=1 +PASS cast_nested IR identical; checker2 ACCEPT +OK bytes=123 functions=2 +PASS cast_arg IR identical; checker2 ACCEPT +OK bytes=61 functions=1 +PASS cast_lit_var IR identical; checker2 ACCEPT +OK bytes=50 functions=1 +PASS cast_nest_var IR identical; checker2 ACCEPT +OK bytes=44 functions=1 +PASS cast_same_assign IR identical; checker2 ACCEPT +OK bytes=44 functions=1 +PASS cast_same_param IR identical; checker2 ACCEPT +OK bytes=65 functions=1 +PASS cast_neg_lit IR identical; checker2 ACCEPT +OK bytes=49 functions=1 +PASS cast_ulong_max IR identical; checker2 ACCEPT +OK bytes=115 functions=1 +PASS cast_cond IR identical; checker2 ACCEPT +OK bytes=49 functions=1 +PASS cast_same_konst IR identical; checker2 ACCEPT +OK bytes=49 functions=1 +PASS cast_same_bool IR identical; checker2 ACCEPT +OK bytes=107 functions=2 +PASS cast_same_arg IR identical; checker2 ACCEPT +OK bytes=48 functions=1 +PASS bool_and IR identical; checker2 ACCEPT +OK bytes=48 functions=1 +PASS bool_or IR identical; checker2 ACCEPT +OK bytes=48 functions=1 +PASS bool_xor IR identical; checker2 ACCEPT +OK bytes=100 functions=2 +PASS void_fall IR identical; checker2 ACCEPT +OK bytes=227 functions=1 +PASS for_reuse IR identical; checker2 ACCEPT +OK bytes=223 functions=1 +PASS for_value IR identical; checker2 ACCEPT +OK bytes=303 functions=1 +PASS for_value_expr IR identical; checker2 ACCEPT +OK bytes=115 functions=1 +PASS scope_reuse IR identical; checker2 ACCEPT +OK bytes=180 functions=3 +PASS call_long_prefix IR identical; checker2 ACCEPT +OK bytes=55 functions=1 +PASS ensures_assign IR identical; checker2 ACCEPT +OK bytes=72 functions=1 +PASS requires_assign IR identical; checker2 ACCEPT +PASS 30 random two-function call units identical; checker2 ACCEPT +SCALAR_IR_CHECKPOINT 10/10 + 31 refusals + 9 multi-call units + 3 break units + 2 for-value units + 1 shift unit + 4 bool units + 24 cast units + 2 contract-name units + 30 fuzz units + 1 guarded for-bound unit + 2 bound-range pairs (1000000 accepted, 1000001 error 8) + 1 count-range set (1000000 identical to the oracle; 1000001, -1, -0, const 1000001 error 8); validation: 38 refusals + 1 same-IR pair + 4 scope/fallthrough/long-name units; structs IR spec-blocked +RC=0 +PASS om4 refuses break and trap +PASS w1 exit 6 +PASS f1 exit 3 +PASS n1 exit 33 +PASS n2 exit 4 +PASS n3 exit 3 +PASS c1 exit 18 +PASS c2 exit 12 +PASS c3 exit 36 +PASS c4 exit 0 +PASS c5 exit 104 +PASS t1 exit 105 +PASS t2 exit 107 +PASS bad_outside error 9 +PASS bad_after error 17 +PASS bad_continue error 9 +PASS bad_after_continue error 17 +PASS bad_trap0 error 8 +PASS bad_trap15 error 8 +PASS gate7 18 cases +PASS om4 refuses float syntax +PASS f64_bits exit 0 +PASS f32_bits exit 0 +PASS arith exit 0 +PASS compare exit 0 +PASS convert exit 0 +PASS arrays exit 0 +PASS globals exit 0 +PASS params exit 0 +PASS structs exit 0 +PASS intrinsics exit 0 +PASS f32_return exit 0 +PASS fma exit 0 +PASS neg_fma_int error 7 +PASS neg_fma_int2 error 7 +PASS neg_fma_int3 error 7 +PASS neg_fma_mix2 error 7 +PASS neg_fma_mix3 error 7 +PASS neg_fma_ambig error 11 +PASS neg_fma_ambig2 error 11 +PASS neg_fma_ambig3 error 11 +PASS neg_fma_x86 error 9 +PASS neg_fma_x86efi error 9 +PASS neg_fma_ir error 3 +PASS convert_sat exit 0 +PASS vreg exit 0 +PASS vcmp exit 0 +PASS bitcast_int exit 0 +PASS neg_intr_int error 7 +PASS neg_intr_mixed error 7 +PASS neg_intr_ambig error 11 +PASS neg_mixed error 7 +PASS neg_index error 7 +PASS neg_for error 7 +PASS neg_read error 7 +PASS neg_ambiguous error 11 +PASS neg_dot error 6 +PASS neg_overflow error 8 +PASS neg_overflow2 error 8 +PASS neg_overflow3 error 8 +PASS neg_ir error 3 +PASS neg_void_value error 7 +PASS neg_f32_fall error 18 +PASS neg_bitcast_width error 7 +PASS neg_int_assign error 7 +PASS neg_int_ret error 7 +PASS neg_int_arg error 7 +PASS neg_int_put error 7 +PASS lit_round 512 literals +PASS gate8 48 cases +PASS fused control exit 0 +PASS mutator absent-site refusal 93 +PASS mutant 0 detected: fused fixture exit 1 +PASS mutant 1 detected: fused fixture exit 1 +PASS mutant 2 detected: literal bits differ +PASS mutant 3 detected: literal bits differ +PASS gate-fma fused control, fail-closed mutator and 4 wrong-word/rounding mutants +PASS basic exit 0 +PASS float exit 4 +PASS neg_ambiguous error 11 +PASS neg_unclosed error 16 +PASS gate9 4 cases +PASS sizes exit 0 +PASS neg_type error 16 +PASS neg_field error 3 +PASS neg_struct error 3 +PASS neg_void error 9 +PASS gate10 5 cases +PASS names exit 10 (bits/min/max/abs/sqrt usable as names) +PASS neg_reserved error 16 (bitcast is a keyword) +PASS gate11 2 cases +PASS g8192 accepted +PASS g8193 error 14 +PASS f4095 accepted +PASS f4096 error 14 +PASS b512 accepted +PASS b513 error 14 +PASS local error 23 +PASS arr error 23 +PASS pools error 23 +PASS big error 14 +PASS gate12 10 cases +PASS 300 token-stream programs: 0..23, deterministic, no crash or timeout +PASS 300 structured programs: compiled, byte-identical twice +PASS gate13 600 programs +PASS gate14 35 numeric cases (19 values, 16 traps; Wolfram-derived expectations) +PASS codereg registry=39 sites=642 omegese=39 cases=33 +PASS negative control registry-meaning: FAIL codereg OMEGESE row differs from the registry omc 7 +PASS negative control omegese-row: FAIL codereg OMEGESE row differs from the registry omc 7 +PASS negative control dropped-case: FAIL codereg registry case did not refuse with its code in the gate omc 30 +PASS gate15 33 refusal cases (codes 1..25, 27..30; 24 with its accept side) plus a valid control, registry drift check and 3 negative controls +PASS gate16 30 constant programs, 35 refusals and 11 function-mode units +PASS pinned reference compiler e5d60db8... +PASS gate17 300 programs byte-identical to the pinned compiler +PASS gate18 170 literal packs, both computed entries and the two-target EFI entry match the committed chain +omc sha256 c54c9a149a23fc86fb96e08b433e09b555f690a0266c43a4b0e6095449035496 +source sha256 3e72bc7d233d1eef8702da3f6d61007523ad3cbf2704e34f1b89747c8c84d9a2 +binary sha256 8bd191c924315002ab82e7401ac25798574f851b346732f4881df658f9a79bd3 +PASS depth0 exit 0: value 7 depth 0 fuel 1 +PASS depth1 exit 0: value 7 depth 1 fuel 2 +PASS depth15 exit 0: value 7 depth 15 fuel 16 +PASS depth16 exit 0: value 7 depth 16 fuel 17 +PASS depth17 exit 40: refused depth +PASS depth100 exit 40: refused depth +PASS depth2000 exit 40: refused depth +PASS depth16sum exit 0: value 7 depth 16 fuel 19 +PASS depth17open exit 40: refused depth +PASS depth16open exit 41: refused syntax +PASS fuel64 exit 0: value 64 depth 0 fuel 64 +PASS fuel65 exit 42: refused fuel +PASS order1 exit 0: value 14 depth 0 fuel 3 +PASS order2 exit 0: value 20 depth 1 fuel 4 +PASS order3 exit 0: value 26 depth 0 fuel 4 +PASS tree exit 0: value 170 depth 3 fuel 16 +PASS wrapadd exit 0: value 0 depth 0 fuel 2 +PASS wrapmul exit 0: value 0 depth 0 fuel 2 +PASS wrapmul2 exit 0: value 34359738383 depth 1 fuel 6 +PASS wrapdig exit 0: value 7766279631452241919 depth 0 fuel 1 +PASS nobase exit 41: refused syntax +PASS noclose exit 41: refused syntax +PASS empty exit 41: refused syntax +PASS trailing exit 41: refused syntax +PASS badop exit 41: refused syntax +PASS mutant depth-limit-17 detected: depth17 exit 0 want 40 +PASS mutant depth-off-by-one detected: depth16 exit 40 want 0 +PASS mutant depth-no-count detected: depth1 exit 0 want 0 +PASS mutant fuel-limit-65 detected: fuel65 exit 0 want 42 +PASS mutant fuel-no-decrement detected: depth0 exit 0 want 0 +PASS mutant eval-mul-to-add detected: depth16sum exit 0 want 0 +PASS mutant digit-order detected: depth0 exit 0 want 0 +PASS mutant return-frame detected: depth1 exit 0 want 0 +RECURSION PASS cases=25 mutants=8/8 +OM2GATE START cases=seed/omc/contracts/contracts.cases scratch=build/seed/contracts/run.mbzGSU/cases +IDENTITY omc seed/out/omc sha256=c54c9a149a23fc86fb96e08b433e09b555f690a0266c43a4b0e6095449035496 pinned=c54c9a149a23fc86fb96e08b433e09b555f690a0266c43a4b0e6095449035496 match +CASE ok line=2 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/2.src > build/seed/contracts/run.mbzGSU/cases/2.elf 2> build/seed/contracts/run.mbzGSU/cases/2.cerr + $ build/seed/contracts/run.mbzGSU/cases/2.elf < /dev/null > build/seed/contracts/run.mbzGSU/cases/2.out 2> build/seed/contracts/run.mbzGSU/cases/2.err +VERDICT ok PASS run exit=0 expected=0 stdout=match stderr=match +CASE requires line=3 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/3.src > build/seed/contracts/run.mbzGSU/cases/3.elf 2> build/seed/contracts/run.mbzGSU/cases/3.cerr + $ build/seed/contracts/run.mbzGSU/cases/3.elf < /dev/null > build/seed/contracts/run.mbzGSU/cases/3.out 2> build/seed/contracts/run.mbzGSU/cases/3.err +VERDICT requires PASS run exit=109 expected=109 stdout=match stderr=match +CASE ensures line=4 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/4.src > build/seed/contracts/run.mbzGSU/cases/4.elf 2> build/seed/contracts/run.mbzGSU/cases/4.cerr + $ build/seed/contracts/run.mbzGSU/cases/4.elf < /dev/null > build/seed/contracts/run.mbzGSU/cases/4.out 2> build/seed/contracts/run.mbzGSU/cases/4.err +VERDICT ensures PASS run exit=110 expected=110 stdout=match stderr=match +CASE zero line=5 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/5.src > build/seed/contracts/run.mbzGSU/cases/5.elf 2> build/seed/contracts/run.mbzGSU/cases/5.cerr + $ build/seed/contracts/run.mbzGSU/cases/5.elf < /dev/null > build/seed/contracts/run.mbzGSU/cases/5.out 2> build/seed/contracts/run.mbzGSU/cases/5.err +VERDICT zero PASS run exit=110 expected=110 stdout=match stderr=match +CASE continue line=6 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/6.src > build/seed/contracts/run.mbzGSU/cases/6.elf 2> build/seed/contracts/run.mbzGSU/cases/6.cerr + $ build/seed/contracts/run.mbzGSU/cases/6.elf < /dev/null > build/seed/contracts/run.mbzGSU/cases/6.out 2> build/seed/contracts/run.mbzGSU/cases/6.err +VERDICT continue PASS run exit=110 expected=110 stdout=match stderr=match +CASE forfinal line=7 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/7.src > build/seed/contracts/run.mbzGSU/cases/7.elf 2> build/seed/contracts/run.mbzGSU/cases/7.cerr + $ build/seed/contracts/run.mbzGSU/cases/7.elf < /dev/null > build/seed/contracts/run.mbzGSU/cases/7.out 2> build/seed/contracts/run.mbzGSU/cases/7.err +VERDICT forfinal PASS run exit=110 expected=110 stdout=match stderr=match +CASE unroll line=8 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/8.src > build/seed/contracts/run.mbzGSU/cases/8.elf 2> build/seed/contracts/run.mbzGSU/cases/8.cerr + $ build/seed/contracts/run.mbzGSU/cases/8.elf < /dev/null > build/seed/contracts/run.mbzGSU/cases/8.out 2> build/seed/contracts/run.mbzGSU/cases/8.err +VERDICT unroll PASS run exit=110 expected=110 stdout=match stderr=match +CASE break line=9 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/9.src > build/seed/contracts/run.mbzGSU/cases/9.elf 2> build/seed/contracts/run.mbzGSU/cases/9.cerr + $ build/seed/contracts/run.mbzGSU/cases/9.elf < /dev/null > build/seed/contracts/run.mbzGSU/cases/9.out 2> build/seed/contracts/run.mbzGSU/cases/9.err +VERDICT break PASS run exit=0 expected=0 stdout=match stderr=match +CASE inline line=10 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/10.src > build/seed/contracts/run.mbzGSU/cases/10.elf 2> build/seed/contracts/run.mbzGSU/cases/10.cerr + $ build/seed/contracts/run.mbzGSU/cases/10.elf < /dev/null > build/seed/contracts/run.mbzGSU/cases/10.out 2> build/seed/contracts/run.mbzGSU/cases/10.err +VERDICT inline PASS run exit=0 expected=0 stdout=match stderr=match +CASE void line=11 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/11.src > build/seed/contracts/run.mbzGSU/cases/11.elf 2> build/seed/contracts/run.mbzGSU/cases/11.cerr + $ build/seed/contracts/run.mbzGSU/cases/11.elf < /dev/null > build/seed/contracts/run.mbzGSU/cases/11.out 2> build/seed/contracts/run.mbzGSU/cases/11.err +VERDICT void PASS run exit=110 expected=110 stdout=match stderr=match +CASE fallthrough line=12 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/12.src > build/seed/contracts/run.mbzGSU/cases/12.elf 2> build/seed/contracts/run.mbzGSU/cases/12.cerr + $ build/seed/contracts/run.mbzGSU/cases/12.elf < /dev/null > build/seed/contracts/run.mbzGSU/cases/12.out 2> build/seed/contracts/run.mbzGSU/cases/12.err +VERDICT fallthrough PASS run exit=110 expected=110 stdout=match stderr=match +CASE inlinevoid line=13 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/13.src > build/seed/contracts/run.mbzGSU/cases/13.elf 2> build/seed/contracts/run.mbzGSU/cases/13.cerr + $ build/seed/contracts/run.mbzGSU/cases/13.elf < /dev/null > build/seed/contracts/run.mbzGSU/cases/13.out 2> build/seed/contracts/run.mbzGSU/cases/13.err +VERDICT inlinevoid PASS run exit=110 expected=110 stdout=match stderr=match +CASE returnonce line=14 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/14.src > build/seed/contracts/run.mbzGSU/cases/14.elf 2> build/seed/contracts/run.mbzGSU/cases/14.cerr + $ build/seed/contracts/run.mbzGSU/cases/14.elf < /dev/null > build/seed/contracts/run.mbzGSU/cases/14.out 2> build/seed/contracts/run.mbzGSU/cases/14.err +VERDICT returnonce PASS run exit=0 expected=0 stdout=match stderr=match +CASE fresh line=15 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/15.src > build/seed/contracts/run.mbzGSU/cases/15.elf 2> build/seed/contracts/run.mbzGSU/cases/15.cerr + $ build/seed/contracts/run.mbzGSU/cases/15.elf < /dev/null > build/seed/contracts/run.mbzGSU/cases/15.out 2> build/seed/contracts/run.mbzGSU/cases/15.err +VERDICT fresh PASS run exit=0 expected=0 stdout=match stderr=match +CASE release line=16 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/16.src > build/seed/contracts/run.mbzGSU/cases/16.elf 2> build/seed/contracts/run.mbzGSU/cases/16.cerr + $ build/seed/contracts/run.mbzGSU/cases/16.elf < /dev/null > build/seed/contracts/run.mbzGSU/cases/16.out 2> build/seed/contracts/run.mbzGSU/cases/16.err +VERDICT release PASS run exit=0 expected=0 stdout=match stderr=match +CASE erased line=17 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/17.src > build/seed/contracts/run.mbzGSU/cases/17.elf 2> build/seed/contracts/run.mbzGSU/cases/17.cerr + $ build/seed/contracts/run.mbzGSU/cases/17.elf < /dev/null > build/seed/contracts/run.mbzGSU/cases/17.out 2> build/seed/contracts/run.mbzGSU/cases/17.err +VERDICT erased PASS run exit=0 expected=0 stdout=match stderr=match +CASE proved line=18 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/18.src > build/seed/contracts/run.mbzGSU/cases/18.elf 2> build/seed/contracts/run.mbzGSU/cases/18.cerr + $ build/seed/contracts/run.mbzGSU/cases/18.elf < /dev/null > build/seed/contracts/run.mbzGSU/cases/18.out 2> build/seed/contracts/run.mbzGSU/cases/18.err +VERDICT proved PASS run exit=0 expected=0 stdout=match stderr=match +CASE plain line=19 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/19.src > build/seed/contracts/run.mbzGSU/cases/19.elf 2> build/seed/contracts/run.mbzGSU/cases/19.cerr + $ build/seed/contracts/run.mbzGSU/cases/19.elf < /dev/null > build/seed/contracts/run.mbzGSU/cases/19.out 2> build/seed/contracts/run.mbzGSU/cases/19.err +VERDICT plain PASS run exit=0 expected=0 stdout=match stderr=match +CASE paramscope line=20 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/20.src > build/seed/contracts/run.mbzGSU/cases/20.elf 2> build/seed/contracts/run.mbzGSU/cases/20.cerr + $ build/seed/contracts/run.mbzGSU/cases/20.elf < /dev/null > build/seed/contracts/run.mbzGSU/cases/20.out 2> build/seed/contracts/run.mbzGSU/cases/20.err +VERDICT paramscope PASS run exit=0 expected=0 stdout=match stderr=match +CASE forcontinue line=21 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/21.src > build/seed/contracts/run.mbzGSU/cases/21.elf 2> build/seed/contracts/run.mbzGSU/cases/21.cerr + $ build/seed/contracts/run.mbzGSU/cases/21.elf < /dev/null > build/seed/contracts/run.mbzGSU/cases/21.out 2> build/seed/contracts/run.mbzGSU/cases/21.err +VERDICT forcontinue PASS run exit=110 expected=110 stdout=match stderr=match +CASE nestedinline line=22 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/22.src > build/seed/contracts/run.mbzGSU/cases/22.elf 2> build/seed/contracts/run.mbzGSU/cases/22.cerr + $ build/seed/contracts/run.mbzGSU/cases/22.elf < /dev/null > build/seed/contracts/run.mbzGSU/cases/22.out 2> build/seed/contracts/run.mbzGSU/cases/22.err +VERDICT nestedinline PASS run exit=0 expected=0 stdout=match stderr=match +CASE branchret line=23 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/23.src > build/seed/contracts/run.mbzGSU/cases/23.elf 2> build/seed/contracts/run.mbzGSU/cases/23.cerr + $ build/seed/contracts/run.mbzGSU/cases/23.elf < /dev/null > build/seed/contracts/run.mbzGSU/cases/23.out 2> build/seed/contracts/run.mbzGSU/cases/23.err +VERDICT branchret PASS run exit=110 expected=110 stdout=match stderr=match +CASE arithmetictrap line=24 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/24.src > build/seed/contracts/run.mbzGSU/cases/24.elf 2> build/seed/contracts/run.mbzGSU/cases/24.cerr + $ build/seed/contracts/run.mbzGSU/cases/24.elf < /dev/null > build/seed/contracts/run.mbzGSU/cases/24.out 2> build/seed/contracts/run.mbzGSU/cases/24.err +VERDICT arithmetictrap PASS run exit=102 expected=102 stdout=match stderr=match +CASE diag line=25 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/25.src > build/seed/contracts/run.mbzGSU/cases/25.elf 2> build/seed/contracts/run.mbzGSU/cases/25.cerr + $ build/seed/contracts/run.mbzGSU/cases/25.elf < /dev/null > build/seed/contracts/run.mbzGSU/cases/25.out 2> build/seed/contracts/run.mbzGSU/cases/25.err +VERDICT diag PASS run exit=109 expected=109 stdout=match stderr=match +CASE diagunroll line=26 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/26.src > build/seed/contracts/run.mbzGSU/cases/26.elf 2> build/seed/contracts/run.mbzGSU/cases/26.cerr + $ build/seed/contracts/run.mbzGSU/cases/26.elf < /dev/null > build/seed/contracts/run.mbzGSU/cases/26.out 2> build/seed/contracts/run.mbzGSU/cases/26.err +VERDICT diagunroll PASS run exit=110 expected=110 stdout=match stderr=match +CASE call line=27 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/27.src > build/seed/contracts/run.mbzGSU/cases/27.elf 2> build/seed/contracts/run.mbzGSU/cases/27.cerr +VERDICT call PASS compile exit=30 expected=30 refused with the expected error +CASE host line=28 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/28.src > build/seed/contracts/run.mbzGSU/cases/28.elf 2> build/seed/contracts/run.mbzGSU/cases/28.cerr +VERDICT host PASS compile exit=30 expected=30 refused with the expected error +CASE misplaced line=29 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/29.src > build/seed/contracts/run.mbzGSU/cases/29.elf 2> build/seed/contracts/run.mbzGSU/cases/29.cerr +VERDICT misplaced PASS compile exit=30 expected=30 refused with the expected error +CASE wrongtype line=30 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/30.src > build/seed/contracts/run.mbzGSU/cases/30.elf 2> build/seed/contracts/run.mbzGSU/cases/30.cerr +VERDICT wrongtype PASS compile exit=7 expected=7 refused with the expected error +CASE bodyname line=31 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/31.src > build/seed/contracts/run.mbzGSU/cases/31.elf 2> build/seed/contracts/run.mbzGSU/cases/31.cerr +VERDICT bodyname PASS compile exit=3 expected=3 refused with the expected error +CASE resultpre line=32 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/32.src > build/seed/contracts/run.mbzGSU/cases/32.elf 2> build/seed/contracts/run.mbzGSU/cases/32.cerr +VERDICT resultpre PASS compile exit=30 expected=30 refused with the expected error +CASE voidresult line=33 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/33.src > build/seed/contracts/run.mbzGSU/cases/33.elf 2> build/seed/contracts/run.mbzGSU/cases/33.cerr +VERDICT voidresult PASS compile exit=30 expected=30 refused with the expected error +CASE float line=34 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/34.src > build/seed/contracts/run.mbzGSU/cases/34.elf 2> build/seed/contracts/run.mbzGSU/cases/34.cerr +VERDICT float PASS compile exit=30 expected=30 refused with the expected error +CASE freshbad line=35 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/35.src > build/seed/contracts/run.mbzGSU/cases/35.elf 2> build/seed/contracts/run.mbzGSU/cases/35.cerr +VERDICT freshbad PASS compile exit=27 expected=27 refused with the expected error +CASE constfloat line=36 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/36.src > build/seed/contracts/run.mbzGSU/cases/36.elf 2> build/seed/contracts/run.mbzGSU/cases/36.cerr +VERDICT constfloat PASS compile exit=30 expected=30 refused with the expected error +CASE arrayfloat line=37 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/37.src > build/seed/contracts/run.mbzGSU/cases/37.elf 2> build/seed/contracts/run.mbzGSU/cases/37.cerr +VERDICT arrayfloat PASS compile exit=30 expected=30 refused with the expected error +CASE lateinvariant line=38 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/38.src > build/seed/contracts/run.mbzGSU/cases/38.elf 2> build/seed/contracts/run.mbzGSU/cases/38.cerr +VERDICT lateinvariant PASS compile exit=30 expected=30 refused with the expected error +CASE release-bytes line=39 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/39.src.b > build/seed/contracts/run.mbzGSU/cases/39.elf.b 2> build/seed/contracts/run.mbzGSU/cases/39.cerr.b + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/39.src > build/seed/contracts/run.mbzGSU/cases/39.elf 2> build/seed/contracts/run.mbzGSU/cases/39.cerr +VERDICT release-bytes PASS compile exit=0 expected=0 second compile exit=0 outputs identical +CASE proved-bytes line=40 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/40.src.b > build/seed/contracts/run.mbzGSU/cases/40.elf.b 2> build/seed/contracts/run.mbzGSU/cases/40.cerr.b + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/40.src > build/seed/contracts/run.mbzGSU/cases/40.elf 2> build/seed/contracts/run.mbzGSU/cases/40.cerr +VERDICT proved-bytes PASS compile exit=0 expected=0 second compile exit=0 outputs identical +CASE diag-line line=41 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/41.src > build/seed/contracts/run.mbzGSU/cases/41.elf 2> build/seed/contracts/run.mbzGSU/cases/41.cerr +VERDICT diag-line PASS compile exit=0 expected=0 stdout=unchecked stderr=match +CASE diag-final-head line=42 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/42.src > build/seed/contracts/run.mbzGSU/cases/42.elf 2> build/seed/contracts/run.mbzGSU/cases/42.cerr +VERDICT diag-final-head PASS compile exit=0 expected=0 stdout=unchecked stderr=match +CASE diag-proof line=43 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/43.src > build/seed/contracts/run.mbzGSU/cases/43.elf 2> build/seed/contracts/run.mbzGSU/cases/43.cerr +VERDICT diag-proof PASS compile exit=0 expected=0 stdout=unchecked stderr=match +CASE diag-release line=44 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/44.src > build/seed/contracts/run.mbzGSU/cases/44.elf 2> build/seed/contracts/run.mbzGSU/cases/44.cerr +VERDICT diag-release PASS compile exit=0 expected=0 stdout=unchecked stderr=match +CASE false-check line=45 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/45.src > build/seed/contracts/run.mbzGSU/cases/45.elf 2> build/seed/contracts/run.mbzGSU/cases/45.cerr + $ build/seed/contracts/run.mbzGSU/cases/45.elf < /dev/null > build/seed/contracts/run.mbzGSU/cases/45.out 2> build/seed/contracts/run.mbzGSU/cases/45.err +VERDICT false-check PASS run exit=109 expected=109 stdout=match stderr=match +CASE forvalfinal line=46 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/46.src > build/seed/contracts/run.mbzGSU/cases/46.elf 2> build/seed/contracts/run.mbzGSU/cases/46.cerr + $ build/seed/contracts/run.mbzGSU/cases/46.elf < /dev/null > build/seed/contracts/run.mbzGSU/cases/46.out 2> build/seed/contracts/run.mbzGSU/cases/46.err +VERDICT forvalfinal PASS run exit=110 expected=110 stdout=match stderr=match +CASE forvalcontinue line=47 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/cases/47.src > build/seed/contracts/run.mbzGSU/cases/47.elf 2> build/seed/contracts/run.mbzGSU/cases/47.cerr + $ build/seed/contracts/run.mbzGSU/cases/47.elf < /dev/null > build/seed/contracts/run.mbzGSU/cases/47.out 2> build/seed/contracts/run.mbzGSU/cases/47.err +VERDICT forvalcontinue PASS run exit=110 expected=110 stdout=match stderr=match +OM2GATE PASS cases=46 pass=46 fail=0 invalid=0 not_run=0 +PASS dit/scrub (21 cases) and 9 omc.om mutants detected +PASS contract-enforcement mutant detected by exact runtime-status mismatch +PASS devcall parameter cap: off-by-one and removed-check mutants killed +OM2GATE START cases=seed/qualification/security673/packets.cases scratch=build/seed/contracts/run.mbzGSU/packets +IDENTITY omc seed/out/omc sha256=c54c9a149a23fc86fb96e08b433e09b555f690a0266c43a4b0e6095449035496 pinned=c54c9a149a23fc86fb96e08b433e09b555f690a0266c43a4b0e6095449035496 match +CASE gen00-valid-one line=7 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/7.src > build/seed/contracts/run.mbzGSU/packets/7.elf 2> build/seed/contracts/run.mbzGSU/packets/7.cerr + $ build/seed/contracts/run.mbzGSU/packets/7.elf < build/seed/contracts/run.mbzGSU/packets/7.in > build/seed/contracts/run.mbzGSU/packets/7.out 2> build/seed/contracts/run.mbzGSU/packets/7.err +VERDICT gen00-valid-one PASS run exit=0 expected=0 stdout=match stderr=match +CASE gen01-count-zero line=8 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/8.src > build/seed/contracts/run.mbzGSU/packets/8.elf 2> build/seed/contracts/run.mbzGSU/packets/8.cerr + $ build/seed/contracts/run.mbzGSU/packets/8.elf < build/seed/contracts/run.mbzGSU/packets/8.in > build/seed/contracts/run.mbzGSU/packets/8.out 2> build/seed/contracts/run.mbzGSU/packets/8.err +VERDICT gen01-count-zero PASS run exit=0 expected=0 stdout=match stderr=match +CASE gen02-count-65-bare line=9 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/9.src > build/seed/contracts/run.mbzGSU/packets/9.elf 2> build/seed/contracts/run.mbzGSU/packets/9.cerr + $ build/seed/contracts/run.mbzGSU/packets/9.elf < build/seed/contracts/run.mbzGSU/packets/9.in > build/seed/contracts/run.mbzGSU/packets/9.out 2> build/seed/contracts/run.mbzGSU/packets/9.err +VERDICT gen02-count-65-bare PASS run exit=0 expected=0 stdout=match stderr=match +CASE gen03-record-truncated line=10 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/10.src > build/seed/contracts/run.mbzGSU/packets/10.elf 2> build/seed/contracts/run.mbzGSU/packets/10.cerr + $ build/seed/contracts/run.mbzGSU/packets/10.elf < build/seed/contracts/run.mbzGSU/packets/10.in > build/seed/contracts/run.mbzGSU/packets/10.out 2> build/seed/contracts/run.mbzGSU/packets/10.err +VERDICT gen03-record-truncated PASS run exit=0 expected=0 stdout=match stderr=match +CASE gen04-trailing-byte line=11 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/11.src > build/seed/contracts/run.mbzGSU/packets/11.elf 2> build/seed/contracts/run.mbzGSU/packets/11.cerr + $ build/seed/contracts/run.mbzGSU/packets/11.elf < build/seed/contracts/run.mbzGSU/packets/11.in > build/seed/contracts/run.mbzGSU/packets/11.out 2> build/seed/contracts/run.mbzGSU/packets/11.err +VERDICT gen04-trailing-byte PASS run exit=0 expected=0 stdout=match stderr=match +CASE gen05-first-empty line=12 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/12.src > build/seed/contracts/run.mbzGSU/packets/12.elf 2> build/seed/contracts/run.mbzGSU/packets/12.cerr + $ build/seed/contracts/run.mbzGSU/packets/12.elf < build/seed/contracts/run.mbzGSU/packets/12.in > build/seed/contracts/run.mbzGSU/packets/12.out 2> build/seed/contracts/run.mbzGSU/packets/12.err +VERDICT gen05-first-empty PASS run exit=0 expected=0 stdout=match stderr=match +CASE gen06-embedded-zero line=13 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/13.src > build/seed/contracts/run.mbzGSU/packets/13.elf 2> build/seed/contracts/run.mbzGSU/packets/13.cerr + $ build/seed/contracts/run.mbzGSU/packets/13.elf < build/seed/contracts/run.mbzGSU/packets/13.in > build/seed/contracts/run.mbzGSU/packets/13.out 2> build/seed/contracts/run.mbzGSU/packets/13.err +VERDICT gen06-embedded-zero PASS run exit=0 expected=0 stdout=match stderr=match +CASE gen07-record-overdeclared line=14 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/14.src > build/seed/contracts/run.mbzGSU/packets/14.elf 2> build/seed/contracts/run.mbzGSU/packets/14.cerr + $ build/seed/contracts/run.mbzGSU/packets/14.elf < build/seed/contracts/run.mbzGSU/packets/14.in > build/seed/contracts/run.mbzGSU/packets/14.out 2> build/seed/contracts/run.mbzGSU/packets/14.err +VERDICT gen07-record-overdeclared PASS run exit=0 expected=0 stdout=match stderr=match +CASE gen08-valid-64 line=15 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/15.src > build/seed/contracts/run.mbzGSU/packets/15.elf 2> build/seed/contracts/run.mbzGSU/packets/15.cerr + $ build/seed/contracts/run.mbzGSU/packets/15.elf < build/seed/contracts/run.mbzGSU/packets/15.in > build/seed/contracts/run.mbzGSU/packets/15.out 2> build/seed/contracts/run.mbzGSU/packets/15.err +VERDICT gen08-valid-64 PASS run exit=0 expected=0 stdout=match stderr=match +CASE gen09-count-65-records line=16 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/16.src > build/seed/contracts/run.mbzGSU/packets/16.elf 2> build/seed/contracts/run.mbzGSU/packets/16.cerr + $ build/seed/contracts/run.mbzGSU/packets/16.elf < build/seed/contracts/run.mbzGSU/packets/16.in > build/seed/contracts/run.mbzGSU/packets/16.out 2> build/seed/contracts/run.mbzGSU/packets/16.err +VERDICT gen09-count-65-records PASS run exit=0 expected=0 stdout=match stderr=match +CASE gen10-size-4097 line=17 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/17.src > build/seed/contracts/run.mbzGSU/packets/17.elf 2> build/seed/contracts/run.mbzGSU/packets/17.cerr + $ build/seed/contracts/run.mbzGSU/packets/17.elf < build/seed/contracts/run.mbzGSU/packets/17.in > build/seed/contracts/run.mbzGSU/packets/17.out 2> build/seed/contracts/run.mbzGSU/packets/17.err +VERDICT gen10-size-4097 PASS run exit=0 expected=0 stdout=match stderr=match +CASE gen11-size-4096 line=18 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/18.src > build/seed/contracts/run.mbzGSU/packets/18.elf 2> build/seed/contracts/run.mbzGSU/packets/18.cerr + $ build/seed/contracts/run.mbzGSU/packets/18.elf < build/seed/contracts/run.mbzGSU/packets/18.in > build/seed/contracts/run.mbzGSU/packets/18.out 2> build/seed/contracts/run.mbzGSU/packets/18.err +VERDICT gen11-size-4096 PASS run exit=0 expected=0 stdout=match stderr=match +CASE gen12-echo-argv line=19 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/19.src > build/seed/contracts/run.mbzGSU/packets/19.elf 2> build/seed/contracts/run.mbzGSU/packets/19.cerr + $ build/seed/contracts/run.mbzGSU/packets/19.elf < build/seed/contracts/run.mbzGSU/packets/19.in > build/seed/contracts/run.mbzGSU/packets/19.out 2> build/seed/contracts/run.mbzGSU/packets/19.err +VERDICT gen12-echo-argv PASS run exit=0 expected=0 stdout=match stderr=match +CASE gen13-zero-after-path line=20 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/20.src > build/seed/contracts/run.mbzGSU/packets/20.elf 2> build/seed/contracts/run.mbzGSU/packets/20.cerr + $ build/seed/contracts/run.mbzGSU/packets/20.elf < build/seed/contracts/run.mbzGSU/packets/20.in > build/seed/contracts/run.mbzGSU/packets/20.out 2> build/seed/contracts/run.mbzGSU/packets/20.err +VERDICT gen13-zero-after-path PASS run exit=0 expected=0 stdout=match stderr=match +CASE gen14-count-65535 line=21 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/21.src > build/seed/contracts/run.mbzGSU/packets/21.elf 2> build/seed/contracts/run.mbzGSU/packets/21.cerr + $ build/seed/contracts/run.mbzGSU/packets/21.elf < build/seed/contracts/run.mbzGSU/packets/21.in > build/seed/contracts/run.mbzGSU/packets/21.out 2> build/seed/contracts/run.mbzGSU/packets/21.err +VERDICT gen14-count-65535 PASS run exit=0 expected=0 stdout=match stderr=match +CASE gen15-length-65535 line=22 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/22.src > build/seed/contracts/run.mbzGSU/packets/22.elf 2> build/seed/contracts/run.mbzGSU/packets/22.cerr + $ build/seed/contracts/run.mbzGSU/packets/22.elf < build/seed/contracts/run.mbzGSU/packets/22.in > build/seed/contracts/run.mbzGSU/packets/22.out 2> build/seed/contracts/run.mbzGSU/packets/22.err +VERDICT gen15-length-65535 PASS run exit=0 expected=0 stdout=match stderr=match +CASE p00-valid-one line=23 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/23.src > build/seed/contracts/run.mbzGSU/packets/23.elf 2> build/seed/contracts/run.mbzGSU/packets/23.cerr + $ build/seed/contracts/run.mbzGSU/packets/23.elf < seed/qualification/security673/packets/p00.bin > build/seed/contracts/run.mbzGSU/packets/23.out 2> build/seed/contracts/run.mbzGSU/packets/23.err +VERDICT p00-valid-one PASS run exit=0 expected=0 stdout=match stderr=match +CASE p01-count-zero line=24 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/24.src > build/seed/contracts/run.mbzGSU/packets/24.elf 2> build/seed/contracts/run.mbzGSU/packets/24.cerr + $ build/seed/contracts/run.mbzGSU/packets/24.elf < seed/qualification/security673/packets/p01.bin > build/seed/contracts/run.mbzGSU/packets/24.out 2> build/seed/contracts/run.mbzGSU/packets/24.err +VERDICT p01-count-zero PASS run exit=103 expected=103 stdout=match stderr=match +CASE p02-count-65-bare line=25 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/25.src > build/seed/contracts/run.mbzGSU/packets/25.elf 2> build/seed/contracts/run.mbzGSU/packets/25.cerr + $ build/seed/contracts/run.mbzGSU/packets/25.elf < seed/qualification/security673/packets/p02.bin > build/seed/contracts/run.mbzGSU/packets/25.out 2> build/seed/contracts/run.mbzGSU/packets/25.err +VERDICT p02-count-65-bare PASS run exit=103 expected=103 stdout=match stderr=match +CASE p03-record-truncated line=26 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/26.src > build/seed/contracts/run.mbzGSU/packets/26.elf 2> build/seed/contracts/run.mbzGSU/packets/26.cerr + $ build/seed/contracts/run.mbzGSU/packets/26.elf < seed/qualification/security673/packets/p03.bin > build/seed/contracts/run.mbzGSU/packets/26.out 2> build/seed/contracts/run.mbzGSU/packets/26.err +VERDICT p03-record-truncated PASS run exit=103 expected=103 stdout=match stderr=match +CASE p04-trailing-byte line=27 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/27.src > build/seed/contracts/run.mbzGSU/packets/27.elf 2> build/seed/contracts/run.mbzGSU/packets/27.cerr + $ build/seed/contracts/run.mbzGSU/packets/27.elf < seed/qualification/security673/packets/p04.bin > build/seed/contracts/run.mbzGSU/packets/27.out 2> build/seed/contracts/run.mbzGSU/packets/27.err +VERDICT p04-trailing-byte PASS run exit=103 expected=103 stdout=match stderr=match +CASE p05-first-empty line=28 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/28.src > build/seed/contracts/run.mbzGSU/packets/28.elf 2> build/seed/contracts/run.mbzGSU/packets/28.cerr + $ build/seed/contracts/run.mbzGSU/packets/28.elf < seed/qualification/security673/packets/p05.bin > build/seed/contracts/run.mbzGSU/packets/28.out 2> build/seed/contracts/run.mbzGSU/packets/28.err +VERDICT p05-first-empty PASS run exit=103 expected=103 stdout=match stderr=match +CASE p06-embedded-zero line=29 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/29.src > build/seed/contracts/run.mbzGSU/packets/29.elf 2> build/seed/contracts/run.mbzGSU/packets/29.cerr + $ build/seed/contracts/run.mbzGSU/packets/29.elf < seed/qualification/security673/packets/p06.bin > build/seed/contracts/run.mbzGSU/packets/29.out 2> build/seed/contracts/run.mbzGSU/packets/29.err +VERDICT p06-embedded-zero PASS run exit=103 expected=103 stdout=match stderr=match +CASE p07-record-overdeclared line=30 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/30.src > build/seed/contracts/run.mbzGSU/packets/30.elf 2> build/seed/contracts/run.mbzGSU/packets/30.cerr + $ build/seed/contracts/run.mbzGSU/packets/30.elf < seed/qualification/security673/packets/p07.bin > build/seed/contracts/run.mbzGSU/packets/30.out 2> build/seed/contracts/run.mbzGSU/packets/30.err +VERDICT p07-record-overdeclared PASS run exit=103 expected=103 stdout=match stderr=match +CASE p08-valid-64 line=31 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/31.src > build/seed/contracts/run.mbzGSU/packets/31.elf 2> build/seed/contracts/run.mbzGSU/packets/31.cerr + $ build/seed/contracts/run.mbzGSU/packets/31.elf < seed/qualification/security673/packets/p08.bin > build/seed/contracts/run.mbzGSU/packets/31.out 2> build/seed/contracts/run.mbzGSU/packets/31.err +VERDICT p08-valid-64 PASS run exit=0 expected=0 stdout=match stderr=match +CASE p09-count-65-records line=32 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/32.src > build/seed/contracts/run.mbzGSU/packets/32.elf 2> build/seed/contracts/run.mbzGSU/packets/32.cerr + $ build/seed/contracts/run.mbzGSU/packets/32.elf < seed/qualification/security673/packets/p09.bin > build/seed/contracts/run.mbzGSU/packets/32.out 2> build/seed/contracts/run.mbzGSU/packets/32.err +VERDICT p09-count-65-records PASS run exit=103 expected=103 stdout=match stderr=match +CASE p10-size-4097 line=33 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/33.src > build/seed/contracts/run.mbzGSU/packets/33.elf 2> build/seed/contracts/run.mbzGSU/packets/33.cerr + $ build/seed/contracts/run.mbzGSU/packets/33.elf < seed/qualification/security673/packets/p10.bin > build/seed/contracts/run.mbzGSU/packets/33.out 2> build/seed/contracts/run.mbzGSU/packets/33.err +VERDICT p10-size-4097 PASS run exit=103 expected=103 stdout=match stderr=match +CASE p11-size-4096 line=34 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/34.src > build/seed/contracts/run.mbzGSU/packets/34.elf 2> build/seed/contracts/run.mbzGSU/packets/34.cerr + $ build/seed/contracts/run.mbzGSU/packets/34.elf < seed/qualification/security673/packets/p11.bin > build/seed/contracts/run.mbzGSU/packets/34.out 2> build/seed/contracts/run.mbzGSU/packets/34.err +VERDICT p11-size-4096 PASS run exit=0 expected=0 stdout=match stderr=match +CASE p12-echo-argv line=35 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/35.src > build/seed/contracts/run.mbzGSU/packets/35.elf 2> build/seed/contracts/run.mbzGSU/packets/35.cerr + $ build/seed/contracts/run.mbzGSU/packets/35.elf < seed/qualification/security673/packets/p12.bin > build/seed/contracts/run.mbzGSU/packets/35.out 2> build/seed/contracts/run.mbzGSU/packets/35.err +VERDICT p12-echo-argv PASS run exit=0 expected=0 stdout=match stderr=match +CASE p13-zero-after-path line=36 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/36.src > build/seed/contracts/run.mbzGSU/packets/36.elf 2> build/seed/contracts/run.mbzGSU/packets/36.cerr + $ build/seed/contracts/run.mbzGSU/packets/36.elf < seed/qualification/security673/packets/p13.bin > build/seed/contracts/run.mbzGSU/packets/36.out 2> build/seed/contracts/run.mbzGSU/packets/36.err +VERDICT p13-zero-after-path PASS run exit=103 expected=103 stdout=match stderr=match +CASE p14-count-65535 line=37 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/37.src > build/seed/contracts/run.mbzGSU/packets/37.elf 2> build/seed/contracts/run.mbzGSU/packets/37.cerr + $ build/seed/contracts/run.mbzGSU/packets/37.elf < seed/qualification/security673/packets/p14.bin > build/seed/contracts/run.mbzGSU/packets/37.out 2> build/seed/contracts/run.mbzGSU/packets/37.err +VERDICT p14-count-65535 PASS run exit=103 expected=103 stdout=match stderr=match +CASE p15-length-65535 line=38 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/38.src > build/seed/contracts/run.mbzGSU/packets/38.elf 2> build/seed/contracts/run.mbzGSU/packets/38.cerr + $ build/seed/contracts/run.mbzGSU/packets/38.elf < seed/qualification/security673/packets/p15.bin > build/seed/contracts/run.mbzGSU/packets/38.out 2> build/seed/contracts/run.mbzGSU/packets/38.err +VERDICT p15-length-65535 PASS run exit=103 expected=103 stdout=match stderr=match +CASE trunc00 line=39 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/39.src > build/seed/contracts/run.mbzGSU/packets/39.elf 2> build/seed/contracts/run.mbzGSU/packets/39.cerr + $ build/seed/contracts/run.mbzGSU/packets/39.elf 0 < seed/qualification/security673/packets/p12.bin > build/seed/contracts/run.mbzGSU/packets/39.out 2> build/seed/contracts/run.mbzGSU/packets/39.err +VERDICT trunc00 PASS run exit=103 expected=103 stdout=match stderr=match +CASE trunc01 line=40 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/40.src > build/seed/contracts/run.mbzGSU/packets/40.elf 2> build/seed/contracts/run.mbzGSU/packets/40.cerr + $ build/seed/contracts/run.mbzGSU/packets/40.elf 1 < seed/qualification/security673/packets/p12.bin > build/seed/contracts/run.mbzGSU/packets/40.out 2> build/seed/contracts/run.mbzGSU/packets/40.err +VERDICT trunc01 PASS run exit=103 expected=103 stdout=match stderr=match +CASE trunc02 line=41 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/41.src > build/seed/contracts/run.mbzGSU/packets/41.elf 2> build/seed/contracts/run.mbzGSU/packets/41.cerr + $ build/seed/contracts/run.mbzGSU/packets/41.elf 2 < seed/qualification/security673/packets/p12.bin > build/seed/contracts/run.mbzGSU/packets/41.out 2> build/seed/contracts/run.mbzGSU/packets/41.err +VERDICT trunc02 PASS run exit=103 expected=103 stdout=match stderr=match +CASE trunc03 line=42 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/42.src > build/seed/contracts/run.mbzGSU/packets/42.elf 2> build/seed/contracts/run.mbzGSU/packets/42.cerr + $ build/seed/contracts/run.mbzGSU/packets/42.elf 3 < seed/qualification/security673/packets/p12.bin > build/seed/contracts/run.mbzGSU/packets/42.out 2> build/seed/contracts/run.mbzGSU/packets/42.err +VERDICT trunc03 PASS run exit=103 expected=103 stdout=match stderr=match +CASE trunc04 line=43 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/43.src > build/seed/contracts/run.mbzGSU/packets/43.elf 2> build/seed/contracts/run.mbzGSU/packets/43.cerr + $ build/seed/contracts/run.mbzGSU/packets/43.elf 4 < seed/qualification/security673/packets/p12.bin > build/seed/contracts/run.mbzGSU/packets/43.out 2> build/seed/contracts/run.mbzGSU/packets/43.err +VERDICT trunc04 PASS run exit=103 expected=103 stdout=match stderr=match +CASE trunc05 line=44 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/44.src > build/seed/contracts/run.mbzGSU/packets/44.elf 2> build/seed/contracts/run.mbzGSU/packets/44.cerr + $ build/seed/contracts/run.mbzGSU/packets/44.elf 5 < seed/qualification/security673/packets/p12.bin > build/seed/contracts/run.mbzGSU/packets/44.out 2> build/seed/contracts/run.mbzGSU/packets/44.err +VERDICT trunc05 PASS run exit=103 expected=103 stdout=match stderr=match +CASE trunc06 line=45 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/45.src > build/seed/contracts/run.mbzGSU/packets/45.elf 2> build/seed/contracts/run.mbzGSU/packets/45.cerr + $ build/seed/contracts/run.mbzGSU/packets/45.elf 6 < seed/qualification/security673/packets/p12.bin > build/seed/contracts/run.mbzGSU/packets/45.out 2> build/seed/contracts/run.mbzGSU/packets/45.err +VERDICT trunc06 PASS run exit=103 expected=103 stdout=match stderr=match +CASE trunc07 line=46 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/46.src > build/seed/contracts/run.mbzGSU/packets/46.elf 2> build/seed/contracts/run.mbzGSU/packets/46.cerr + $ build/seed/contracts/run.mbzGSU/packets/46.elf 7 < seed/qualification/security673/packets/p12.bin > build/seed/contracts/run.mbzGSU/packets/46.out 2> build/seed/contracts/run.mbzGSU/packets/46.err +VERDICT trunc07 PASS run exit=103 expected=103 stdout=match stderr=match +CASE trunc08 line=47 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/47.src > build/seed/contracts/run.mbzGSU/packets/47.elf 2> build/seed/contracts/run.mbzGSU/packets/47.cerr + $ build/seed/contracts/run.mbzGSU/packets/47.elf 8 < seed/qualification/security673/packets/p12.bin > build/seed/contracts/run.mbzGSU/packets/47.out 2> build/seed/contracts/run.mbzGSU/packets/47.err +VERDICT trunc08 PASS run exit=103 expected=103 stdout=match stderr=match +CASE trunc09 line=48 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/48.src > build/seed/contracts/run.mbzGSU/packets/48.elf 2> build/seed/contracts/run.mbzGSU/packets/48.cerr + $ build/seed/contracts/run.mbzGSU/packets/48.elf 9 < seed/qualification/security673/packets/p12.bin > build/seed/contracts/run.mbzGSU/packets/48.out 2> build/seed/contracts/run.mbzGSU/packets/48.err +VERDICT trunc09 PASS run exit=103 expected=103 stdout=match stderr=match +CASE trunc10 line=49 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/49.src > build/seed/contracts/run.mbzGSU/packets/49.elf 2> build/seed/contracts/run.mbzGSU/packets/49.cerr + $ build/seed/contracts/run.mbzGSU/packets/49.elf 10 < seed/qualification/security673/packets/p12.bin > build/seed/contracts/run.mbzGSU/packets/49.out 2> build/seed/contracts/run.mbzGSU/packets/49.err +VERDICT trunc10 PASS run exit=103 expected=103 stdout=match stderr=match +CASE trunc11 line=50 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/50.src > build/seed/contracts/run.mbzGSU/packets/50.elf 2> build/seed/contracts/run.mbzGSU/packets/50.cerr + $ build/seed/contracts/run.mbzGSU/packets/50.elf 11 < seed/qualification/security673/packets/p12.bin > build/seed/contracts/run.mbzGSU/packets/50.out 2> build/seed/contracts/run.mbzGSU/packets/50.err +VERDICT trunc11 PASS run exit=103 expected=103 stdout=match stderr=match +CASE trunc12 line=51 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/51.src > build/seed/contracts/run.mbzGSU/packets/51.elf 2> build/seed/contracts/run.mbzGSU/packets/51.cerr + $ build/seed/contracts/run.mbzGSU/packets/51.elf 12 < seed/qualification/security673/packets/p12.bin > build/seed/contracts/run.mbzGSU/packets/51.out 2> build/seed/contracts/run.mbzGSU/packets/51.err +VERDICT trunc12 PASS run exit=103 expected=103 stdout=match stderr=match +CASE trunc13 line=52 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/52.src > build/seed/contracts/run.mbzGSU/packets/52.elf 2> build/seed/contracts/run.mbzGSU/packets/52.cerr + $ build/seed/contracts/run.mbzGSU/packets/52.elf 13 < seed/qualification/security673/packets/p12.bin > build/seed/contracts/run.mbzGSU/packets/52.out 2> build/seed/contracts/run.mbzGSU/packets/52.err +VERDICT trunc13 PASS run exit=103 expected=103 stdout=match stderr=match +CASE trunc14 line=53 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/53.src > build/seed/contracts/run.mbzGSU/packets/53.elf 2> build/seed/contracts/run.mbzGSU/packets/53.cerr + $ build/seed/contracts/run.mbzGSU/packets/53.elf 14 < seed/qualification/security673/packets/p12.bin > build/seed/contracts/run.mbzGSU/packets/53.out 2> build/seed/contracts/run.mbzGSU/packets/53.err +VERDICT trunc14 PASS run exit=103 expected=103 stdout=match stderr=match +CASE trunc15 line=54 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/54.src > build/seed/contracts/run.mbzGSU/packets/54.elf 2> build/seed/contracts/run.mbzGSU/packets/54.cerr + $ build/seed/contracts/run.mbzGSU/packets/54.elf 15 < seed/qualification/security673/packets/p12.bin > build/seed/contracts/run.mbzGSU/packets/54.out 2> build/seed/contracts/run.mbzGSU/packets/54.err +VERDICT trunc15 PASS run exit=103 expected=103 stdout=match stderr=match +CASE trunc16 line=55 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/55.src > build/seed/contracts/run.mbzGSU/packets/55.elf 2> build/seed/contracts/run.mbzGSU/packets/55.cerr + $ build/seed/contracts/run.mbzGSU/packets/55.elf 16 < seed/qualification/security673/packets/p12.bin > build/seed/contracts/run.mbzGSU/packets/55.out 2> build/seed/contracts/run.mbzGSU/packets/55.err +VERDICT trunc16 PASS run exit=103 expected=103 stdout=match stderr=match +CASE trunc17 line=56 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/56.src > build/seed/contracts/run.mbzGSU/packets/56.elf 2> build/seed/contracts/run.mbzGSU/packets/56.cerr + $ build/seed/contracts/run.mbzGSU/packets/56.elf 17 < seed/qualification/security673/packets/p12.bin > build/seed/contracts/run.mbzGSU/packets/56.out 2> build/seed/contracts/run.mbzGSU/packets/56.err +VERDICT trunc17 PASS run exit=103 expected=103 stdout=match stderr=match +CASE trunc18 line=57 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/57.src > build/seed/contracts/run.mbzGSU/packets/57.elf 2> build/seed/contracts/run.mbzGSU/packets/57.cerr + $ build/seed/contracts/run.mbzGSU/packets/57.elf 18 < seed/qualification/security673/packets/p12.bin > build/seed/contracts/run.mbzGSU/packets/57.out 2> build/seed/contracts/run.mbzGSU/packets/57.err +VERDICT trunc18 PASS run exit=103 expected=103 stdout=match stderr=match +CASE trunc19 line=58 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/58.src > build/seed/contracts/run.mbzGSU/packets/58.elf 2> build/seed/contracts/run.mbzGSU/packets/58.cerr + $ build/seed/contracts/run.mbzGSU/packets/58.elf 19 < seed/qualification/security673/packets/p12.bin > build/seed/contracts/run.mbzGSU/packets/58.out 2> build/seed/contracts/run.mbzGSU/packets/58.err +VERDICT trunc19 PASS run exit=103 expected=103 stdout=match stderr=match +CASE trunc20 line=59 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/59.src > build/seed/contracts/run.mbzGSU/packets/59.elf 2> build/seed/contracts/run.mbzGSU/packets/59.cerr + $ build/seed/contracts/run.mbzGSU/packets/59.elf 20 < seed/qualification/security673/packets/p12.bin > build/seed/contracts/run.mbzGSU/packets/59.out 2> build/seed/contracts/run.mbzGSU/packets/59.err +VERDICT trunc20 PASS run exit=103 expected=103 stdout=match stderr=match +CASE trunc21 line=60 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/60.src > build/seed/contracts/run.mbzGSU/packets/60.elf 2> build/seed/contracts/run.mbzGSU/packets/60.cerr + $ build/seed/contracts/run.mbzGSU/packets/60.elf 21 < seed/qualification/security673/packets/p12.bin > build/seed/contracts/run.mbzGSU/packets/60.out 2> build/seed/contracts/run.mbzGSU/packets/60.err +VERDICT trunc21 PASS run exit=103 expected=103 stdout=match stderr=match +CASE trunc22 line=61 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/61.src > build/seed/contracts/run.mbzGSU/packets/61.elf 2> build/seed/contracts/run.mbzGSU/packets/61.cerr + $ build/seed/contracts/run.mbzGSU/packets/61.elf 22 < seed/qualification/security673/packets/p12.bin > build/seed/contracts/run.mbzGSU/packets/61.out 2> build/seed/contracts/run.mbzGSU/packets/61.err +VERDICT trunc22 PASS run exit=103 expected=103 stdout=match stderr=match +CASE trunc23 line=62 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/62.src > build/seed/contracts/run.mbzGSU/packets/62.elf 2> build/seed/contracts/run.mbzGSU/packets/62.cerr + $ build/seed/contracts/run.mbzGSU/packets/62.elf 23 < seed/qualification/security673/packets/p12.bin > build/seed/contracts/run.mbzGSU/packets/62.out 2> build/seed/contracts/run.mbzGSU/packets/62.err +VERDICT trunc23 PASS run exit=103 expected=103 stdout=match stderr=match +CASE trunc24 line=63 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/63.src > build/seed/contracts/run.mbzGSU/packets/63.elf 2> build/seed/contracts/run.mbzGSU/packets/63.cerr + $ build/seed/contracts/run.mbzGSU/packets/63.elf 24 < seed/qualification/security673/packets/p12.bin > build/seed/contracts/run.mbzGSU/packets/63.out 2> build/seed/contracts/run.mbzGSU/packets/63.err +VERDICT trunc24 PASS run exit=103 expected=103 stdout=match stderr=match +CASE trunc25 line=64 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/64.src > build/seed/contracts/run.mbzGSU/packets/64.elf 2> build/seed/contracts/run.mbzGSU/packets/64.cerr + $ build/seed/contracts/run.mbzGSU/packets/64.elf 25 < seed/qualification/security673/packets/p12.bin > build/seed/contracts/run.mbzGSU/packets/64.out 2> build/seed/contracts/run.mbzGSU/packets/64.err +VERDICT trunc25 PASS run exit=103 expected=103 stdout=match stderr=match +CASE trunc26 line=65 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/65.src > build/seed/contracts/run.mbzGSU/packets/65.elf 2> build/seed/contracts/run.mbzGSU/packets/65.cerr + $ build/seed/contracts/run.mbzGSU/packets/65.elf 26 < seed/qualification/security673/packets/p12.bin > build/seed/contracts/run.mbzGSU/packets/65.out 2> build/seed/contracts/run.mbzGSU/packets/65.err +VERDICT trunc26 PASS run exit=103 expected=103 stdout=match stderr=match +CASE trunc27-whole line=66 + $ seed/out/omc < build/seed/contracts/run.mbzGSU/packets/66.src > build/seed/contracts/run.mbzGSU/packets/66.elf 2> build/seed/contracts/run.mbzGSU/packets/66.cerr + $ build/seed/contracts/run.mbzGSU/packets/66.elf 27 < seed/qualification/security673/packets/p12.bin > build/seed/contracts/run.mbzGSU/packets/66.out 2> build/seed/contracts/run.mbzGSU/packets/66.err +VERDICT trunc27-whole PASS run exit=0 expected=0 stdout=match stderr=match +OM2GATE PASS cases=60 pass=60 fail=0 invalid=0 not_run=0 +PASS packed-list ingress: hostile packets refused; size, count and exact-length mutants detected +PASS hex literals (51 cases) and 3 tok_hex mutants killed +PASS expression boundaries (47 cases) and 2 operand mutants killed +PASS function-mode host words (21 cases) and 12 omc.om mutants killed +OK bytes=401 functions=1 +PASS contract C parity: exact values, canonical bits and traps +PASS native files, errno, exclusive creation, permissions, seek, sync and monotonic time +PASS native argument access, empty arguments, UTF-8 bytes and short-buffer refusal +PASS native socket exchange, poll timeout, fork, accept and child reaping +PASS native TCP loopback exchange on an OS-assigned port +PASS native exec with exact arguments, exec failure, pipes, descriptor duplication, sleep, kill and wait +PASS native directory enumeration, file metadata and rename without overwriting +PASS native syscall errors and nested expression register preservation +PASS native cwd and readlnk offsets, counts, truncation, errno and private path copy +PASS native socket options with independent bind behavior, readonly input and errno +PASS native peercred pollfds sendmsg allowlist +PASS native network slice bounds and poll record-size refusal +PASS independent Unix peer identity and offset sentinels +PASS native peername: accepted peer, truncation, empty slices, errno and bounds +PASS native checked device ioctl composed with host files and pipes +PASS native device parameter binding +PASS bounded native UVM requests +PASS bounded native VFIO requests, DMA map spans and region maps +PASS 16 VFIO compiler refusals +PASS native mapping +PASS managed addresses and ordered mapped words +PASS owned reservations, collision refusal and failed-bind retirement +PASS 36 device/mapping compiler refusals +PASS struct values and native file operations in one program +PASS native random: exact count, non-zero, two calls differ, invalid flags refused +PASS native environment: count, entry bytes, short-buffer refusal +PASS native chdir: relative file created in the new directory; missing path refused +PASS native ftrunc: write, shorten, rewind, read 4 then EOF; closed fd refused +PASS native stat: size field, missing path errno, 128-byte structure +PASS native stat: short output traps 3 before the kernel +PASS native link/symlnk: hard link nlink 2, symlink target, unlink +PASS native link: one-record packed list traps 3 +PASS native chmod: 0600 mode in st_mode; missing path errno +PASS native chown: owner uid kept in st_uid; missing path errno +PASS native faccess: existing path accepted, missing path refused +PASS native identity: getuid/geteuid/getgid/getegid match /proc/self/status +PASS native fchdir/umask/getppid: directory fd, 0777 under mask 0, parent id +PASS native getppid: parent id equals the gate process pid (mod 256 and mod 251) +PASS native fdsync/memfd: data sync, closed fd refused, anonymous file rw +PASS native pread/pwrite: positioned I/O, bytes intact, closed fd refused +PASS native getsid/syncfs/shutdown: session id, filesystem sync, non-socket refusal +PASS native flock: exclusive lock blocks a second open (EWOULDBLOCK), unlock, shared, EINVAL, EBADF +PASS native process groups: getpgid/setpgid, setsid or EPERM +PASS native lstat: stat follows the link, lstat reports S_IFLNK +PASS native truncate: path length set to 4; missing path errno +PASS native environment: index at the count traps 3 +PASS 18 bounds, packet, mutability, type and function-mode negative controls +PASS 59 total host negative controls, including cwd, readlnk, sockopt, flock and network +PASS 62 original fixtures retain identical machine code, refusal status and diagnostics +PASS cpufence runs exit 42 on AArch64 and x86-64 (qemu); objdump deltas dsb=3 yield=1 mfence=3 pause=1 +PASS cpufence/cpurelax in a function-mode unit: one dsb sy, one yield +PASS cpufence refusals: operand, value use, name, top level, dead code +PASS negative control: nop cpufence mutant still exits 42 but objdump deltas 0 1 0 1 are caught (wanted 3 1 3 1) +irq_info 16 0 4 8 12 +irq_set 20 0 4 8 12 16 20 +requests 15213 15214 +flags 36 33 9 17 +eventfd 526336 19 +PASS GCC/Omega IRQ wire-layout differential +PASS real eventfd initial/read/write/drain/poll/close and table capacity +PASS 10 typed IRQ and eventfd compiler refusals +PASS ptrace fixture mode=0 exit=0 IRQ_ENOTTY=7 highfd=0 +PASS ptrace fixture mode=0 exit=0 IRQ_ENOTTY=7 highfd=1 +PASS ptrace fixture mode=? exit=0 IRQ_ENOTTY=0 highfd=0 +PASS ptrace fixture mode=1 exit=103 IRQ_ENOTTY=0 highfd=0 +PASS ptrace fixture mode=2 exit=103 IRQ_ENOTTY=0 highfd=0 +PASS ptrace fixture mode=3 exit=103 IRQ_ENOTTY=0 highfd=0 +PASS ptrace fixture mode=4 exit=103 IRQ_ENOTTY=0 highfd=0 +PASS ptrace fixture mode=5 exit=103 IRQ_ENOTTY=0 highfd=0 +PASS ptrace fixture mode=6 exit=103 IRQ_ENOTTY=0 highfd=0 +PASS ptrace fixture mode=7 exit=103 IRQ_ENOTTY=0 highfd=0 +PASS ptrace fixture mode=8 exit=103 IRQ_ENOTTY=0 highfd=0 +PASS ptrace fixture mode=9 exit=103 IRQ_ENOTTY=0 highfd=0 +PASS ptrace fixture mode=: exit=103 IRQ_ENOTTY=0 highfd=0 +PASS ptrace fixture mode=; exit=103 IRQ_ENOTTY=0 highfd=0 +PASS ptrace fixture mode=< exit=103 IRQ_ENOTTY=0 highfd=0 +PASS ptrace fixture mode== exit=103 IRQ_ENOTTY=0 highfd=0 +PASS ptrace fixture mode=> exit=103 IRQ_ENOTTY=0 highfd=0 +PASS ptrace fixture mode=@ exit=0 IRQ_ENOTTY=1 highfd=0 +PASS ptrace fixture mode=A exit=103 IRQ_ENOTTY=0 highfd=0 +PASS QEMU user-mode VFIO-less refusal and real translated eventfd behavior (not system/hardware qualification) +PASS killed device-kind oracle_rc=1 +PASS killed event-kind oracle_rc=1 +PASS killed argsz oracle_rc=1 +PASS killed count-bound oracle_rc=1 +PASS killed range-wrap oracle_rc=1 +PASS killed payload-size oracle_rc=1 +PASS killed action-allowlist oracle_rc=1 +PASS killed event-count-condition oracle_rc=1 +PASS killed disable-start oracle_rc=1 +PASS killed close-invalidation oracle_rc=1 +PASS killed dup-invalidation oracle_rc=1 +PASS killed payload-loop oracle_rc=1 +PASS killed cloexec oracle_rc=1 +PASS IRQ compiler mutants killed=13 +c54c9a149a23fc86fb96e08b433e09b555f690a0266c43a4b0e6095449035496 /tmp/L899-omega-seed/seed/out/omc +9af1e185880c5c957c814d51bc46871a5eb74fe99a78e7c735840df098ed2180 seed/omc/omc.om +7c47bfcfeceddace3d997d7469412ac71acd790de2d51bab0b24f9fab764ce15 /tmp/L899-omega-seed/build/seed/irq/eventfd +28558d7ea4f981e89e94d64c53be5b4a253becca5a9a4dce3787b26b21291756 /tmp/L899-omega-seed/build/seed/irq/vfioirq +d992232530014c84332b0f2c7c019b0a121123ac37ae1b67b1b00e46c3ea5d00 /tmp/L899-omega-seed/build/seed/irq/irqlayout +PASS typed VFIO IRQ/eventfd host qualification; real device IRQ delivery NOT_RUN +AIEN-IOCTL baseline +AIEN-IOCTL FAIL 165 +arch/span/phase/observed: +0 +3 +4 +0 +AIEN-IOCTL mutant killed 0 +AIEN-IOCTL FAIL 167 +arch/span/phase/observed: +0 +3 +1 +9 +AIEN-IOCTL mutant killed 1 +AIEN-IOCTL FAIL 170 +arch/span/phase/observed: +0 +4 +2 +0 +AIEN-IOCTL mutant killed 2 +AIEN-IOCTL FAIL 176 +arch/span/phase/observed: +1 +4 +2 +0 +AIEN-IOCTL mutant killed 3 +AIEN-IOCTL PASS native, x86-QEMU, function admissions, encoded/runtime refusals; four mutants killed; chip NOT_RUN +omc sha256 c54c9a149a23fc86fb96e08b433e09b555f690a0266c43a4b0e6095449035496 +library sha256 69ed4dc63071df48cb0df1833e3b385c343573fb390620e35bbb4466207ab42f +library functions 24 +PASS rfc8452-appendix-c: gcmsiv driver: 400 checks, 0 failed +PASS rfc8452-section8: gcmsiv driver: 8 checks, 0 failed +PASS params: gcmsiv driver: 14 checks, 0 failed +PASS mutant-polyval: detected at stage polyval, exit 1, 240 MISMATCH (counter=40,mask=40,open=40,polyval=40,seal=40,tag=40) (gcmsiv driver: 400 checks, 240 failed) +PASS mutant-derive: detected at stage derive, exit 1, 342 MISMATCH (counter=50,derive=50,mask=46,open=50,polyval=46,seal=50,tag=50) (gcmsiv driver: 400 checks, 342 failed) +PASS mutant-mask: detected at stage mask, exit 1, 95 MISMATCH (counter=19,mask=19,open=19,seal=19,tag=19) (gcmsiv driver: 400 checks, 95 failed) +PASS mutant-ctrbit: detected at stage counter, exit 1, 79 MISMATCH (counter=29,open=25,seal=25) (gcmsiv driver: 400 checks, 79 failed) +PASS mutant-tagcheck: detected at stage refuse, exit 1, 50 MISMATCH (refuse=50) (gcmsiv driver: 400 checks, 50 failed) +PASS mutant-expect: detected at stage tag, exit 1, 1 MISMATCH (tag=1) (gcmsiv driver: 400 checks, 1 failed) +NOT_RUN wycheproof aes_gcm_siv_test.json: not vendored +GCMSIV PASS vectors=51 (rfc8452 c1=24 c2=24 c3=2 s8=1) checks=422 mutants=6/6 +caught tags-in-detector: 2 failed +caught detector-always-reuse: 4 failed +caught nonce-not-distinct: 5 failed +caught tamper-not-applied: 2 failed +caught siv-as-other-mode: 1 failed +caught wrong-expected-xor: 3 failed +REUSE PASS checks=27 mutants=6/6 +PASS native-host qualification; seeded build, C tools are comparison oracles only diff --git a/evidence/ARM64-EFI-20261106/L899-omega-crumb.log.6738871bd9570585a26bdf813f14367f2ad651bae4493e3b71afdd0ced5a3ea8.txt b/evidence/ARM64-EFI-20261106/L899-omega-crumb.log.6738871bd9570585a26bdf813f14367f2ad651bae4493e3b71afdd0ced5a3ea8.txt new file mode 100644 index 000000000..c7576c942 --- /dev/null +++ b/evidence/ARM64-EFI-20261106/L899-omega-crumb.log.6738871bd9570585a26bdf813f14367f2ad651bae4493e3b71afdd0ced5a3ea8.txt @@ -0,0 +1,6 @@ +COMPILED seed/net +COMPILED docs +COMPILED tests +COMPILED . +crumb compile: 188 crumbs, 4 rewritten, HEAD fd3751b +crumb verify: OK: 188 crumbs current diff --git a/evidence/ARM64-EFI-20261106/L899-seed-final3.log.7acbb54e44cf4fcb49e43b5aa16b479a991de6d285d939c50dd68f472339feda.txt b/evidence/ARM64-EFI-20261106/L899-seed-final3.log.7acbb54e44cf4fcb49e43b5aa16b479a991de6d285d939c50dd68f472339feda.txt new file mode 100644 index 000000000..984696ec8 --- /dev/null +++ b/evidence/ARM64-EFI-20261106/L899-seed-final3.log.7acbb54e44cf4fcb49e43b5aa16b479a991de6d285d939c50dd68f472339feda.txt @@ -0,0 +1,12 @@ +PASS seed0 408 bytes, rebuilds itself +PASS hex1 776 bytes, born from seed0 +PASS asm2 2464 bytes, born from hex1 +PASS om4 om4.bin 14224 bytes +PASS omc fixpoint c54c9a149a23fc86fb96e08b433e09b555f690a0266c43a4b0e6095449035496 +PASS fwd exit 0 +PASS fwd runs, exit 7 +PASS mut exit 0 +PASS mut runs, exit 0 +PASS cycle exit 9 +PASS assign exit 7 +RC=0 diff --git a/evidence/ARM64-EFI-20261106/qualification.997ca6e49dc0fcafa69aa8e2ea09bb53a0724fd1eb4680021d329464601e2ac1.json b/evidence/ARM64-EFI-20261106/qualification.997ca6e49dc0fcafa69aa8e2ea09bb53a0724fd1eb4680021d329464601e2ac1.json new file mode 100644 index 000000000..456604da0 --- /dev/null +++ b/evidence/ARM64-EFI-20261106/qualification.997ca6e49dc0fcafa69aa8e2ea09bb53a0724fd1eb4680021d329464601e2ac1.json @@ -0,0 +1,191 @@ +{ + "artifacts": [ + { + "file": "L899-seed-final3.log.7acbb54e44cf4fcb49e43b5aa16b479a991de6d285d939c50dd68f472339feda.txt", + "normalization": "home directory prefix only", + "original_sha256": "7acbb54e44cf4fcb49e43b5aa16b479a991de6d285d939c50dd68f472339feda", + "sha256": "7acbb54e44cf4fcb49e43b5aa16b479a991de6d285d939c50dd68f472339feda" + }, + { + "file": "L899-host-final3.log.fcf7cb624d0dff00fc9bfef2df8ab570869fc507f903dc57dad260f0fef2d574.txt", + "normalization": "home directory prefix only", + "original_sha256": "fcf7cb624d0dff00fc9bfef2df8ab570869fc507f903dc57dad260f0fef2d574", + "sha256": "fcf7cb624d0dff00fc9bfef2df8ab570869fc507f903dc57dad260f0fef2d574" + }, + { + "file": "L899-omega-crumb.log.6738871bd9570585a26bdf813f14367f2ad651bae4493e3b71afdd0ced5a3ea8.txt", + "normalization": "home directory prefix only", + "original_sha256": "6738871bd9570585a26bdf813f14367f2ad651bae4493e3b71afdd0ced5a3ea8", + "sha256": "6738871bd9570585a26bdf813f14367f2ad651bae4493e3b71afdd0ced5a3ea8" + } + ], + "checks": { + "http_transport_and_mutants": "PASS (included in host suite)", + "native_host_suite": "PASS", + "pinned_crumb_verify": "PASS", + "seeded_fixpoint": "PASS", + "wrong_compiler_pin": "PASS: refused before output directory creation" + }, + "commands": [ + "quiet-build sh seed/omega-from-seed.sh", + "quiet-build sh seed/host/check.sh", + "python3 tests/aarch64efi/run.py --omc PINNED_OMC --sha256 PIN --out FRESH --firmware PINNED_FIRMWARE --runner ARM64_LINUX_RUNNER" + ], + "compiler_binary_sha256": "c54c9a149a23fc86fb96e08b433e09b555f690a0266c43a4b0e6095449035496", + "compiler_source_sha256": "9af1e185880c5c957c814d51bc46871a5eb74fe99a78e7c735840df098ed2180", + "hvf": { + "checks": [ + { + "acceleration": "hvf", + "case": "hello", + "cpu": "host", + "image_sha256": "db48724470a0f6748a9b99603b9e4effc1a60fbc121ae90564c03a6351319ad4", + "result": "PASS", + "source_sha256": "10a04e663e5dc397f96f29d7f337d121453045ce269343bfa73a6aa9c0b40641" + }, + { + "acceleration": "hvf", + "case": "address", + "cpu": "host", + "image_sha256": "9dccde9e7412763ec61643d9f6b23f55c6349bf7e4b6d85e71faec4284693b7e", + "result": "PASS", + "source_sha256": "5888072a234a34f31c0bbf801a369d9a2c4326438de016680dc0918fe929dce2" + }, + { + "acceleration": "hvf", + "case": "file-wait", + "cpu": "host", + "image_sha256": "f6fc98690f150cd1d53337ae17c5adc3e042d390eabc8ab3b434125ec8fa5e76", + "result": "PASS", + "source_sha256": "3b4aa425b2d5b79915361a08bc0747f10551883f2582a22abd30ecce9a4454fa" + }, + { + "acceleration": "hvf", + "case": "vector", + "cpu": "host", + "image_sha256": "05337e80ba83898502302ec21dfbbc3f12ede6abe61f4f570861d0e1ffd4910a", + "result": "PASS", + "source_sha256": "e853c4585d043508dc31f6159e8f94c7d6c737d3a5347ad648861cb6dabd32d4" + }, + { + "acceleration": "hvf", + "case": "vector-mutant", + "cpu": "host", + "image_sha256": "1a0f5cab4d8f22ead86b46c6dd3e9ec909ce46a820b4c60c452f9b234134026d", + "result": "PASS wrong vector instruction rejected", + "source_sha256": "e853c4585d043508dc31f6159e8f94c7d6c737d3a5347ad648861cb6dabd32d4" + }, + { + "acceleration": "hvf", + "case": "vector-dst-bounds", + "cpu": "host", + "image_sha256": "a4c353521ddbcab3ea9b46c17864a2b953bc207b818c06b707b591df9fd5539b", + "result": "PASS", + "source_sha256": "65f8502c8d7d9aef76bbd220be2ff765596c65a7798b8354d7afcd4297e0180d" + }, + { + "acceleration": "hvf", + "case": "vector-src-bounds", + "cpu": "host", + "image_sha256": "e824d7608846b340ed8a0cf66bc97fa4d4385527ddd1daf6e493d684197e1a8d", + "result": "PASS", + "source_sha256": "6aefa1f51dc5586481d68cdba63d8c98dcff5073e555efceceef02851fe74afd" + }, + { + "acceleration": "hvf", + "case": "dot-row-bounds", + "cpu": "host", + "image_sha256": "23f81cb01e679c048eecfff61f3cb5a901d4e0c1ae6b8ea337f1be96eb8adfe4", + "result": "PASS", + "source_sha256": "79a711726d5abe0a175cd64e028c4d5097ff1913a2b22cb9c1ac7071ca776e29" + }, + { + "acceleration": "hvf", + "case": "dot-matrix-bounds", + "cpu": "host", + "image_sha256": "7270d76b587b2ad99900beec64550b7d0f2814937066b121b4a77318bfc0af91", + "result": "PASS", + "source_sha256": "cebfcc2c0e6640693edd405684bf4434aba29466023620a9ea85a1d66701bfd3" + }, + { + "acceleration": "hvf", + "case": "dot-wrap-bounds", + "cpu": "host", + "image_sha256": "08b0d126b90495192bf59e038aab7c0c3e1d30fda2614179b6aba6028179ac64", + "result": "PASS", + "source_sha256": "653ff0c4647a7fa496691bc5bf40bd17daffafe2eb63b3ee5cab538ba057f3df" + }, + { + "acceleration": "hvf", + "case": "dot-stride-bounds", + "cpu": "host", + "image_sha256": "ab5a7f0a3e280ac855ccb16f89e688c2eec15512482cf49079860a1a9dcbc77d", + "result": "PASS", + "source_sha256": "fc56e2e2fcedbd930f0954763d743bc1776ea4ea5665c018acadb6ac76761f88" + }, + { + "case": "vector-readonly", + "compile_exit": 20 + }, + { + "case": "vector-type", + "compile_exit": 7 + }, + { + "acceleration": "hvf", + "case": "float", + "cpu": "host", + "image_sha256": "7c613d0b411ebcf60e40f1f408371519b65a8f8a5a5338d2931b37d129a74a28", + "result": "PASS", + "source_sha256": "9d6fb52b7479341c097affbde8e5c8bcc11fed1ee3e017841455c858e58fb402" + }, + { + "acceleration": "hvf", + "case": "float-mutant", + "cpu": "host", + "image_sha256": "5e405850432d0298c853a0c5619b46a91bae449bef0624ac05ce0ab55c919589", + "result": "PASS mutant rejected by parity oracle", + "source_sha256": "60cce239ee25fb279567f8b883bc22488a781bd34403ccf197edf1ef393ba0d7" + }, + { + "acceleration": "hvf", + "case": "bounds", + "cpu": "host", + "image_sha256": "447a4a88a7e9272f8bb1597c2a3b6ec0e70f4d237e593d176c70a06171fe3325", + "result": "PASS", + "source_sha256": "75c50ffce350fdb5c0fd465827a5c7722b2374872abebec2eabbabd88fb20bee" + }, + { + "case": "linux-refused", + "compile_exit": 25 + }, + { + "case": "bare-refused", + "compile_exit": 25 + }, + { + "case": "invalid-target", + "compile_exit": 25 + } + ], + "compiler_sha256": "c54c9a149a23fc86fb96e08b433e09b555f690a0266c43a4b0e6095449035496", + "firmware_sha256": "47765fe344818cbc464b1c14ae658fb4b854f5c2ceffa982411731eb4865594d", + "limits": [ + "targeted HVF tests only", + "no model, networking, browser, or performance qualification", + "ARM scalar/vector numerical and bounds checks included" + ], + "qemu": "QEMU emulator version 11.0.3" + }, + "limitations": [ + "Physical ARM firmware and standalone kernel NOT_RUN.", + "Real device IRQ/chip paths NOT_RUN.", + "Wycheproof fixture not vendored; live external TLS not run.", + "Application/browser/performance acceptance belongs to the separate Aienux consumer." + ], + "observations": "Runs preceded the source commit; input/source/binary hashes identify the exact committed implementation. No passing result is inferred from commit status.", + "recorded_utc": "2026-11-06T19:16:41.448841+00:00", + "result": "PASS_TARGETED", + "source_commit": "0b17fda6a7b80e1ca5b82c3e38fa7bc862889b16", + "source_tree_clean_at_receipt": true +} diff --git a/seed/net/.crumb b/seed/net/.crumb index 730c8f82a..a5368eb6f 100644 --- a/seed/net/.crumb +++ b/seed/net/.crumb @@ -3,14 +3,14 @@ "generated": { "children": [], "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-30T18:16:56Z", + "compiled_at": "2026-11-06T19:04:53Z", "compiler": "crumb-compile/1", - "digest": "sha256:7b124c8a1192d308694934baa6b305e9a7647ba13610f08cd27a3b503e66cf1f", + "digest": "sha256:7a426a9a7d3920f45b780dabc24f58c7451e910775c98d949b7aa599616d45af", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 11, - "generated_at_commit": "14fa8bdf24eb4b9ad0758759285e6dbc0979d84c", - "source_tree": "sha256:398ed32c0059dd6120673b3c837688fcb4177f6530682111e74b4296aa6fabdf" + "files": 13, + "generated_at_commit": "fd3751b314299f16a624aefb0cc1bb919e7fa65f", + "source_tree": "sha256:c3dcfc24f73edbfde8e30b8bf5e2edf9a13ef2ebb77f02325e4d6f40b1734bd6" } }, "invariants": [ diff --git a/seed/net/http-core.om b/seed/net/http-core.om new file mode 100644 index 000000000..d477d13ba --- /dev/null +++ b/seed/net/http-core.om @@ -0,0 +1,2391 @@ +note seed/net/http-core.om -- bounded HTTP/1.1 server and client in seeded Omega (omega-mv #788). +note Library unit: it has no `om2` line, no `fn main` and no globals. An application composes +note { printf 'om2\n'; cat seed/net/http.om app.om; } | omc +note (JSON users add seed/json/json.om in the same cat). Names: functions h*, consts H*, texts h*. +note Contract, framing rules, error values and ownership: seed/net/README.md. +note +note A connection is two caller-owned arrays: +note cs = new ulong HCSLEN 0 state (fd, buffer cursors, deadlines, framing, header index) +note io = new uchar N 0 one byte array split by hinit into a read region io[0, HRCAP), +note a write region io[HWB, HWB+HWCAP) and a transport region +note io[HTB, HTB+HTL) (empty for plain TCP; the TLS state for HTTPS) +note The transport hooks htlsrecv, htlsrecvd and htlssend (HXPORT 1) come from seed/net/https.om +note (om/tls) or seed/net/notls.om (HENOSUP); one of the two is composed after this unit. +note Header and target offsets stored in cs are absolute offsets into io and stay valid until the +note next hreqrd / hrsprd on the same cs. +note +note Results: a long. Nonnegative is success. Negative is minus a Linux errno (-11, -104, ...), +note or one of the HE* protocol values below (-400 .. -505), or HETIME (-110) at a deadline. +note +note ---- state slots of cs +const HFD ulong 0 +const HRLEN ulong 1 +const HRPOS ulong 2 +const HDL ulong 3 +const HIDLE ulong 4 +const HKEEP ulong 5 +const HBMODE ulong 6 +const HBREM ulong 7 +const HCST ulong 8 +const HMEM ulong 9 +const HBCAP ulong 10 +const HBGOT ulong 11 +const HVER ulong 12 +const HSTAT ulong 13 +const HMOFF ulong 14 +const HMLEN ulong 15 +const HTOFF ulong 16 +const HTLEN ulong 17 +const HHN ulong 18 +const HHMAX ulong 19 +const HHEADMX ulong 20 +const HWLEN ulong 21 +const HNMSG ulong 22 +const HMAXMSG ulong 23 +const HHEND ulong 24 +const HISHEAD ulong 25 +const HWMODE ulong 26 +const HEXPECT ulong 27 +const HFLAGS ulong 28 +const HCLV ulong 29 +const HOPEN ulong 30 +const HHDLV ulong 31 +const HSERVER ulong 32 +const HSTART ulong 33 +const HSCAN ulong 34 +const HRCAP ulong 35 +const HWB ulong 36 +const HWCAP ulong 37 +const HTB ulong 38 +const HTL ulong 39 +const HXPORT ulong 40 +const HWBODY ulong 41 +const HWDROP ulong 42 +const HWOUT ulong 43 +const HWCL ulong 44 +const HOMODE ulong 45 +const HSCODE ulong 46 +const HTRN ulong 47 +const HHOSTN ulong 48 +const HBDLV ulong 49 +const HFINAL ulong 50 +const HFRM ulong 51 +const HFRMAX ulong 52 +const HBSC ulong 53 +note HXDL: absolute monotonic deadline of the whole exchange for the transport (0 = none); set by +note htlsdl (seed/net/https.om) after hinit; plain TCP does not read it +const HXDL ulong 54 +note header i (0 <= i < HHN): cs[HHX+4i] name offset, +1 name length, +2 value offset, +3 value length +const HHX ulong 64 +const HHSLOTS ulong 64 +const HCSLEN ulong 320 +note ---- results +const HEINVAL long -22 +const HENOSUP long -95 +const HETIME long -110 +const HEBAD long -400 +const HEEXP long -417 +const HEBIG long -413 +const HEHEAD long -431 +const HETRUNC long -499 +const HETE long -501 +const HEVER long -505 +note ---- SSE reader: ss = new ulong HSSLEN 0, lb = new uchar N 0 (N >= 256) +note lb[0, 64) event type, lb[64, 128) last event id, lb[128, ...) data and the line being read +const HSLINE ulong 0 +const HSDLEN ulong 1 +const HSELEN ulong 2 +const HSILEN ulong 3 +const HSRETRY ulong 4 +const HSRDY ulong 5 +const HSCR ulong 6 +const HSBOM ulong 7 +const HSNEV ulong 8 +note HSVO / HSVL: value offset and length of the field line being applied (scratch) +const HSVO ulong 9 +const HSVL ulong 10 +const HSSLEN ulong 16 +const HSIDB ulong 64 +const HSDB ulong 128 +const HSFCAP ulong 64 +note ---- byte strings (lowercase ones are compared case-insensitively) +text hvhttp "HTTP/" +text hv11 "HTTP/1.1" +text hnclen "content-length" +text hnte "transfer-encoding" +text hnconn "connection" +text hnhost "host" +text hnexp "expect" +text hvchunk "chunked" +text hvclose "close" +text hvkeep "keep-alive" +text hv100c "100-continue" +text hmhead "HEAD" +text hmconn "CONNECT" +text hoclen "Content-Length: " +text hote "Transfer-Encoding: chunked" +text hocls "Connection: close" +text ho100 "HTTP/1.1 100 Continue" +text hoctype "Content-Type" +text hocache "Cache-Control" +text hvnoca "no-cache" +text hvevst "text/event-stream" +text hsdata "data: " +text hsevent "event: " +text hsid "id: " +text hsretry "retry: " +text hfdata "data" +text hfevent "event" +text hfid "id" +text hfretry "retry" +text hr100 "Continue" +text hr101 "Switching Protocols" +text hr200 "OK" +text hr201 "Created" +text hr202 "Accepted" +text hr204 "No Content" +text hr206 "Partial Content" +text hr301 "Moved Permanently" +text hr302 "Found" +text hr304 "Not Modified" +text hr400 "Bad Request" +text hr401 "Unauthorized" +text hr403 "Forbidden" +text hr404 "Not Found" +text hr405 "Method Not Allowed" +text hr408 "Request Timeout" +text hr409 "Conflict" +text hr411 "Length Required" +text hr413 "Content Too Large" +text hr414 "URI Too Long" +text hr415 "Unsupported Media Type" +text hr417 "Expectation Failed" +text hr422 "Unprocessable Content" +text hr429 "Too Many Requests" +text hr431 "Request Header Fields Too Large" +text hr500 "Internal Server Error" +text hr501 "Not Implemented" +text hr502 "Bad Gateway" +text hr503 "Service Unavailable" +text hr504 "Gateway Timeout" +text hr505 "HTTP Version Not Supported" +note ======== small helpers +fn hmin a ulong b ulong to ulong +if lt a b +ret a +end +ret b +end +fn hfe a long b long to long +note first error: a when a is negative, else b +if lt a 0 +ret a +end +ret b +end +fn hlow c uchar to uchar +if and ge c 65 le c 90 +ret add c 32 +end +ret c +end +fn hws c uchar to bool +ret or eq c 32 eq c 9 +end +note htchar: RFC 9110 tchar +fn htchar c uchar to bool +if and ge c 97 le c 122 +ret true +end +if and ge c 65 le c 90 +ret true +end +if and ge c 48 le c 57 +ret true +end +if or or or eq c 33 eq c 35 eq c 36 eq c 37 +ret true +end +if or or or eq c 38 eq c 39 eq c 42 eq c 43 +ret true +end +if or or or eq c 45 eq c 46 eq c 94 eq c 95 +ret true +end +ret or or eq c 96 eq c 124 eq c 126 +end +note hvch: a field-value byte: HTAB, SP, VCHAR or obs-text (0x80-0xff); never CR, LF, NUL, DEL +fn hvch c uchar to bool +if eq c 9 +ret true +end +ret and ge c 32 ne c 127 +end +fn hvall a view uchar * to bool +for b ulong 65536 +s = mul b 65536 +if ge s len a +ret true +end +m = hmin sub len a s 65536 +for i ulong m +if not hvch get a add s i +ret false +end +end +end +ret true +end +fn htok a view uchar * to bool +n = len a +if or eq n 0 gt n 64 +ret false +end +for i ulong n +if not htchar get a i +ret false +end +end +ret true +end +fn htarg a view uchar * to bool +n = len a +if or eq n 0 gt n 8192 +ret false +end +for i ulong n +c = get a i +if or lt c 33 gt c 126 +ret false +end +end +ret true +end +fn hdigits a view uchar * to bool +n = len a +if or eq n 0 gt n 19 +ret false +end +for i ulong n +c = get a i +if or lt c 48 gt c 57 +ret false +end +end +ret true +end +fn hdecv a view uchar * to ulong +note the value of 1..19 checked decimal digits (hdigits first) +v = ulong 0 +for i ulong len a +v = add mul v 10 ulong sub get a i 48 +end +ret v +end +fn hieq a view uchar * t view uchar * to bool +note ASCII case-insensitive equality; t is lowercase +n = len a +if ne n len t +ret false +end +for i ulong n +if ne hlow get a i get t i +ret false +end +end +ret true +end +fn heq a view uchar * t view uchar * to bool +n = len a +if ne n len t +ret false +end +for i ulong n +if ne get a i get t i +ret false +end +end +ret true +end +note hcopy: d[0, len s) = s; blocks of 65536 keep every loop under the 1000000-pass guard +fn hcopy d edit uchar * s view uchar * to void +n = len s +for b ulong 65536 +st = mul b 65536 +if ge st n +break +end +m = hmin sub n st 65536 +for i ulong m +put d add st i get s add st i +end +end +end +note hmove: a[dt, dt+n) = a[sr, sr+n) with dt <= sr (forward copy) +fn hmove a edit uchar * dt ulong sr ulong n ulong to void +for b ulong 65536 +st = mul b 65536 +if ge st n +break +end +m = hmin sub n st 65536 +for i ulong m +put a add dt add st i get a add sr add st i +end +end +end +fn hhexv c uchar to ulong +if and ge c 48 le c 57 +ret ulong sub c 48 +end +if and ge c 97 le c 102 +ret ulong sub c 87 +end +if and ge c 65 le c 70 +ret ulong sub c 55 +end +ret 16 +end +fn hhexd v ulong to uchar +if lt v 10 +ret uchar add v 48 +end +ret uchar add v 87 +end +note ======== transport boundary: the only functions that call recv, send and waitio on a connection +note hwait: wait for events ev on the connection; interval = min(idle, deadline - now) +fn hwait cs edit ulong * ev int to long +fd = int get cs HFD +for it ulong 4096 +iv = long -1 +if ne get cs HIDLE 0 +iv = long get cs HIDLE +end +dl = get cs HDL +if ne dl 0 +now = ulong htclock +if ge now dl +ret HETIME +end +rm = long sub dl now +if or lt iv 0 lt rm iv +iv = rm +end +end +r = htwait fd ev iv +if eq r 0 +ret HETIME +end +if ne r -4 +ret r +end +end +ret HETIME +end +note hrecvio: at most n bytes into io[off, off+n); count, 0 at end of stream, or negative +fn hrecvio cs edit ulong * io edit uchar * off ulong n ulong to long +if ne get cs HMEM 0 +ret 0 +end +if ne get cs HXPORT 0 +ret htlsrecv cs io off n +end +fd = int get cs HFD +for it ulong 4096 +r = htrecv fd io off n +if eq r -11 +w = hwait cs 1 +if lt w 0 +ret w +end +continue +end +if ne r -4 +ret r +end +end +ret HETIME +end +note hrecvd: at most len d bytes straight into the caller's array d +fn hrecvd cs edit ulong * io edit uchar * d edit uchar * to long +if ne get cs HMEM 0 +ret 0 +end +if ne get cs HXPORT 0 +ret htlsrecvd cs io d +end +fd = int get cs HFD +for it ulong 4096 +r = htrecv fd d 0 len d +if eq r -11 +w = hwait cs 1 +if lt w 0 +ret w +end +continue +end +if ne r -4 +ret r +end +end +ret HETIME +end +note hsendio: send all of io[off, off+n); 0 or negative +fn hsendio cs edit ulong * io edit uchar * off ulong n ulong to long +if ne get cs HMEM 0 +ret -9 +end +if ne get cs HXPORT 0 +ret htlssend cs io off n +end +fd = int get cs HFD +e = add off n +p = off +for it ulong 4194304 +if ge p e +ret 0 +end +r = htsend fd io p sub e p +if gt r 0 +p = add p ulong r +continue +end +if eq r -11 +w = hwait cs 4 +if lt w 0 +ret w +end +continue +end +if eq r 0 +ret -32 +end +if ne r -4 +ret r +end +end +ret HETIME +end +note ======== connection setup +note hinit: take ownership of fd (hclose closes it); fd < 0 selects memory mode (no I/O; tests). +note role 1 = server (reads requests, writes responses), 0 = client. +fn hinit cs edit ulong * io edit uchar * fd int role ulong to long +if lt len cs HCSLEN +ret HEINVAL +end +if or lt len io 512 gt len io 16777216 +ret HEINVAL +end +if gt role 1 +ret HEINVAL +end +for i ulong HCSLEN +put cs i 0 +end +if lt fd 0 +put cs HMEM 1 +else +put cs HFD ulong fd +put cs HOPEN 1 +end +put cs HSERVER role +put cs HBCAP 1048576 +put cs HHMAX HHSLOTS +put cs HMAXMSG 1000 +put cs HIDLE 30000000000 +put cs HHDLV 30000000000 +put cs HBDLV 60000000000 +put cs HFRMAX 65536 +put cs HKEEP 1 +w = hmin div len io 4 65536 +if lt w 256 +w = 256 +end +ret hlayout cs len io w +end +fn hlayout cs edit ulong * n ulong w ulong to long +r = sub n w +put cs HRCAP r +put cs HWB r +put cs HWCAP w +put cs HTB n +put cs HTL 0 +put cs HHEADMX hmin 16384 div r 2 +ret 0 +end +note hsetw: change the write region capacity (256 .. 65536) before any I/O on cs +fn hsetw cs edit ulong * io edit uchar * w ulong to long +if or ne get cs HRLEN 0 ne get cs HWLEN 0 +ret HEINVAL +end +if or lt w 256 gt w 65536 +ret HEINVAL +end +if lt len io add w 512 +ret HEINVAL +end +ret hlayout cs len io w +end +note hsettmo: idle = longest single wait in ns (0 = none); hdl = deadline for reading one +note message head, counted from the start of hreqrd / hrsprd (0 = none). Negative means 0. +fn hsettmo cs edit ulong * idle long hdl long to void +put cs HIDLE 0 +if gt idle 0 +put cs HIDLE ulong idle +end +put cs HHDLV 0 +if gt hdl 0 +put cs HHDLV ulong hdl +end +end +note hsetbdl: interval armed as the deadline (HDL) for a message's body reads and the response +note writes when its head has been read, and for a request's writes when hreqst starts it +note (0 = none). The default is 60 s; a long-lived stream (SSE) sets its own with hsetdl. +fn hsetbdl cs edit ulong * iv long to void +put cs HBDLV 0 +if gt iv 0 +put cs HBDLV ulong iv +end +end +fn hbdl cs edit ulong * to ulong +if eq get cs HBDLV 0 +ret 0 +end +ret add ulong htclock get cs HBDLV +end +note hsetdl: absolute deadline now + iv for the following body reads and writes (0 clears) +fn hsetdl cs edit ulong * iv long to void +put cs HDL 0 +if gt iv 0 +put cs HDL add ulong htclock ulong iv +end +end +fn hclose cs edit ulong * to long +if eq get cs HOPEN 1 +put cs HOPEN 0 +put cs HKEEP 0 +ret htclose int get cs HFD +end +ret 0 +end +note hmemld: memory mode only; the read region holds exactly src (a whole test message) +fn hmemld cs edit ulong * io edit uchar * src view uchar * to long +if eq get cs HMEM 0 +ret HEINVAL +end +if gt len src get cs HRCAP +ret HEBIG +end +hcopy part io 0 len src src +put cs HRLEN len src +put cs HRPOS 0 +ret 0 +end +note ======== sockets (IPv4 or Unix); every descriptor is O_NONBLOCK and close-on-exec +fn haddr4 a edit uchar * ip uint port ulong to long +if lt len a 16 +ret HEINVAL +end +if gt port 65535 +ret HEINVAL +end +for i ulong 16 +put a i 0 +end +put a 0 2 +put a 2 uchar shr port 8 +put a 3 uchar and port 255 +put a 4 uchar shr ip 24 +put a 5 uchar and shr ip 16 255 +put a 6 uchar and shr ip 8 255 +put a 7 uchar and ip 255 +ret 0 +end +fn hport a view uchar * to ulong +ret or shl ulong get a 2 8 ulong get a 3 +end +fn hfam a view uchar * to int +ret int or ulong get a 0 shl ulong get a 1 8 +end +note ======== reading a message head +note hbegin: drop the consumed bytes of the previous message, reset per-message state, arm the +note head deadline +fn hbegin cs edit ulong * io edit uchar * to void +p = get cs HRPOS +n = get cs HRLEN +if gt p 0 +hmove io 0 p sub n p +put cs HRLEN sub n p +put cs HRPOS 0 +end +if gt get cs HHEADMX hmin 65536 div get cs HRCAP 2 +put cs HHEADMX hmin 65536 div get cs HRCAP 2 +end +if gt get cs HHMAX HHSLOTS +put cs HHMAX HHSLOTS +end +put cs HSTART 0 +put cs HSCAN 0 +put cs HHN 0 +put cs HFLAGS 0 +put cs HCLV 0 +put cs HBMODE 0 +put cs HBREM 0 +put cs HCST 0 +put cs HBGOT 0 +put cs HEXPECT 0 +put cs HHEND 0 +put cs HSTAT 0 +put cs HVER 0 +put cs HTRN 0 +put cs HHOSTN 0 +put cs HMOFF 0 +put cs HMLEN 0 +put cs HTOFF 0 +put cs HTLEN 0 +put cs HKEEP 1 +put cs HFINAL 0 +put cs HFRM 0 +put cs HBSC 0 +put cs HDL 0 +if ne get cs HHDLV 0 +put cs HDL add ulong htclock get cs HHDLV +end +end +note hskipcr: a server ignores empty lines (CRLF) before a request line (RFC 9112 2.2) +fn hskipcr cs edit ulong * io edit uchar * to void +for it ulong 999999 +st = get cs HSTART +if gt add st 2 get cs HRLEN +break +end +if ne get io st 13 +break +end +if ne get io add st 1 10 +break +end +put cs HSTART add st 2 +end +end +note hscan: look for CRLF CRLF in io[HSTART, min(HRLEN, HHEADMX)); end offset, 0 = need more, +note HEBAD for a bare LF or a CR not followed by LF +fn hscan cs edit ulong * io edit uchar * to long +st = get cs HSTART +lim = hmin get cs HRLEN get cs HHEADMX +i = get cs HSCAN +if lt i st +i = st +end +while lt i lim bound 999999 +c = get io i +if eq c 10 +if eq i st +ret HEBAD +end +if ne get io sub i 1 13 +ret HEBAD +end +if ge i add st 3 +if and eq get io sub i 2 10 eq get io sub i 3 13 +put cs HSCAN add i 1 +ret long add i 1 +end +end +end +if eq c 13 +if ge add i 1 get cs HRLEN +put cs HSCAN i +ret 0 +end +if ne get io add i 1 10 +ret HEBAD +end +end +i = add i 1 +end +put cs HSCAN i +ret 0 +end +fn hhead cs edit ulong * io edit uchar * to long +for it ulong 1000000 +if eq get cs HSERVER 1 +hskipcr cs io +end +e = hscan cs io +if lt e 0 +ret e +end +if gt e 0 +ret hparse cs io ulong e +end +n = get cs HRLEN +if ge n get cs HHEADMX +ret HEHEAD +end +if ge n get cs HRCAP +ret HEHEAD +end +k = hrecvio cs io n sub get cs HRCAP n +if lt k 0 +ret k +end +if eq k 0 +if eq n get cs HSTART +ret 0 +end +ret HETRUNC +end +put cs HRLEN add n ulong k +end +ret HEHEAD +end +note hcr: the first CR in a[p, e) (the head scan guarantees CR LF pairs), or e +fn hcr a view uchar * p ulong e ulong to ulong +i = p +while lt i e bound 999999 +if eq get a i 13 +ret i +end +i = add i 1 +end +ret e +end +fn hparse cs edit ulong * io edit uchar * e ulong to long +p = get cs HSTART +x = hcr io p e +r = long 0 +if eq get cs HSERVER 1 +r = hreql cs io p x +else +r = hstatl cs io p x +end +if lt r 0 +ret r +end +p = add x 2 +lim = sub e 2 +for it ulong 65536 +if ge p lim +break +end +x = hcr io p lim +r = hfield cs io p x +if lt r 0 +ret r +end +p = add x 2 +end +r = hsem cs io +if lt r 0 +ret r +end +put cs HHEND e +put cs HRPOS e +put cs HDL hbdl cs +ret 1 +end +note hreqm: method = 1..32 tchar then SP; returns its length +fn hreqm a view uchar * p ulong x ulong to long +i = p +while and lt i x htchar get a i bound 999999 +i = add i 1 +end +ml = sub i p +if or eq ml 0 gt ml 32 +ret HEBAD +end +if ne get a i 32 +ret HEBAD +end +ret long ml +end +note hreqt: request-target = 1..8192 bytes 0x21-0x7e then SP; returns its length +fn hreqt a view uchar * t ulong x ulong to long +j = t +while and lt j x and ge get a j 33 le get a j 126 bound 999999 +j = add j 1 +end +tl = sub j t +if or eq tl 0 gt tl 8192 +ret HEBAD +end +if ne get a j 32 +ret HEBAD +end +ret long tl +end +note hver: exactly HTTP/1.1 (1) or HTTP/1.0 (0); another HTTP/d.d is HEVER, anything else HEBAD +fn hver a view uchar * k ulong to long +for i ulong 5 +if ne get a add k i get hvhttp i +ret HEBAD +end +end +mj = get a add k 5 +dt = get a add k 6 +mn = get a add k 7 +if or or lt mj 48 gt mj 57 ne dt 46 +ret HEBAD +end +if or lt mn 48 gt mn 57 +ret HEBAD +end +if ne mj 49 +ret HEVER +end +if eq mn 48 +ret 0 +end +if eq mn 49 +ret 1 +end +ret HEVER +end +fn hreql cs edit ulong * io edit uchar * p ulong x ulong to long +ml = hreqm io p x +if lt ml 0 +ret ml +end +t = add p add ulong ml 1 +tl = hreqt io t x +if lt tl 0 +ret tl +end +k = add t add ulong tl 1 +if ne sub x k 8 +ret HEBAD +end +v = hver io k +if lt v 0 +ret v +end +put cs HVER ulong v +put cs HMOFF p +put cs HMLEN ulong ml +put cs HTOFF t +put cs HTLEN ulong tl +ret htform cs io +end +note htform: origin-form (/...), asterisk-form (*), authority-form (CONNECT only) or +note absolute-form (scheme://...) +fn htform cs edit ulong * io edit uchar * to long +t = get cs HTOFF +tl = get cs HTLEN +c = get io t +if eq c 47 +ret 0 +end +if and eq tl 1 eq c 42 +ret 0 +end +if heq view part io get cs HMOFF get cs HMLEN hmconn +ret 0 +end +ret hscheme view part io t tl +end +fn hscheme a view uchar * to long +n = len a +if lt n 4 +ret HEBAD +end +c = hlow get a 0 +if or lt c 97 gt c 122 +ret HEBAD +end +for i ulong n +if gt i 0 +c = hlow get a i +if eq c 58 +if gt add i 3 n +ret HEBAD +end +if and eq get a add i 1 47 eq get a add i 2 47 +ret 0 +end +ret HEBAD +end +if not hschc c +ret HEBAD +end +end +end +ret HEBAD +end +note hschc: a scheme byte after the first (lowercased): ALPHA, DIGIT, + - . +fn hschc c uchar to bool +if and ge c 97 le c 122 +ret true +end +if and ge c 48 le c 57 +ret true +end +ret or or eq c 43 eq c 45 eq c 46 +end +note hstatl: HTTP/1.x SP 3DIGIT SP reason; status 100..599 +fn hstatl cs edit ulong * io edit uchar * p ulong x ulong to long +if lt sub x p 8 +ret HEBAD +end +v = hver io p +if lt v 0 +ret v +end +if lt sub x p 13 +ret HEBAD +end +if or ne get io add p 8 32 ne get io add p 12 32 +ret HEBAD +end +c = ulong 0 +for i ulong 3 +d = get io add p add 9 i +if or lt d 48 gt d 57 +ret HEBAD +end +c = add mul c 10 ulong sub d 48 +end +if or lt c 100 gt c 599 +ret HEBAD +end +r = add p 13 +if not hvall view part io r sub x r +ret HEBAD +end +put cs HVER ulong v +put cs HSTAT c +put cs HMOFF r +put cs HMLEN sub x r +ret 0 +end +note hfvalid: a field line: tchar name, ':' with no space before it, field-value bytes; +note returns the colon index. A leading SP or HTAB (obs-fold) is HEBAD. +fn hfvalid a view uchar * to long +n = len a +if eq n 0 +ret HEBAD +end +if hws get a 0 +ret HEBAD +end +c = n +for i ulong n +if not htchar get a i +c = i +break +end +end +if or eq c 0 eq c n +ret HEBAD +end +if ne get a c 58 +ret HEBAD +end +k = add c 1 +if not hvall view part a k sub n k +ret HEBAD +end +ret long c +end +fn hfield cs edit ulong * io edit uchar * p ulong x ulong to long +co = hfvalid view part io p sub x p +if lt co 0 +ret co +end +n = get cs HHN +if or ge n get cs HHMAX ge n HHSLOTS +ret HEHEAD +end +b = add HHX mul n 4 +put cs b p +put cs add b 1 ulong co +put cs HHN add n 1 +put cs add b 2 add add p ulong co 1 +ret hftrim cs io b x +end +note hftrim: header slot b's value starts at get cs b+2 and ends before x; drop leading and +note trailing SP / HTAB +fn hftrim cs edit ulong * io edit uchar * b ulong x ulong to long +s = get cs add b 2 +while and lt s x hws get io s bound 999999 +s = add s 1 +end +ve = x +while and gt ve s hws get io sub ve 1 bound 999999 +ve = sub ve 1 +end +put cs add b 2 s +put cs add b 3 sub ve s +ret 0 +end +note ======== header semantics and message framing (RFC 9112 6.1-6.3) +fn hsem cs edit ulong * io edit uchar * to long +n = get cs HHN +for i ulong n +r = hsem1 cs io i +if lt r 0 +ret r +end +end +ret hframe cs +end +fn hsem1 cs edit ulong * io edit uchar * i ulong to long +b = add HHX mul i 4 +no = get cs b +nl = get cs add b 1 +vo = get cs add b 2 +vl = get cs add b 3 +if hieq view part io no nl hnclen +ret hsemcl cs io vo vl +end +if hieq view part io no nl hnte +ret hsemte cs io vo vl +end +if hieq view part io no nl hnconn +ret hsemco cs io vo vl +end +if hieq view part io no nl hnhost +put cs HHOSTN add get cs HHOSTN 1 +ret 0 +end +if hieq view part io no nl hnexp +ret hsemex cs io vo vl +end +ret 0 +end +note Content-Length: 1..19 digits, exactly one field line (a repeated or list value is ambiguous) +fn hsemcl cs edit ulong * io edit uchar * vo ulong vl ulong to long +if ne and get cs HFLAGS 1 0 +ret HEBAD +end +put cs HFLAGS or get cs HFLAGS 1 +if not hdigits view part io vo vl +ret HEBAD +end +put cs HCLV hdecv view part io vo vl +ret 0 +end +note Transfer-Encoding: exactly one field line whose value is chunked; any other coding is HETE +fn hsemte cs edit ulong * io edit uchar * vo ulong vl ulong to long +if ne and get cs HFLAGS 2 0 +ret HEBAD +end +put cs HFLAGS or get cs HFLAGS 2 +if not hieq view part io vo vl hvchunk +ret HETE +end +ret 0 +end +note Connection: comma list; close (flag 4) and keep-alive (flag 8) are recognised +fn hsemco cs edit ulong * io edit uchar * vo ulong vl ulong to long +p = vo +e = add vo vl +for it ulong 999999 +if gt p e +break +end +q = p +while and lt q e ne get io q 44 bound 999999 +q = add q 1 +end +r = hcotok cs io p q +p = add q 1 +end +ret 0 +end +note hcotok: the list element io[a, q) without SP / HTAB; sets flag 4 (close) or 8 (keep-alive) +fn hcotok cs edit ulong * io edit uchar * a ulong q ulong to long +s = a +while and lt s q hws get io s bound 999999 +s = add s 1 +end +z = q +while and gt z s hws get io sub z 1 bound 999999 +z = sub z 1 +end +if hieq view part io s sub z s hvclose +put cs HFLAGS or get cs HFLAGS 4 +end +if hieq view part io s sub z s hvkeep +put cs HFLAGS or get cs HFLAGS 8 +end +ret 0 +end +note Expect (server, HTTP/1.1 only): 100-continue is honoured on the first body read; others HEEXP +fn hsemex cs edit ulong * io edit uchar * vo ulong vl ulong to long +if or ne get cs HSERVER 1 ne get cs HVER 1 +ret 0 +end +if not hieq view part io vo vl hv100c +ret HEEXP +end +put cs HEXPECT 1 +ret 0 +end +fn hframe cs edit ulong * to long +f = get cs HFLAGS +cl = ne and f 1 0 +te = ne and f 2 0 +if and cl te +ret HEBAD +end +if and te eq get cs HVER 0 +ret HEBAD +end +srv = eq get cs HSERVER 1 +if and srv eq get cs HVER 1 +if ne get cs HHOSTN 1 +ret HEBAD +end +end +put cs HKEEP 0 +if and eq get cs HVER 1 eq and f 4 0 +put cs HKEEP 1 +end +if srv +if ge add get cs HNMSG 1 get cs HMAXMSG +put cs HKEEP 0 +end +ret hfrsrv cs +end +ret hfrcli cs +end +fn hfrsrv cs edit ulong * to long +f = get cs HFLAGS +if ne and f 2 0 +put cs HBMODE 2 +ret 0 +end +if ne and f 1 0 +v = get cs HCLV +if gt v get cs HBCAP +put cs HKEEP 0 +ret HEBIG +end +if gt v 0 +put cs HBMODE 1 +put cs HBREM v +end +end +ret 0 +end +fn hfrcli cs edit ulong * to long +s = get cs HSTAT +f = get cs HFLAGS +if eq s 101 +put cs HKEEP 0 +end +if or or eq get cs HISHEAD 1 lt s 200 or eq s 204 eq s 304 +ret 0 +end +if ne and f 2 0 +put cs HBMODE 2 +ret 0 +end +if ne and f 1 0 +v = get cs HCLV +if gt v get cs HBCAP +put cs HKEEP 0 +ret HEBIG +end +if gt v 0 +put cs HBMODE 1 +put cs HBREM v +end +ret 0 +end +put cs HBMODE 3 +put cs HKEEP 0 +ret 0 +end +note ======== public head readers +note hreqrd (server): 1 = a request head was read, 0 = the peer closed between requests, negative = +note error (a value <= -400 is the status to answer with hrsperr before closing) +fn hreqrd cs edit ulong * io edit uchar * to long +if and eq get cs HOPEN 0 eq get cs HMEM 0 +ret -9 +end +hbegin cs io +put cs HISHEAD 0 +r = hhead cs io +if le r 0 +ret r +end +if heq view part io get cs HMOFF get cs HMLEN hmhead +put cs HISHEAD 1 +end +ret 1 +end +note hrsprd (client): the final status (101, or 200..599; 1xx interim responses are skipped) +fn hrsprd cs edit ulong * io edit uchar * to long +if and eq get cs HOPEN 0 eq get cs HMEM 0 +ret -9 +end +for it ulong 16 +hbegin cs io +r = hhead cs io +if eq r 0 +ret HETRUNC +end +if lt r 0 +ret r +end +s = get cs HSTAT +if or ge s 200 eq s 101 +ret long s +end +put cs HRPOS get cs HHEND +end +ret HEBAD +end +note header accessors: hhfind returns the index of the first field named nm (any case), or -1 +fn hhfind cs edit ulong * io edit uchar * nm view uchar * to long +n = get cs HHN +for i ulong n +b = add HHX mul i 4 +if hieqm view part io get cs b get cs add b 1 nm +ret long i +end +end +ret -1 +end +note hieqm: case-insensitive equality of two arbitrary byte strings +fn hieqm a view uchar * t view uchar * to bool +n = len a +if ne n len t +ret false +end +for i ulong n +if ne hlow get a i hlow get t i +ret false +end +end +ret true +end +fn hhvoff cs edit ulong * i ulong to ulong +ret get cs add HHX add mul i 4 2 +end +fn hhvlen cs edit ulong * i ulong to ulong +ret get cs add HHX add mul i 4 3 +end +fn hhnoff cs edit ulong * i ulong to ulong +ret get cs add HHX mul i 4 +end +fn hhnlen cs edit ulong * i ulong to ulong +ret get cs add HHX add mul i 4 1 +end +note hismeth: the request method equals m exactly; hispath: the target before '?' equals pa +fn hismeth cs edit ulong * io edit uchar * m view uchar * to bool +ret heq view part io get cs HMOFF get cs HMLEN m +end +fn hplen cs edit ulong * io edit uchar * to ulong +t = get cs HTOFF +n = get cs HTLEN +for i ulong n +if eq get io add t i 63 +ret i +end +end +ret n +end +fn hispath cs edit ulong * io edit uchar * pa view uchar * to bool +n = hplen cs io +ret heq view part io get cs HTOFF n pa +end +note ======== body reading +note hbodyrd: next decoded body bytes into d[0, r); 0 = end of body; negative = error. +note Content-Length, chunked and (client) close-delimited framing; HBCAP bounds the total. +fn hbodyrd cs edit ulong * io edit uchar * d edit uchar * to long +m = get cs HBMODE +if eq m 0 +ret 0 +end +if eq len d 0 +ret HEINVAL +end +if eq get cs HEXPECT 1 +put cs HEXPECT 2 +r = hsend100 cs io +if lt r 0 +ret r +end +end +if eq m 1 +ret hbdlen cs io d +end +if eq m 3 +ret hbdcls cs io d +end +ret hbdchk cs io d +end +fn hsend100 cs edit ulong * io edit uchar * to long +if or ne get cs HFINAL 0 ne get cs HMEM 0 +ret 0 +end +b = get cs HWB +n = len ho100 +hcopy part io b n ho100 +put io add b n 13 +put io add b add n 1 10 +put io add b add n 2 13 +put io add b add n 3 10 +ret hsendio cs io b add n 4 +end +note hbcopy: move buffered bytes io[HRPOS, ...) into d (at most len d) +fn hbcopy cs edit ulong * io edit uchar * d edit uchar * to ulong +p = get cs HRPOS +n = hmin sub get cs HRLEN p len d +hcopy part d 0 n view part io p n +put cs HRPOS add p n +ret n +end +fn hbdlen cs edit ulong * io edit uchar * d edit uchar * to long +rm = get cs HBREM +if eq rm 0 +ret 0 +end +k = hmin rm len d +n = ulong 0 +if gt get cs HRLEN get cs HRPOS +n = hbcopy cs io part d 0 k +else +r = hrecvd cs io part d 0 k +if lt r 0 +ret r +end +if eq r 0 +ret HETRUNC +end +n = ulong r +end +put cs HBREM sub rm n +put cs HBGOT add get cs HBGOT n +ret long n +end +fn hbdcls cs edit ulong * io edit uchar * d edit uchar * to long +if eq get cs HCST 4 +ret 0 +end +got = get cs HBGOT +cap = get cs HBCAP +k = hmin len d add sub cap got 1 +n = ulong 0 +if gt get cs HRLEN get cs HRPOS +n = hbcopy cs io part d 0 k +else +r = hrecvd cs io part d 0 k +if lt r 0 +ret r +end +if eq r 0 +put cs HCST 4 +ret 0 +end +n = ulong r +end +if gt add got n cap +ret HEBIG +end +put cs HBGOT add got n +ret long n +end +note chunked states (HCST): 0 size line, 1 data, 2 CRLF after data, 3 trailer lines, 4 done +fn hbdchk cs edit ulong * io edit uchar * d edit uchar * to long +for it ulong 1000000 +st = get cs HCST +if eq st 4 +ret 0 +end +if eq st 1 +ret hbdcdat cs io d +end +r = long 0 +if eq st 0 +r = hbdcsz cs io +end +if eq st 2 +r = hbdccr cs io +end +if eq st 3 +r = hbdctr cs io +end +if lt r 0 +ret r +end +end +ret HEBAD +end +fn hbdcdat cs edit ulong * io edit uchar * d edit uchar * to long +rm = get cs HBREM +k = hmin rm len d +n = ulong 0 +if gt get cs HRLEN get cs HRPOS +n = hbcopy cs io part d 0 k +else +r = hrecvd cs io part d 0 k +if lt r 0 +ret r +end +if eq r 0 +ret HETRUNC +end +n = ulong r +end +put cs HBREM sub rm n +put cs HBGOT add get cs HBGOT n +if eq rm n +put cs HCST 2 +end +ret long n +end +note hfrchk: count n framing bytes (chunk-size lines, CRLF after chunk data, trailer lines and +note the final empty line); more than HFRMAX + 8 * decoded bytes is HEBIG +fn hfrchk cs edit ulong * n ulong to long +f = add get cs HFRM n +put cs HFRM f +if gt f add get cs HFRMAX mul get cs HBGOT 8 +put cs HKEEP 0 +ret HEBIG +end +ret 0 +end +fn hbdcsz cs edit ulong * io edit uchar * to long +x = hbline cs io +if lt x 0 +ret x +end +p = get cs HRPOS +v = hchsz view part io p sub ulong x p +if lt v 0 +ret v +end +put cs HRPOS add ulong x 2 +r = hfrchk cs sub add ulong x 2 p +if lt r 0 +ret r +end +if eq v 0 +put cs HCST 3 +ret 0 +end +if gt add get cs HBGOT ulong v get cs HBCAP +put cs HKEEP 0 +ret HEBIG +end +put cs HBREM ulong v +put cs HCST 1 +ret 0 +end +fn hbdccr cs edit ulong * io edit uchar * to long +r = hneed cs io 2 +if lt r 0 +ret r +end +p = get cs HRPOS +if or ne get io p 13 ne get io add p 1 10 +ret HEBAD +end +r = hfrchk cs 2 +if lt r 0 +ret r +end +put cs HRPOS add p 2 +put cs HCST 0 +ret 0 +end +fn hbdctr cs edit ulong * io edit uchar * to long +x = hbline cs io +if lt x 0 +ret x +end +p = get cs HRPOS +r = hfrchk cs sub add ulong x 2 p +if lt r 0 +ret r +end +if eq ulong x p +put cs HRPOS add p 2 +put cs HCST 4 +ret 0 +end +co = hfvalid view part io p sub ulong x p +if lt co 0 +ret co +end +put cs HTRN add get cs HTRN 1 +if gt get cs HTRN get cs HHMAX +ret HEHEAD +end +put cs HRPOS add ulong x 2 +ret 0 +end +note hchsz: chunk-size = 1..15 hex digits, then nothing or ';' and field-value bytes (extensions, +note ignored); no whitespace before ';' +fn hchsz a view uchar * to long +n = len a +v = ulong 0 +c = n +for i ulong n +h = hhexv get a i +if eq h 16 +c = i +break +end +if ge i 15 +ret HEBAD +end +v = add mul v 16 h +end +if eq c 0 +ret HEBAD +end +if lt c n +if ne get a c 59 +ret HEBAD +end +if not hvall view part a c sub n c +ret HEBAD +end +end +ret long v +end +note hbline: the CR index of the CRLF line starting at HRPOS (at most HHEADMX bytes), reading more +note as needed +fn hbline cs edit ulong * io edit uchar * to long +for it ulong 1000000 +p = get cs HRPOS +n = get cs HRLEN +lim = hmin n add p get cs HHEADMX +i = add p get cs HBSC +while lt i lim bound 999999 +c = get io i +if eq c 10 +ret HEBAD +end +if eq c 13 +if ge add i 1 n +put cs HBSC sub i p +break +end +if ne get io add i 1 10 +ret HEBAD +end +put cs HBSC 0 +ret long i +end +i = add i 1 +end +put cs HBSC sub i p +if ge sub n p get cs HHEADMX +ret HEHEAD +end +r = hmore cs io +if lt r 0 +ret r +end +end +ret HEHEAD +end +note hcompact: move unread body bytes down to HHEND (the head stays in place) +fn hcompact cs edit ulong * io edit uchar * to void +b = get cs HHEND +p = get cs HRPOS +if gt p b +n = get cs HRLEN +hmove io b p sub n p +put cs HRLEN sub n sub p b +put cs HRPOS b +end +end +fn hmore cs edit ulong * io edit uchar * to long +hcompact cs io +n = get cs HRLEN +cap = get cs HRCAP +if ge n cap +ret HEHEAD +end +k = hrecvio cs io n sub cap n +if lt k 0 +ret k +end +if eq k 0 +ret HETRUNC +end +put cs HRLEN add n ulong k +ret k +end +fn hneed cs edit ulong * io edit uchar * k ulong to long +for it ulong 1000000 +if ge sub get cs HRLEN get cs HRPOS k +ret 0 +end +r = hmore cs io +if lt r 0 +ret r +end +end +ret HETRUNC +end +note hbodyall: the whole body into d; the length, or HEBIG when it does not fit in d +fn hbodyall cs edit ulong * io edit uchar * d edit uchar * to long +pb = new uchar 1 0 +got = ulong 0 +for it ulong 16777216 +if ge got len d +r = hbodyrd cs io pb +if gt r 0 +put cs HKEEP 0 +ret HEBIG +end +if lt r 0 +ret r +end +ret long got +end +r = hbodyrd cs io part d got sub len d got +if lt r 0 +ret r +end +if eq r 0 +ret long got +end +got = add got ulong r +end +ret HEBIG +end +note ======== writing (one write region, flushed to the transport when full or on demand) +note HWMODE 0: raw bytes from HWB. HWMODE 1: chunked body; io[HWB, HWB+10) is reserved for the +note chunk-size line, so a flush sends one chunk without copying. +fn hwreset cs edit ulong * to void +put cs HWLEN 0 +put cs HWMODE 0 +put cs HWBODY 0 +put cs HWDROP 0 +put cs HWOUT 0 +put cs HWCL 0 +put cs HOMODE 0 +end +fn hwcap cs edit ulong * to ulong +if eq get cs HWMODE 1 +ret sub get cs HWCAP 2 +end +ret get cs HWCAP +end +fn hhexpre io edit uchar * b ulong v ulong to ulong +put io add b 8 13 +put io add b 9 10 +i = ulong 8 +x = v +for it ulong 8 +i = sub i 1 +put io add b i hhexd and x 15 +x = shr x 4 +if eq x 0 +ret i +end +end +ret i +end +fn hflush cs edit ulong * io edit uchar * to long +n = get cs HWLEN +b = get cs HWB +if eq get cs HWMODE 1 +if le n 10 +ret 0 +end +s = hhexpre io b sub n 10 +put io add b n 13 +put io add b add n 1 10 +put cs HWLEN 10 +ret hsendio cs io add b s sub add n 2 s +end +if eq n 0 +ret 0 +end +put cs HWLEN 0 +ret hsendio cs io b n +end +note hovercl: n more body bytes would pass the declared Content-Length (mode 0 after hhend) +fn hovercl cs edit ulong * n ulong to bool +if or ne get cs HWBODY 1 ne get cs HOMODE 0 +ret false +end +ret gt add get cs HWOUT n get cs HWCL +end +note hput: append s (body bytes after hhend are framed and counted; dropped for HEAD/204/304). +note A Content-Length body refuses bytes past clen before any is buffered (HEINVAL, closing). +fn hput cs edit ulong * io edit uchar * s view uchar * to long +if eq get cs HWBODY 1 +if hovercl cs len s +put cs HKEEP 0 +ret HEINVAL +end +put cs HWOUT add get cs HWOUT len s +if eq get cs HWDROP 1 +ret 0 +end +end +off = ulong 0 +for it ulong 16777216 +if ge off len s +ret 0 +end +w = get cs HWLEN +if ge w hwcap cs +r = hflush cs io +if lt r 0 +ret r +end +continue +end +k = hmin sub hwcap cs w sub len s off +w = add get cs HWB w +hcopy part io w k view part s off k +put cs HWLEN add get cs HWLEN k +off = add off k +end +ret HEINVAL +end +fn hputb cs edit ulong * io edit uchar * c uchar to long +if eq get cs HWBODY 1 +if hovercl cs 1 +put cs HKEEP 0 +ret HEINVAL +end +put cs HWOUT add get cs HWOUT 1 +if eq get cs HWDROP 1 +ret 0 +end +end +if ge get cs HWLEN hwcap cs +r = hflush cs io +if lt r 0 +ret r +end +end +w = get cs HWLEN +put io add get cs HWB w c +put cs HWLEN add w 1 +ret 0 +end +fn hcrlf cs edit ulong * io edit uchar * to long +r = hputb cs io 13 +ret hfe r hputb cs io 10 +end +fn hdec cs edit ulong * io edit uchar * v ulong to long +d = new uchar 20 0 +i = ulong 20 +x = v +for it ulong 20 +i = sub i 1 +put d i uchar add rem x 10 48 +x = div x 10 +if eq x 0 +break +end +end +ret hput cs io view part d i sub 20 i +end +note hrspst (server): start a response: status line with the standard reason phrase +fn hrspst cs edit ulong * io edit uchar * code ulong to long +if or lt code 100 gt code 599 +ret HEINVAL +end +hwreset cs +put cs HSCODE code +if ge code 200 +put cs HFINAL 1 +end +r = hput cs io hv11 +r = hfe r hputb cs io 32 +r = hfe r hdec cs io code +r = hfe r hputb cs io 32 +r = hfe r hreason cs io code +ret hfe r hcrlf cs io +end +fn hreason cs edit ulong * io edit uchar * code ulong to long +if lt code 300 +ret hreas2 cs io code +end +if lt code 420 +ret hreas4 cs io code +end +ret hreas5 cs io code +end +fn hreas2 cs edit ulong * io edit uchar * code ulong to long +if eq code 100 +ret hput cs io hr100 +end +if eq code 101 +ret hput cs io hr101 +end +if eq code 200 +ret hput cs io hr200 +end +if eq code 201 +ret hput cs io hr201 +end +if eq code 202 +ret hput cs io hr202 +end +if eq code 204 +ret hput cs io hr204 +end +if eq code 206 +ret hput cs io hr206 +end +ret 0 +end +fn hreas4 cs edit ulong * io edit uchar * code ulong to long +if eq code 301 +ret hput cs io hr301 +end +if eq code 302 +ret hput cs io hr302 +end +if eq code 304 +ret hput cs io hr304 +end +if eq code 400 +ret hput cs io hr400 +end +if eq code 401 +ret hput cs io hr401 +end +if eq code 403 +ret hput cs io hr403 +end +if eq code 404 +ret hput cs io hr404 +end +if eq code 405 +ret hput cs io hr405 +end +if eq code 408 +ret hput cs io hr408 +end +if eq code 409 +ret hput cs io hr409 +end +if eq code 411 +ret hput cs io hr411 +end +if eq code 413 +ret hput cs io hr413 +end +if eq code 414 +ret hput cs io hr414 +end +if eq code 415 +ret hput cs io hr415 +end +if eq code 417 +ret hput cs io hr417 +end +ret 0 +end +fn hreas5 cs edit ulong * io edit uchar * code ulong to long +if eq code 422 +ret hput cs io hr422 +end +if eq code 429 +ret hput cs io hr429 +end +if eq code 431 +ret hput cs io hr431 +end +if eq code 500 +ret hput cs io hr500 +end +if eq code 501 +ret hput cs io hr501 +end +if eq code 502 +ret hput cs io hr502 +end +if eq code 503 +ret hput cs io hr503 +end +if eq code 504 +ret hput cs io hr504 +end +if eq code 505 +ret hput cs io hr505 +end +ret 0 +end +note hreqst + hreqtg (client): request line `m SP t SP HTTP/1.1`; HEAD is remembered for framing +fn hreqst cs edit ulong * io edit uchar * m view uchar * to long +if not htok m +ret HEINVAL +end +hwreset cs +hsetdl cs long get cs HBDLV +put cs HISHEAD 0 +if heq m hmhead +put cs HISHEAD 1 +end +put cs HNMSG add get cs HNMSG 1 +r = hput cs io m +ret hfe r hputb cs io 32 +end +fn hreqtg cs edit ulong * io edit uchar * t view uchar * to long +if not htarg t +ret HEINVAL +end +r = hput cs io t +r = hfe r hputb cs io 32 +r = hfe r hput cs io hv11 +ret hfe r hcrlf cs io +end +note hhname + hhval / hhnum: one header field. Framing fields (Content-Length, +note Transfer-Encoding, Connection) are refused: hhend writes them. Values must be field-value +note bytes without leading or trailing whitespace (no CR, LF or NUL: no header injection). +fn hhname cs edit ulong * io edit uchar * nm view uchar * to long +if not htok nm +ret HEINVAL +end +if or or hieqm nm hnclen hieqm nm hnte hieqm nm hnconn +ret HEINVAL +end +r = hput cs io nm +r = hfe r hputb cs io 58 +ret hfe r hputb cs io 32 +end +fn hhval cs edit ulong * io edit uchar * v view uchar * to long +n = len v +if not hvall v +ret HEINVAL +end +if gt n 0 +if or hws get v 0 hws get v sub n 1 +ret HEINVAL +end +end +r = hput cs io v +ret hfe r hcrlf cs io +end +fn hhnum cs edit ulong * io edit uchar * v ulong to long +r = hdec cs io v +ret hfe r hcrlf cs io +end +note hhend: framing and the end of the head. mode 0 = Content-Length clen, 1 = chunked, +note 2 = close-delimited (server only). A server answering HTTP/1.0 turns chunked into 2; 1xx, +note 204 and 304 get no framing field and no body; a HEAD response keeps its framing fields and +note drops the body bytes. put cs HKEEP 0 before hhend to close after this message. +fn hhend cs edit ulong * io edit uchar * mode ulong clen ulong to long +if gt mode 2 +ret HEINVAL +end +srv = eq get cs HSERVER 1 +m = mode +nob = false +if srv +s = get cs HSCODE +if or or lt s 200 eq s 204 eq s 304 +nob = true +end +if and eq m 1 eq get cs HVER 0 +m = 2 +end +else +if eq m 2 +ret HEINVAL +end +end +r = long 0 +if nob +m = 0 +else +r = hhfram cs io m clen +end +if eq m 2 +put cs HKEEP 0 +end +if eq get cs HKEEP 0 +r = hfe r hput cs io hocls +r = hfe r hcrlf cs io +end +r = hfe r hcrlf cs io +if lt r 0 +ret r +end +put cs HOMODE m +put cs HWCL clen +put cs HWBODY 1 +put cs HWOUT 0 +if or nob and srv eq get cs HISHEAD 1 +put cs HWDROP 1 +end +if and eq m 1 eq get cs HWDROP 0 +r = hflush cs io +put cs HWMODE 1 +put cs HWLEN 10 +end +ret r +end +fn hhfram cs edit ulong * io edit uchar * m ulong clen ulong to long +if eq m 1 +r = hput cs io hote +ret hfe r hcrlf cs io +end +if eq m 0 +if or gt clen 0 eq get cs HSERVER 1 +r = hput cs io hoclen +r = hfe r hdec cs io clen +ret hfe r hcrlf cs io +end +end +ret 0 +end +note hwfin: flush, end the chunked body, check a Content-Length body was exactly clen bytes +fn hwfin cs edit ulong * io edit uchar * to long +r = hflush cs io +if lt r 0 +put cs HKEEP 0 +ret r +end +drop = eq get cs HWDROP 1 +m = get cs HOMODE +put cs HWBODY 0 +put cs HWMODE 0 +put cs HWLEN 0 +if and eq m 1 not drop +b = get cs HWB +put io b 48 +put io add b 1 13 +put io add b 2 10 +put io add b 3 13 +put io add b 4 10 +r = hsendio cs io b 5 +end +if and eq m 0 not drop +if ne get cs HWOUT get cs HWCL +put cs HKEEP 0 +ret HEINVAL +end +end +if eq get cs HSERVER 1 +put cs HNMSG add get cs HNMSG 1 +end +if lt r 0 +put cs HKEEP 0 +end +ret r +end +note hreject: answer a failed hreqrd result r. HEBAD .. HEVER answer with that status, HETIME +note with 408; any other value (peer gone, socket error) sends nothing. The connection must +note then be closed (HKEEP is 0). Returns the send result or 0. +fn hreject cs edit ulong * io edit uchar * r long to long +put cs HKEEP 0 +if eq r HETIME +ret hrsperr cs io 408 +end +if or eq r HEBAD eq r HEBIG +ret hrsperr cs io ulong neg r +end +if or or eq r HEHEAD eq r HEEXP or eq r HETE eq r HEVER +ret hrsperr cs io ulong neg r +end +ret 0 +end +note hrsperr: a complete empty error response that closes the connection +fn hrsperr cs edit ulong * io edit uchar * code ulong to long +put cs HKEEP 0 +ret hrspempty cs io code +end +note hrspempty: a complete response with an empty body; the connection stays reusable when +note the request allowed it (hnext still closes when the request body was left unread) +fn hrspempty cs edit ulong * io edit uchar * code ulong to long +r = hrspst cs io code +r = hfe r hhend cs io 0 0 +ret hfe r hwfin cs io +end +note hnext: 1 when the connection may carry another message (keep-alive, body fully read, +note response finished, under HMAXMSG), else 0: the caller closes it +fn hnext cs edit ulong * io edit uchar * to long +if eq get cs HKEEP 0 +ret 0 +end +if eq get cs HWBODY 1 +ret 0 +end +m = get cs HBMODE +if and eq m 1 ne get cs HBREM 0 +ret 0 +end +if and eq m 2 ne get cs HCST 4 +ret 0 +end +if eq m 3 +ret 0 +end +if ge get cs HNMSG get cs HMAXMSG +ret 0 +end +ret 1 +end +note ======== server-sent events: writing (one event per chunk) +fn hrspsse cs edit ulong * io edit uchar * to long +r = hrspst cs io 200 +r = hfe r hhname cs io hoctype +r = hfe r hhval cs io hvevst +r = hfe r hhname cs io hocache +r = hfe r hhval cs io hvnoca +ret hfe r hhend cs io 1 0 +end +fn hsseok a view uchar * to bool +n = len a +for i ulong n +c = get a i +if or or eq c 10 eq c 13 eq c 0 +ret false +end +end +ret true +end +fn hsseln1 cs edit ulong * io edit uchar * v view uchar * to long +r = hput cs io v +ret hfe r hputb cs io 10 +end +fn hsseevt cs edit ulong * io edit uchar * v view uchar * to long +if not hsseok v +ret HEINVAL +end +r = hput cs io hsevent +ret hfe r hsseln1 cs io v +end +fn hsseid cs edit ulong * io edit uchar * v view uchar * to long +if not hsseok v +ret HEINVAL +end +r = hput cs io hsid +ret hfe r hsseln1 cs io v +end +fn hsseret cs edit ulong * io edit uchar * v view uchar * to long +if not hdigits v +ret HEINVAL +end +r = hput cs io hsretry +ret hfe r hsseln1 cs io v +end +fn hssecmt cs edit ulong * io edit uchar * v view uchar * to long +if not hsseok v +ret HEINVAL +end +r = hputb cs io 58 +r = hfe r hputb cs io 32 +ret hfe r hsseln1 cs io v +end +note hlnend: index of the first CR or LF in a at or after p, or len a +fn hlnend a view uchar * p ulong to ulong +n = len a +for b ulong 65536 +s = add p mul b 65536 +if ge s n +ret n +end +m = hmin sub n s 65536 +for i ulong m +c = get a add s i +if or eq c 10 eq c 13 +ret add s i +end +end +end +ret n +end +note hssedat: one `data: ` line per line of v (CR, LF and CRLF all end a line) +fn hssedat cs edit ulong * io edit uchar * v view uchar * to long +n = len v +p = ulong 0 +r = long 0 +for it ulong 16777216 +q = hlnend v p +r = hfe r hput cs io hsdata +r = hfe r hput cs io view part v p sub q p +r = hfe r hputb cs io 10 +if ge q n +ret r +end +p = add q 1 +if eq get v q 13 +if lt p n +if eq get v p 10 +p = add p 1 +end +end +end +end +ret r +end +fn hsseend cs edit ulong * io edit uchar * to long +r = hputb cs io 10 +ret hfe r hflush cs io +end +note ======== server-sent events: incremental reader (WHATWG HTML 9.2.6) +fn hsseinit ss edit ulong * to long +if lt len ss HSSLEN +ret HEINVAL +end +for i ulong HSSLEN +put ss i 0 +end +ret 0 +end +note hssefeed: consume src; returns the bytes consumed. When an event completes it stops right +note after the dispatching line with get ss HSRDY = 1: type lb[0, HSELEN) (empty = message), +note id lb[64, 64+HSILEN), data lb[128, 128+HSDLEN). Call hssenext, then feed the rest. +fn hssefeed ss edit ulong * lb edit uchar * src view uchar * to long +if ne get ss HSRDY 0 +ret HEINVAL +end +if lt len lb 256 +ret HEINVAL +end +n = len src +i = ulong 0 +for it ulong 4194304 +if ge i n +ret long n +end +r = hssebyte ss lb get src i +i = add i 1 +if lt r 0 +ret r +end +if gt r 0 +ret long i +end +end +ret long i +end +note hssebyte: one stream byte; 1 = an event is ready, 0 = continue, negative = error +fn hssebyte ss edit ulong * lb edit uchar * c uchar to long +if eq c 10 +if eq get ss HSCR 1 +put ss HSCR 0 +ret 0 +end +ret hssleol ss lb +end +put ss HSCR 0 +if eq c 13 +put ss HSCR 1 +ret hssleol ss lb +end +w = add add HSDB get ss HSDLEN get ss HSLINE +if ge w len lb +ret HEBIG +end +put lb w c +put ss HSLINE add get ss HSLINE 1 +ret 0 +end +fn hssleol ss edit ulong * lb edit uchar * to long +r = hsseline ss lb +if lt r 0 +ret r +end +if ne get ss HSRDY 0 +ret 1 +end +ret 0 +end +fn hssenext ss edit ulong * to void +put ss HSRDY 0 +put ss HSDLEN 0 +put ss HSELEN 0 +end +fn hssedis ss edit ulong * to long +n = get ss HSDLEN +if eq n 0 +put ss HSELEN 0 +ret 0 +end +put ss HSDLEN sub n 1 +put ss HSRDY 1 +put ss HSNEV add get ss HSNEV 1 +ret 0 +end +note hssebom: strip one U+FEFF (EF BB BF) from the first line of the stream; the new length +fn hssebom ss edit ulong * lb edit uchar * s ulong l ulong to ulong +if ne get ss HSBOM 0 +ret l +end +put ss HSBOM 1 +if lt l 3 +ret l +end +if and and eq get lb s 239 eq get lb add s 1 187 eq get lb add s 2 191 +hmove lb s add s 3 sub l 3 +ret sub l 3 +end +ret l +end +fn hsseline ss edit ulong * lb edit uchar * to long +s = add HSDB get ss HSDLEN +l = hssebom ss lb s get ss HSLINE +put ss HSLINE 0 +if eq l 0 +ret hssedis ss +end +c = l +for i ulong l +if eq get lb add s i 58 +c = i +break +end +end +if eq c 0 +ret 0 +end +vo = c +if lt c l +vo = add c 1 +if lt vo l +if eq get lb add s vo 32 +vo = add vo 1 +end +end +end +put ss HSVO vo +put ss HSVL sub l vo +ret hssefv ss lb s c +end +note hssefv: apply field lb[s, s+c) with value lb[s+vo, s+vo+vl), vo and vl from ss +fn hssefv ss edit ulong * lb edit uchar * s ulong c ulong to long +vo = get ss HSVO +vl = get ss HSVL +if heq view part lb s c hfdata +hmove lb s add s vo vl +put lb add s vl 10 +put ss HSDLEN add get ss HSDLEN add vl 1 +ret 0 +end +if heq view part lb s c hfevent +if gt vl HSFCAP +ret HEHEAD +end +hmove lb 0 add s vo vl +put ss HSELEN vl +ret 0 +end +if heq view part lb s c hfid +if not hsseok view part lb add s vo vl +ret 0 +end +if gt vl HSFCAP +ret HEHEAD +end +hmove lb HSIDB add s vo vl +put ss HSILEN vl +ret 0 +end +if heq view part lb s c hfretry +if hdigits view part lb add s vo vl +put ss HSRETRY hdecv view part lb add s vo vl +end +end +ret 0 +end diff --git a/seed/net/http-linux.om b/seed/net/http-linux.om new file mode 100644 index 000000000..5292802b6 --- /dev/null +++ b/seed/net/http-linux.om @@ -0,0 +1,94 @@ +note Linux transport for http-core.om. http.om is the byte-for-byte concatenation of these units. +note htrecv/htsend are nonblocking: count, EOF, or negative errno. htwait takes nanoseconds. +fn htclock to long +ret monons +end +fn htwait fd int ev int iv long to long +ret waitio fd ev iv +end +fn htrecv fd int io edit uchar * off ulong n ulong to long +ret recv fd io off n 64 +end +fn htsend fd int io view uchar * off ulong n ulong to long +ret send fd io off n 64 +end +fn htclose fd int to long +ret fclose fd +end +fn hnodel fd int to long +one = new uchar 4 0 +put one 0 1 +ret sockopt fd 6 1 one 0 4 +end +note hlisten: socket, SO_REUSEADDR, bind a (exactly the sockaddr bytes), listen, and write the +note bound address back into a (so port 0 reports the ephemeral port). Returns the listening fd. +fn hlisten a edit uchar * backlog int to long +one = new uchar 4 0 +put one 0 1 +fd = socknew hfam a 526337 0 +if lt fd 0 +ret fd +end +r = sockopt int fd 1 2 one 0 4 +if eq r 0 +r = bind int fd a 0 len a +end +if eq r 0 +r = listen int fd backlog +end +if eq r 0 +k = sockname int fd a 0 len a +if lt k 0 +r = k +end +end +if ne r 0 +c = fclose int fd +ret r +end +ret fd +end +note haccept: wait at most tmo ns (negative = forever) for a connection; returns its fd +fn haccept lfd int tmo long to long +w = waitio lfd 1 tmo +if eq w 0 +ret HETIME +end +if lt w 0 +ret w +end +c = accept lfd 526336 +if lt c 0 +ret c +end +q = hnodel int c +ret c +end +note hdial: nonblocking connect bounded by tmo ns; returns the connected fd or closes it +fn hdial a view uchar * tmo long to long +fd = socknew hfam a 526337 0 +if lt fd 0 +ret fd +end +r = connect int fd a 0 len a +if eq r -115 +w = waitio int fd 4 tmo +if le w 0 +c = fclose int fd +if eq w 0 +ret HETIME +end +ret w +end +r = connect int fd a 0 len a +if eq r -106 +r = 0 +end +end +if ne r 0 +c = fclose int fd +ret r +end +q = hnodel int fd +ret fd +end diff --git a/seed/net/http.om b/seed/net/http.om index 4f7eb7846..54e97c949 100644 --- a/seed/net/http.om +++ b/seed/net/http.om @@ -1,4 +1,4 @@ -note seed/net/http.om -- bounded HTTP/1.1 server and client in seeded Omega (omega-mv #788). +note seed/net/http-core.om -- bounded HTTP/1.1 server and client in seeded Omega (omega-mv #788). note Library unit: it has no `om2` line, no `fn main` and no globals. An application composes note { printf 'om2\n'; cat seed/net/http.om app.om; } | omc note (JSON users add seed/json/json.om in the same cat). Names: functions h*, consts H*, texts h*. @@ -363,7 +363,7 @@ iv = long get cs HIDLE end dl = get cs HDL if ne dl 0 -now = ulong monons +now = ulong htclock if ge now dl ret HETIME end @@ -372,7 +372,7 @@ if or lt iv 0 lt rm iv iv = rm end end -r = waitio fd ev iv +r = htwait fd ev iv if eq r 0 ret HETIME end @@ -392,7 +392,7 @@ ret htlsrecv cs io off n end fd = int get cs HFD for it ulong 4096 -r = recv fd io off n 64 +r = htrecv fd io off n if eq r -11 w = hwait cs 1 if lt w 0 @@ -416,7 +416,7 @@ ret htlsrecvd cs io d end fd = int get cs HFD for it ulong 4096 -r = recv fd d 0 len d 64 +r = htrecv fd d 0 len d if eq r -11 w = hwait cs 1 if lt w 0 @@ -445,7 +445,7 @@ for it ulong 4194304 if ge p e ret 0 end -r = send fd io p sub e p 64 +r = htsend fd io p sub e p if gt r 0 p = add p ulong r continue @@ -551,20 +551,20 @@ fn hbdl cs edit ulong * to ulong if eq get cs HBDLV 0 ret 0 end -ret add ulong monons get cs HBDLV +ret add ulong htclock get cs HBDLV end note hsetdl: absolute deadline now + iv for the following body reads and writes (0 clears) fn hsetdl cs edit ulong * iv long to void put cs HDL 0 if gt iv 0 -put cs HDL add ulong monons ulong iv +put cs HDL add ulong htclock ulong iv end end fn hclose cs edit ulong * to long if eq get cs HOPEN 1 put cs HOPEN 0 put cs HKEEP 0 -ret fclose int get cs HFD +ret htclose int get cs HFD end ret 0 end @@ -607,83 +607,6 @@ end fn hfam a view uchar * to int ret int or ulong get a 0 shl ulong get a 1 8 end -fn hnodel fd int to long -one = new uchar 4 0 -put one 0 1 -ret sockopt fd 6 1 one 0 4 -end -note hlisten: socket, SO_REUSEADDR, bind a (exactly the sockaddr bytes), listen, and write the -note bound address back into a (so port 0 reports the ephemeral port). Returns the listening fd. -fn hlisten a edit uchar * backlog int to long -one = new uchar 4 0 -put one 0 1 -fd = socknew hfam a 526337 0 -if lt fd 0 -ret fd -end -r = sockopt int fd 1 2 one 0 4 -if eq r 0 -r = bind int fd a 0 len a -end -if eq r 0 -r = listen int fd backlog -end -if eq r 0 -k = sockname int fd a 0 len a -if lt k 0 -r = k -end -end -if ne r 0 -c = fclose int fd -ret r -end -ret fd -end -note haccept: wait at most tmo ns (negative = forever) for a connection; returns its fd -fn haccept lfd int tmo long to long -w = waitio lfd 1 tmo -if eq w 0 -ret HETIME -end -if lt w 0 -ret w -end -c = accept lfd 526336 -if lt c 0 -ret c -end -q = hnodel int c -ret c -end -note hdial: nonblocking connect bounded by tmo ns; returns the connected fd or closes it -fn hdial a view uchar * tmo long to long -fd = socknew hfam a 526337 0 -if lt fd 0 -ret fd -end -r = connect int fd a 0 len a -if eq r -115 -w = waitio int fd 4 tmo -if le w 0 -c = fclose int fd -if eq w 0 -ret HETIME -end -ret w -end -r = connect int fd a 0 len a -if eq r -106 -r = 0 -end -end -if ne r 0 -c = fclose int fd -ret r -end -q = hnodel int fd -ret fd -end note ======== reading a message head note hbegin: drop the consumed bytes of the previous message, reset per-message state, arm the note head deadline @@ -726,7 +649,7 @@ put cs HFRM 0 put cs HBSC 0 put cs HDL 0 if ne get cs HHDLV 0 -put cs HDL add ulong monons get cs HHDLV +put cs HDL add ulong htclock get cs HHDLV end end note hskipcr: a server ignores empty lines (CRLF) before a request line (RFC 9112 2.2) @@ -2466,3 +2389,97 @@ end end ret 0 end +note Linux transport for http-core.om. http.om is the byte-for-byte concatenation of these units. +note htrecv/htsend are nonblocking: count, EOF, or negative errno. htwait takes nanoseconds. +fn htclock to long +ret monons +end +fn htwait fd int ev int iv long to long +ret waitio fd ev iv +end +fn htrecv fd int io edit uchar * off ulong n ulong to long +ret recv fd io off n 64 +end +fn htsend fd int io view uchar * off ulong n ulong to long +ret send fd io off n 64 +end +fn htclose fd int to long +ret fclose fd +end +fn hnodel fd int to long +one = new uchar 4 0 +put one 0 1 +ret sockopt fd 6 1 one 0 4 +end +note hlisten: socket, SO_REUSEADDR, bind a (exactly the sockaddr bytes), listen, and write the +note bound address back into a (so port 0 reports the ephemeral port). Returns the listening fd. +fn hlisten a edit uchar * backlog int to long +one = new uchar 4 0 +put one 0 1 +fd = socknew hfam a 526337 0 +if lt fd 0 +ret fd +end +r = sockopt int fd 1 2 one 0 4 +if eq r 0 +r = bind int fd a 0 len a +end +if eq r 0 +r = listen int fd backlog +end +if eq r 0 +k = sockname int fd a 0 len a +if lt k 0 +r = k +end +end +if ne r 0 +c = fclose int fd +ret r +end +ret fd +end +note haccept: wait at most tmo ns (negative = forever) for a connection; returns its fd +fn haccept lfd int tmo long to long +w = waitio lfd 1 tmo +if eq w 0 +ret HETIME +end +if lt w 0 +ret w +end +c = accept lfd 526336 +if lt c 0 +ret c +end +q = hnodel int c +ret c +end +note hdial: nonblocking connect bounded by tmo ns; returns the connected fd or closes it +fn hdial a view uchar * tmo long to long +fd = socknew hfam a 526337 0 +if lt fd 0 +ret fd +end +r = connect int fd a 0 len a +if eq r -115 +w = waitio int fd 4 tmo +if le w 0 +c = fclose int fd +if eq w 0 +ret HETIME +end +ret w +end +r = connect int fd a 0 len a +if eq r -106 +r = 0 +end +end +if ne r 0 +c = fclose int fd +ret r +end +q = hnodel int fd +ret fd +end diff --git a/seed/net/tests/check.py b/seed/net/tests/check.py index ea69cf79b..2194cf006 100755 --- a/seed/net/tests/check.py +++ b/seed/net/tests/check.py @@ -806,8 +806,8 @@ def stage_live(omc, work, lib_src, log): LIVE_MUTANTS = [ - ("head deadline never armed", "put cs HDL add ulong monons get cs HHDLV", "put cs HDL 0"), - ("hclose leaks the descriptor", "ret fclose int get cs HFD", "ret 0"), + ("head deadline never armed", "put cs HDL add ulong htclock get cs HHDLV", "put cs HDL 0"), + ("hclose leaks the descriptor", "ret htclose int get cs HFD", "ret 0"), ("SSE data CR not a line break", "if eq get v q 13", "if eq get v q 14"), ("chunk-size digit mask", "put io add b i hhexd and x 15", "put io add b i hhexd and x 7"), ("F1 no body deadline after the head", "put cs HDL hbdl cs", "put cs HDL 0"), @@ -1484,6 +1484,7 @@ def main(): print("NOT_RUN: no compiler at %s" % omc) return 3 http_src = open(LIB, "rb").read() + assert http_src == open(os.path.join(NET, "http-core.om"), "rb").read() + open(os.path.join(NET, "http-linux.om"), "rb").read(), "stale HTTP compatibility unit" notls_src = open(NOTLS, "rb").read() lib_src = http_src + notls_src work = keep or tempfile.mkdtemp(prefix="http-check-") diff --git a/seed/omc/gate18.sh b/seed/omc/gate18.sh index f0b476b8a..e878abe8e 100755 --- a/seed/omc/gate18.sh +++ b/seed/omc/gate18.sh @@ -3,7 +3,7 @@ # must reproduce the committed keyword chain: every literal pack/id pair, plus the two computed entries # readlnk (133) and sockopt (134). This catches list drift and awk precision regressions (packs above # 2^53 are printed with decimal string arithmetic, not doubles). The one target-scoped entry, efi (178) -# under `target x86efi` only, is not generated; it must appear exactly once in its fixed form. +# under the two EFI targets only, is not generated; its complete condition is checked below. set -eu R=$(CDPATH= cd -- "$(dirname "$0")/../.." && pwd) cd "$R" @@ -18,14 +18,15 @@ awk -f seed/omc/genkw.awk > "$T/gen" awk ' /^fn kw /{inkw=1; next} inkw && /^if eq w /{p=$4; next} - inkw && /^if and eq w /{p=$5 " target=" $NF; next} + inkw && /^if and eq w /{p=$5 " scoped"; next} inkw && /^ret /{ if ($2 == 0) { inkw=0; exit } if ($2 != 133 && $2 != 134) print $2, p } ' seed/omc/omc.om | sort -n > "$T/all.pairs" [ "$(grep -c '^178 ' "$T/all.pairs")" = 1 ] || bad "committed chain must hold efi (178) exactly once" -grep -qx '178 6907493 target=2' "$T/all.pairs" || bad "efi (178) must be scoped to x86efi (xtarget 2)" +grep -qx '178 6907493 scoped' "$T/all.pairs" || bad "efi (178) must remain target-scoped" +grep -qx 'if and eq w 6907493 or eq get xtarget 0 2 ne get atarget 0 0' seed/omc/omc.om || bad "efi (178) must be scoped to x86efi or aarch64efi only" grep -v '^178 ' "$T/all.pairs" > "$T/chain.pairs" awk ' @@ -38,7 +39,7 @@ cmp -s "$T/chain.pairs" "$T/gen.pairs" || { bad "generated keyword packs differ from the committed chain" } n=$(wc -l < "$T/gen.pairs") -[ "$n" = 168 ] || bad "compared $n literal pairs, wanted 168" +[ "$n" = 170 ] || bad "compared $n literal pairs, wanted 170" grep -q '^ret 133$' seed/omc/omc.om || bad "committed chain lacks readlnk (133)" grep -q '^ret 134$' seed/omc/omc.om || bad "committed chain lacks sockopt (134)" @@ -49,5 +50,5 @@ grep -q 'peername:224' seed/omc/genkw.awk || bad "generator lacks peername:224" grep -q '^ret 227$' seed/omc/omc.om || bad "committed chain lacks fma (227)" grep -q 'fma:227' seed/omc/genkw.awk || bad "generator lacks fma:227" -printf 'PASS gate18 168 literal packs, both computed entries and the x86efi-scoped efi entry match the committed chain\n' +printf 'PASS gate18 170 literal packs, both computed entries and the two-target EFI entry match the committed chain\n' exit 0 diff --git a/seed/omc/genkw.awk b/seed/omc/genkw.awk index 19976be2b..d2bf344d8 100644 --- a/seed/omc/genkw.awk +++ b/seed/omc/genkw.awk @@ -16,6 +16,6 @@ BEGIN{ for(i=32;i<127;i++) ORD=ORD sprintf("%c",i) n=split("bool:1 uchar:2 u8:2 ushort:3 u16:3 uint:4 u32:4 ulong:5 u64:5 byte:6 i8:6 short:7 i16:7 int:8 i32:8 long:9 i64:9 add:33 sub:34 mul:35 div:36 rem:37 and:38 or:39 xor:40 shl:41 shr:42 eq:43 ne:44 lt:45 le:46 gt:47 ge:48 neg:49 not:50 get:51 len:52 read:53 write:54 true:55 false:56 view:57 edit:58 fn:64 to:65 end:66 if:67 else:68 while:69 bound:70 for:71 ret:72 =:73 (:74 ):75 void:76 global:78 text:79 put:80 free:81 exit:82 note:83 new:84 struct:85 break:86 trap:87 own:77 f32:88 f64:89 bitcast:90 fsqrt:91 fabs:92 fmin:93 fmax:94 sizeof:95 offsetof:96 continue:97 fclose:100 fsync:101 fchmod:102 fseek:103 socknew:104 listen:105 accept:106 fork:107 dupfd:108 monons:109 fopen:110 unlink:111 makedir:112 getdnts:113 connect:114 bind:115 waitpid:116 fstat:117 recv:118 send:119 sleepns:120 argcnt:121 argread:122 waitio:123 execprog:124 renames:125 rmdir:126 killpid:127 pipefds:128 getpid:129 realns:130 sockname:131 cwd:132 readlnk:133 sockopt:134 random:135 envcnt:136 envread:137 chdir:138 ftrunc:139 stat:140 link:141 symlnk:142 chmod:143 faccess:144 getuid:145 geteuid:146 getgid:147 getegid:148 lstat:149 truncate:150 chown:151 const:152 fchdir:153 getppid:154 umask:155 fdsync:156 memfd:157 setsid:158 getpgid:159 setpgid:160 pread:161 pwrite:162 getsid:163 syncfs:164 shutdown:165 devctl:166 mapnew:167 mapdrop:168 mapread:169 mapwrite:170 devcall:171 uvmctl:172 mapaddr:173 mapget:174 mapset:175 maphold:176 mapbind:177 flock:197 execpure:198", a, " ") for(k=1;k<=n;k++){ split(a[k],p,":"); printf "if eq w %s\nret %d\nend\n", pack(p[1]), p[2] } - n=split("peercred:220 pollfds:221 sendmsg:222 qty:223 cpufence:199 cpurelax:200 peername:224 fma:227 vfioctl:228 vfiomap:229 vfiomapw:230 eventfd:231 vfioirq:232", a, " ") + n=split("peercred:220 pollfds:221 sendmsg:222 qty:223 cpufence:199 cpurelax:200 peername:224 fma:227 vfioctl:228 vfiomap:229 vfiomapw:230 eventfd:231 vfioirq:232 vmadd2:233 vdot4:234", a, " ") for(k=1;k<=n;k++){ split(a[k],p,":"); printf "if eq w %s\nret %d\nend\n", pack(p[1]), p[2] } } diff --git a/seed/omc/omc.om b/seed/omc/omc.om index d7abbd25e..7b9a318fb 100644 --- a/seed/omc/omc.om +++ b/seed/omc/omc.om @@ -138,6 +138,8 @@ global fn_off ulong 4096 note x86 Linux retains the parser's sixteen logical slots in each native frame. note No A64 instruction may pass emit once the explicit target is selected (error 25). global xtarget ulong 1 +note ARM firmware keeps the existing ARM instruction selector; only addresses, ABI and effects differ. +global atarget ulong 1 global xnaddr ulong 1 global xasite ulong 65536 global xavalue ulong 65536 @@ -839,7 +841,13 @@ note ======== keyword lookup (original om4 KWTAB plus native host words 100..177 note genkw.awk describes the original om4 table only; retain the native host extension on regeneration. note efi (178) is a keyword only under `target x86efi`; gate18 checks that scoped entry separately. fn kw w ulong to ulong -if and eq w 6907493 eq get xtarget 0 2 +if eq w 225291756662 +ret 234 +end +if eq w 55406762225014 +ret 233 +end +if and eq w 6907493 or eq get xtarget 0 2 ne get atarget 0 0 ret 178 end if eq w 7310034270740117605 @@ -5023,7 +5031,11 @@ if ne get xtarget 0 0 xarg t k v ret end -if or or eq k 3 eq k 6 eq k 7 +if eq k 6 +mataddr t v +ret +end +if or eq k 3 eq k 7 matconst t v ret end @@ -5162,7 +5174,7 @@ end put ea_i 0 x if ge get nm_kind i 4 b = alloc -matconst b get nm_addr i +mataddr b get nm_addr i put ea_b 0 b else put ea_b 0 ulong get nm_reg i @@ -5359,7 +5371,7 @@ trapc 8 3 b = ulong get nm_reg i if eq get nm_kind i 5 b = alloc -matconst b get nm_addr i +mataddr b get nm_addr i end emit or or or or 2332033024 shl ro 16 shl tlog ulong get nm_type i 10 shl b 5 d ret d @@ -5624,6 +5636,9 @@ end note vs_call: save the registers in use, X0 = fd, X1 = A + off (ADD through X16, C6.2.6), X2 = n, X8 = 63 note (read) or 64 (write) (MOVZ C6.2.285), SVC #0 (C6.2.466). om4 VT_SYS. fn vs_call c ulong fk ulong fv ulong e ulong ro ulong rn ulong to void +if ne get atarget 0 0 +fail 25 +end if ne get xtarget 0 0 xio c fk fv e ro rn ret @@ -7530,6 +7545,9 @@ end end fn hostval c ulong dst ulong to void +if ne get atarget 0 0 +fail 25 +end if eq get xtarget 0 1 if and ge c 228 le c 232 if eq get progmode 0 0 @@ -10482,9 +10500,15 @@ emit 4181723376 emit 3592356352 else emit 2432798752 +if ne get atarget 0 0 +matconst 16 9223372036854775808 +e3 2852126720 0 0 16 +af 6 0 0 +else emit 3531606952 emit 3556769793 end +end code = ulong 1 while le code 14 st = ulong 0 @@ -10652,6 +10676,10 @@ note LSL 16; MOV SP, X16 (ADD immediate, C6.2.5); BL main (C6.2.43); [MOVZ X0, # note #93; SVC #0. The entry word after the header is a B to it; the header gets the file and pool sizes. note om4 EOF_PROG. fn eof_prog to void +if ne get atarget 0 0 +af 0 0 0 +ret +end if ne get xtarget 0 0 xeof ret @@ -10998,6 +11026,14 @@ if eq c 72 s_ret ret 0 end +if eq c 234 +sdot4 +ret 0 +end +if eq c 233 +smadd2 +ret 0 +end if eq c 80 s_put ret 0 @@ -11014,9 +11050,13 @@ if ne get xtarget 0 0 xload 0 0 xleave else +if ne get atarget 0 0 +af 6 0 0 +else emit 3531606952 emit 3556769793 end +end dead1 eol ret 0 @@ -14712,6 +14752,12 @@ put oc 0 180 else put oc 0 add 176 shl get nexp 0 2 end +if ne get atarget 0 0 +if eq get progmode 0 0 +fail 25 +end +put oc 0 520 +end if ne get xtarget 0 0 put oc 0 512 if eq get xtarget 0 2 @@ -16760,6 +16806,18 @@ end note Typed addresses carry origin through fixup records. Numeric constants never relocate. fn mataddr r ulong v ulong to void +if ne get atarget 0 0 +n = get xnaddr 0 +if ge n 65536 +fail 14 +end +put xasite n get oc 0 +put xavalue n v +put xnaddr 0 add n 1 +emit or 2415919104 r +emit or or 2432696320 r shl r 5 +ret +end if eq get xtarget 0 0 matconst r v ret @@ -17068,9 +17126,19 @@ else if and eq get tw 0 115888505632888 eq get tl 0 6 put xtarget 0 2 else +if and eq get tw 0 7292513518592614753 eq get tl 0 10 +if ne get inp add get ts 0 8 102 +fail 25 +end +if ne get inp add get ts 0 9 105 +fail 25 +end +put atarget 0 1 +else fail 25 end end +end eol p = ulong 0 while lt p get cur 0 @@ -17604,6 +17672,33 @@ wrword 404 3221225600 end fn xefival dst ulong to void +if ne get atarget 0 0 +x = mul get depth 0 32 +put fr add x 7 get nslot 0 +op = lenval 4 +if gt op 15 +fail 25 +end +harg x 2 5 +e = harray x 1 +save +hload x 2 19 +basearg 20 e +loadarg 16 1 get fr add x 21 +e3 2332033024 20 20 16 +loadarg 21 1 get fr add x 22 +note Reserve firmware call space, checking the floor before returning SP to the save frame. +spsub 65536 +stkchk +spadd 65536 +put xenerr 0 0 +put xenend 0 0 +aop op +af 5 0 0 +r = restore dst get fr add x 7 get svn 0 get sva 0 1 +vdone 1 r 5 +ret +end if ne get xtarget 0 2 fail 25 end @@ -18870,3 +18965,1159 @@ xp 2 0 2328 end + +note ARM64 UEFI emission. Firmware calls use AAPCS64. Numeric constants never relocate. +note ae: address/load/store private state, Boot Services call, protocol method call. +fn ae k ulong r ulong off ulong to void +if eq k 5 +note Enumerate bounded SNP candidates, requiring exclusive ownership and Ethernet mode. +ae 1 0 6000 +emit 4043309087 +note cmp x0, #0 +already = get oc 0 +emit 1409286145 +aop 101 +matconst 0 2 +ae 0 1 512 +matconst 2 0 +ae 0 3 6072 +ae 0 4 6064 +ae 3 0 312 +emit 4043309087 +note cmp x0, #0 +af 3 1 3 +ae 1 22 6064 +ae 1 23 6072 +emit 4044358399 +note cmp x23, #1024 +limit = get oc 0 +emit 1409286152 +matconst 24 0 +scan = get oc 0 +emit 3944153887 +note cmp x24, x23 +empty = get oc 0 +emit 1409286146 +aop 101 +emit 4168645337 +note ldr x25, [x22, x24, lsl #3] +ae 2 25 6016 +emit 2853766112 +note mov x0, x25 +ae 0 1 512 +ae 0 2 6000 +ae 1 3 8 +matconst 4 0 +matconst 5 32 +ae 3 0 280 +emit 4043309087 +note cmp x0, #0 +opennet = get oc 0 +emit 1409286144 +matconst 0 0 +ae 2 0 6000 +next = get oc 0 +emit 335544320 +patch19 opennet get oc 0 +beg = get xenerr 0 +ae 1 0 6000 +emit 4181736475 +note ldr x27, [x0, #120] +emit 4043309951 +note cmp x27, #0 +af 3 0 3 +emit 3107980128 +note ldr w0, [x27] +ae 2 0 6024 +emit 1895825439 +note cmp w0, #0 +opennet = get oc 0 +emit 1409286145 +ae 4 6000 8 +emit 4043309087 +note cmp x0, #0 +af 3 1 7 +patch19 opennet get oc 0 +emit 3107980128 +note ldr w0, [x27] +emit 1895826463 +note cmp w0, #1 +opennet = get oc 0 +emit 1409286145 +matconst 1 0 +matconst 2 0 +ae 4 6000 24 +emit 4043309087 +note cmp x0, #0 +af 3 1 7 +patch19 opennet get oc 0 +emit 3107980128 +note ldr w0, [x27] +emit 1895827487 +note cmp w0, #2 +af 3 1 6 +emit 3107981152 +note ldr w0, [x27, #4] +emit 1895831583 +note cmp w0, #6 +af 3 1 3 +emit 961160032 +note ldrb w0, [x27, #648] +emit 1895826463 +note cmp w0, #1 +af 3 1 3 +emit 3107986272 +note ldr w0, [x27, #24] +matconst 1 5 +emit 167837696 +note and w0, w0, w1 +emit 1895830559 +note cmp w0, #5 +af 3 1 3 +matconst 1 5 +matconst 2 0 +matconst 3 0 +matconst 4 0 +matconst 5 0 +ae 4 6000 48 +emit 4043309087 +note cmp x0, #0 +af 3 1 7 +matconst 25 0 +opennet = get oc 0 +emit 335544320 +note A rejected candidate closes only the exclusive protocol owned by this invocation. +af 8 beg get oc 0 +aop 102 +patch26 next get oc 0 +emit 2432698136 +note add x24, x24, #1 +back scan +patch19 empty get oc 0 +patch19 limit get oc 0 +matconst 25 9223372036854775822 +patch26 opennet get oc 0 +emit 2853569504 +note mov x0, x22 +ae 3 0 72 +emit 4043309087 +note cmp x0, #0 +af 3 1 7 +emit 2853766112 +note mov x0, x25 +af 4 0 0 +patch19 already get oc 0 +matconst 0 0 +ret +end +if eq k 0 +mataddr r add 268435456 off +ret +end +if eq k 1 +mataddr r add 268435456 off +emit or or 4181721088 r shl r 5 +ret +end +if eq k 2 +mataddr 16 add 268435456 off +emit or 4177527296 r +ret +end +if eq k 3 +ae 1 16 0 +emit 4181733904 +note ldr x16, [x16, #96] +emit or or 4181721616 shl div off 8 10 0 +emit 3594453504 +note blr x16 +ret +end +ae 1 0 r +emit or 4181721104 shl div off 8 10 +emit 3594453504 +note blr x16 +end + +note af: 0 finalize image; 3 conditional error; 4 operation end; 5 resolve operation; 6 image exit. +fn af k ulong a ulong b ulong to void +if eq k 8 +for e ulong sub get xenerr 0 a +patch19 get xerrpos add e a b +end +put xenerr 0 a +ret +end +if eq k 6 +n = get xnexit 0 +if ge n len xexsite +fail 14 +end +put xexsite n get oc 0 +put xnexit 0 add n 1 +emit 335544320 +ret +end +if eq k 3 +n = get xenerr 0 +if ge n 256 +fail 14 +end +put xerrpos n get oc 0 +put xerrcode n b +put xenerr 0 add n 1 +emit or 1409286144 a +ret +end +if eq k 4 +n = get xenend 0 +if ge n 256 +fail 14 +end +put xendpos n get oc 0 +put xenend 0 add n 1 +emit 335544320 +ret +end +if eq k 5 +af 4 0 0 +for i ulong get xenerr 0 +patch19 get xerrpos i get oc 0 +matconst 0 or 9223372036854775808 get xerrcode i +af 4 0 0 +end +for j ulong get xenend 0 +patch26 get xendpos j get oc 0 +end +ret +end +f = findfn 1852399981 4 0 +if eq f 0 +fail 16 +end +if ne get fn_np sub f 1 0 +fail 9 +end +entry = get oc 0 +ae 0 16 0 +emit 4177527297 +note str x1, [x16] +emit 4177528320 +note str x0, [x16, #8] +emit 2432697329 +note mov x17, sp +emit 4177529361 +note str x17, [x16, #16] +for r ulong 12 +emit or or 4177527296 add r 19 shl add r 16 10 +end +for v ulong 8 +emit or or 4244636160 add v 8 shl add v 28 10 +end +emit 3577431057 +note mrs x17, fpcr +emit 4177530385 +note str x17, [x16, #24] +emit 3577431089 +note mrs x17, fpsr +emit 4177531409 +note str x17, [x16, #32] +emit 3575333919 +note msr fpcr, xzr +emit 3575333951 +note msr fpsr, xzr +ae 0 28 16384 +ae 0 17 8388608 +emit 2432696895 +note mov sp, x17 +matconst 0 0 +matconst 1 0 +matconst 2 0 +matconst 3 0 +ae 3 0 256 +emit or 2483027968 bdisp get oc 0 get fn_addr sub f 1 26 +if eq get fn_ret sub f 1 12 +matconst 0 0 +end +for ex ulong get xnexit 0 +patch26 get xexsite ex get oc 0 +end +ae 2 0 88 +ae 0 17 8388608 +emit 2432696895 +note mov sp, x17 +aop 102 +note Close a read-only file left open by a return, explicit exit or trap. +ae 1 0 2304 +emit 4043309087 +note cmp x0, #0 +p = get oc 0 +emit 1409286144 +ae 4 2304 16 +patch19 p get oc 0 +ae 1 0 2312 +emit 4043309087 +note cmp x0, #0 +p = get oc 0 +emit 1409286144 +ae 4 2312 16 +patch19 p get oc 0 +ae 0 16 0 +emit 4181732864 +note ldr x0, [x16, #88] +for r2 ulong 12 +emit or or 4181721600 add r2 19 shl add r2 16 10 +end +for v2 ulong 8 +emit or or 4248830464 add v2 8 shl add v2 28 10 +end +emit 4181724689 +note ldr x17, [x16, #24] +emit 3575333905 +note msr fpcr, x17 +emit 4181725713 +note ldr x17, [x16, #32] +emit 3575333937 +note msr fpsr, x17 +emit 4181723665 +note ldr x17, [x16, #16] +emit 2432696895 +note mov sp, x17 +emit 3596551104 +note ret +note Reuse the existing position-independent PE section layout, with ARM64 COFF Machine. +xefx 2 entry +wrword 68 174692 +afix +writeout 0 +end + +note aop: X19 ARG, X20 checked buffer pointer, X21 length. Firmware preserves X19..X28. +fn aop op ulong to void +if eq op 101 +matconst 0 1284559596355596985 +ae 2 0 512 +matconst 0 5602828850577812890 +ae 2 0 520 +ret +end +if eq op 102 +note Restore the timer and close the cached event on every image exit, including traps. +ae 1 1 6096 +emit 4043309119 +note cmp x1, #0 +cltimer = get oc 0 +emit 1409286144 +ae 4 6112 8 +patch19 cltimer get oc 0 +ae 1 0 6120 +emit 4043309087 +note cmp x0, #0 +clevent = get oc 0 +emit 1409286144 +ae 3 0 112 +patch19 clevent get oc 0 +note Release the exclusively owned SNP before the EFI image can be unloaded. +ae 1 0 6000 +emit 4043309087 +note cmp x0, #0 +clend = get oc 0 +emit 1409286144 +emit 4181736449 +note ldr x1, [x0, #120] +emit 4043309119 +note cmp x1, #0 +clnull = get oc 0 +emit 1409286144 +emit 3107979297 +note ldr w1, [x1] +emit 1895827519 +note cmp w1, #2 +clstop = get oc 0 +emit 1409286145 +ae 4 6000 40 +patch19 clstop get oc 0 +patch19 clnull get oc 0 +ae 1 0 6024 +emit 4043309087 +note cmp x0, #0 +clprot = get oc 0 +emit 1409286145 +ae 4 6000 16 +patch19 clprot get oc 0 +aop 101 +ae 1 0 6016 +ae 0 1 512 +ae 1 2 8 +matconst 3 0 +ae 3 0 288 +matconst 0 0 +ae 2 0 6000 +patch19 clend get oc 0 +ret +end +if eq op 8 +ae 5 0 0 +ret +end +if eq op 0 +emit 4043375295 +note cmp x21, #64 +af 3 3 5 +for z ulong 8 +emit or 4177527455 shl z 10 +end +matconst 0 1 +emit 3103785600 +note str w0, [x20] +ae 1 0 6000 +emit 4043309087 +note cmp x0, #0 +noinfo = get oc 0 +emit 1409286144 +emit 4181736449 +note ldr x1, [x0, #120] +emit 3108120608 +note ldr w0, [x1, #552] +emit 3103791744 +note str w0, [x20, #24] +emit 2034522144 +note ldrh w0, [x1, #556] +emit 3103792768 +note str w0, [x20, #28] +emit 3107982368 +note ldr w0, [x1, #12] +emit 3103793792 +note str w0, [x20, #32] +emit 3107980320 +note ldr w0, [x1, #4] +emit 3103794816 +note str w0, [x20, #36] +emit 961163296 +note ldrb w0, [x1, #652] +emit 3103795840 +note str w0, [x20, #40] +emit 3107979296 +note ldr w0, [x1] +emit 3103796864 +note str w0, [x20, #44] +ae 1 0 6040 +emit 3103797888 +note str w0, [x20, #48] +matconst 0 2 +emit 3103786624 +note str w0, [x20, #4] +patch19 noinfo get oc 0 +matconst 0 0 +ret +end +if eq op 5 +note Require the firmware RNG protocol. QEMU virt must supply a virtio RNG device. +matconst 0 4845287014151666853 +ae 2 0 512 +matconst 0 4908688144209030790 +ae 2 0 520 +ae 0 0 512 +matconst 1 0 +ae 0 2 6080 +ae 3 0 320 +emit 4043309087 +note cmp x0, #0 +af 3 1 3 +matconst 1 0 +emit 2853503970 +note mov x2, x21 +emit 2853438435 +note mov x3, x20 +ae 4 6080 8 +ret +end +if eq op 6 +emit 4043318975 +note cmp x21, #9 +af 3 3 5 +ae 1 0 6000 +emit 4043309087 +note cmp x0, #0 +af 3 0 3 +emit 3506447008 +note sub x0, x21, #8 +emit 4177527424 +note str x0, [x20] +matconst 1 0 +emit 2853438434 +note mov x2, x20 +emit 2432705155 +note add x3, x20, #8 +matconst 4 0 +matconst 5 0 +matconst 6 0 +ae 4 6000 104 +ret +end +if eq op 7 +emit 4043324095 +note cmp x21, #14 +af 3 3 5 +emit 4045406911 +note cmp x21, #2048 +af 3 8 4 +ae 1 0 6000 +emit 4043309087 +note cmp x0, #0 +af 3 0 3 +ae 1 0 6040 +emit 4043309087 +note cmp x0, #0 +freebuf = get oc 0 +emit 1409286144 +matconst 0 0 +ae 2 0 6056 +matconst 1 0 +ae 0 2 6056 +ae 4 6000 88 +emit 4043309087 +note cmp x0, #0 +af 3 1 6 +ae 1 0 6056 +ae 0 1 8192 +emit 3942711327 +note cmp x0, x1 +af 3 1 6 +matconst 0 0 +ae 2 0 6040 +patch19 freebuf get oc 0 +matconst 22 0 +ae 0 23 8192 +copytx = get oc 0 +emit 947284608 +note ldrb w0, [x20, x22] +emit 943090400 +note strb w0, [x23, x22] +emit 2432698070 +note add x22, x22, #1 +emit 3944022751 +note cmp x22, x21 +cpback = get oc 0 +emit 1409286145 +patch19 cpback copytx +matconst 1 0 +emit 2853503970 +note mov x2, x21 +emit 2853635043 +note mov x3, x23 +matconst 4 0 +matconst 5 0 +matconst 6 0 +ae 4 6000 96 +emit 4043309087 +note cmp x0, #0 +badtx = get oc 0 +emit 1409286145 +matconst 1 1 +ae 2 1 6040 +patch19 badtx get oc 0 +ret +end +if eq op 15 +note Persistent event-driven millisecond wait. Restore the original timer period at image exit. +emit 4044333695 +note cmp x19, #1000 +af 3 8 32 +ae 1 0 6120 +emit 4043309087 +note cmp x0, #0 +created = get oc 0 +emit 1409286145 +matconst 0 2147483648 +matconst 1 4 +matconst 2 0 +matconst 3 0 +ae 0 4 6120 +ae 3 0 80 +emit 4043309087 +note cmp x0, #0 +af 3 1 3 +patch19 created get oc 0 +ae 1 0 6120 +ae 2 0 304 +matconst 1 2 +matconst 2 10000 +emit 2600631906 +note mul x2, x19, x2 +ae 3 0 88 +emit 4043309087 +note cmp x0, #0 +af 3 1 3 +note Locate the optional timer protocol once. Its absence keeps the firmware default. +ae 1 0 6128 +emit 4043309087 +note cmp x0, #0 +located = get oc 0 +emit 1409286145 +matconst 0 1 +ae 2 0 6128 +matconst 0 1284774123615734963 +ae 2 0 512 +matconst 0 9333777055269054396 +ae 2 0 520 +ae 0 0 512 +matconst 1 0 +ae 0 2 6112 +ae 3 0 320 +emit 4043309087 +note cmp x0, #0 +tskip = get oc 0 +emit 1409286145 +ae 0 1 6096 +ae 4 6112 16 +emit 4043309087 +note cmp x0, #0 +tskip2 = get oc 0 +emit 1409286145 +ae 1 0 6096 +ae 2 0 6104 +patch19 located get oc 0 +ae 1 0 6096 +emit 4043309087 +note cmp x0, #0 +tskip4 = get oc 0 +emit 1409286144 +matconst 26 10000 +emit 2602204794 +note mul x26, x19, x26 +matconst 0 1000000 +emit 3942646623 +note cmp x26, x0 +emit 2592093018 +note csel x26, x26, x0, lo +ae 1 1 6104 +emit 3944349759 +note cmp x1, x26 +tskip3 = get oc 0 +emit 1409286144 +emit 4043309919 +note cmp x26, #0 +tskip0 = get oc 0 +emit 1409286144 +emit 2853831649 +note mov x1, x26 +ae 4 6112 8 +emit 4043309087 +note cmp x0, #0 +tskip5 = get oc 0 +emit 1409286145 +ae 2 26 6104 +patch19 tskip get oc 0 +patch19 tskip2 get oc 0 +patch19 tskip3 get oc 0 +patch19 tskip0 get oc 0 +patch19 tskip4 get oc 0 +patch19 tskip5 get oc 0 +note Timer-only wait avoids repeatedly polling SNP from firmware CheckEvent callbacks. +note The caller pumps Receive before waiting. Virtio SNP disables RX/TX interrupts. +matconst 0 1 +ae 0 1 304 +ae 0 2 328 +ae 3 0 96 +ret +end +if eq op 100 +note Close both handles and clear their slots even when firmware Close reports an error. +ae 1 0 2304 +emit 4043309087 +note cmp x0, #0 +p = get oc 0 +emit 1409286144 +ae 4 2304 16 +patch19 p get oc 0 +ae 1 0 2312 +emit 4043309087 +note cmp x0, #0 +p = get oc 0 +emit 1409286144 +ae 4 2312 16 +patch19 p get oc 0 +matconst 0 0 +ae 2 0 2304 +ae 2 0 2312 +ret +end +if eq op 12 +emit 2453675638 +note and x22, x19, #255 +emit 4043309791 +note cmp x22, #0 +opn = get oc 0 +emit 1409286144 +emit 4043311839 +note cmp x22, #2 +rd = get oc 0 +emit 1409286144 +emit 4043313887 +note cmp x22, #4 +af 3 1 32 +ae 1 0 2304 +emit 4043309087 +note cmp x0, #0 +af 3 0 35 +aop 100 +af 4 0 0 +patch19 rd get oc 0 +ae 1 0 2304 +emit 4043309087 +note cmp x0, #0 +af 3 0 35 +emit 3545300577 +note lsr x1, x19, #16 +ae 4 2304 56 +emit 4043309087 +note cmp x0, #0 +af 3 1 37 +ae 2 21 2336 +ae 0 1 2336 +emit 2853438434 +note mov x2, x20 +ae 4 2304 32 +emit 4043309087 +note cmp x0, #0 +af 3 1 37 +ae 1 0 2336 +af 4 0 0 +patch19 opn get oc 0 +note This initial read-only transport opens only the image's own volume, never a host path. +emit 3544776288 +note lsr x0, x19, #8 +emit 4043570207 +note cmp x0, #255 +af 3 1 19 +ae 1 0 2304 +emit 4043309087 +note cmp x0, #0 +af 3 1 34 +emit 4043309759 +note cmp x21, #0 +af 3 0 33 +emit 4043570879 +note cmp x21, #255 +af 3 8 33 +emit 960496256 +note ldrb w0, [x20] +emit 4043403295 +note cmp x0, #92 +af 3 1 33 +matconst 22 0 +ae 0 23 4096 +lp = get oc 0 +emit 947284608 +note ldrb w0, [x20, x22] +emit 4043341855 +note cmp x0, #32 +af 3 3 33 +emit 4043438111 +note cmp x0, #126 +af 3 8 33 +emit 2013275872 +note strh w0, [x23], #2 +emit 2432698070 +note add x22, x22, #1 +emit 3944022751 +note cmp x22, x21 +q = get oc 0 +emit 1409286145 +patch19 q lp +emit 2030043903 +note strh wzr, [x23] +matconst 0 1284253093421855137 +ae 2 0 512 +matconst 0 4283602510276476814 +ae 2 0 520 +ae 1 0 8 +ae 0 1 512 +ae 0 2 2352 +ae 3 0 152 +emit 4043309087 +note cmp x0, #0 +af 3 1 20 +matconst 0 1284199179690597154 +ae 2 0 512 +matconst 0 4283602510276475278 +ae 2 0 520 +ae 1 0 2352 +emit 4181724160 +note ldr x0, [x0, #24] +ae 0 1 512 +ae 0 2 2328 +ae 3 0 152 +emit 4043309087 +note cmp x0, #0 +af 3 1 20 +ae 0 1 2312 +ae 4 2328 8 +emit 4043309087 +note cmp x0, #0 +af 3 1 22 +ae 0 1 2304 +ae 0 2 4096 +matconst 3 1 +matconst 4 0 +ae 4 2312 8 +emit 4043309087 +note cmp x0, #0 +opened = get oc 0 +emit 1409286144 +aop 100 +matconst 0 9223372036854775844 +af 4 0 0 +patch19 opened get oc 0 +matconst 0 1284208961261104786 +ae 2 0 512 +matconst 0 4283602510276475278 +ae 2 0 520 +matconst 0 512 +ae 2 0 2336 +ae 0 1 512 +ae 0 2 2336 +ae 0 3 2400 +ae 4 2304 64 +emit 4043309087 +note cmp x0, #0 +info = get oc 0 +emit 1409286144 +aop 100 +matconst 0 9223372036854775849 +af 4 0 0 +patch19 info get oc 0 +ae 1 0 2408 +ret +end +if eq op 1 +emit 4043313855 +note cmp x21, #4 +af 3 3 5 +ae 1 0 0 +emit 4181727232 +note ldr x0, [x0, #48] +emit 4043309087 +note cmp x0, #0 +af 3 0 3 +emit 2853438433 +note mov x1, x20 +emit 4181722128 +note ldr x16, [x0, #8] +emit 3594453504 +note blr x16 +ret +end +if eq op 2 +emit 2853372896 +note mov x0, x19 +ae 3 0 248 +ret +end +if eq op 10 +emit 4043317951 +note cmp x21, #8 +af 3 3 5 +emit 3577471008 +note mrs x0, cntpct_el0 +emit 3577470977 +note mrs x1, cntfrq_el0 +matconst 2 1000 +emit 2596407329 +note udiv x1, x1, x2 +emit 4043309119 +note cmp x1, #0 +af 3 0 3 +emit 2596341760 +note udiv x0, x0, x1 +emit 4177527424 +note str x0, [x20] +matconst 0 0 +ret +end +if eq op 13 +emit 4043309695 +note cmp x19, #0 +af 3 1 32 +ae 1 0 0 +emit 4181729280 +note ldr x0, [x0, #64] +emit 4043309087 +note cmp x0, #0 +af 3 0 43 +ae 2 0 64 +matconst 22 0 +loop = get oc 0 +emit 3944022751 +note cmp x22, x21 +fin = get oc 0 +emit 1409286144 +emit 947284631 +note ldrb w23, [x20, x22] +emit 4043319039 +note cmp x23, #9 +ok1 = get oc 0 +emit 1409286144 +emit 4043320063 +note cmp x23, #10 +ok2 = get oc 0 +emit 1409286144 +emit 4043323135 +note cmp x23, #13 +ok3 = get oc 0 +emit 1409286144 +emit 4043342591 +note cmp x23, #32 +af 3 3 42 +emit 4043438847 +note cmp x23, #126 +af 3 8 42 +patch19 ok1 get oc 0 +patch19 ok2 get oc 0 +patch19 ok3 get oc 0 +ae 0 1 4096 +emit 2030043191 +note strh w23, [x1] +emit 2030044223 +note strh wzr, [x1, #2] +emit 4043320063 +note cmp x23, #10 +plain = get oc 0 +emit 1409286145 +matconst 0 13 +emit 2030043168 +note strh w0, [x1] +emit 2030044215 +note strh w23, [x1, #2] +emit 2030045247 +note strh wzr, [x1, #4] +patch19 plain get oc 0 +ae 4 64 8 +emit 4043309087 +note cmp x0, #0 +af 3 1 43 +emit 2432698070 +note add x22, x22, #1 +back loop +patch19 fin get oc 0 +emit 2853503968 +note mov x0, x21 +ret +end +note Other firmware operations are explicit unsupported results until implemented. +matconst 0 9223372036854775840 +end + +fn afix to void +for i2 ulong get xnaddr 0 +s = get xasite i2 +v3 = get xavalue i2 +if ge v3 268435456 +v3 = add get xbss 0 sub v3 268435456 +else +v3 = add sub v3 4194304 3584 +end +pg = sub shr v3 12 shr add s 3584 12 +reg = and rdword s 31 +w = or or 2415919104 reg shl and pg 3 29 +w = or w shl and shr pg 2 524287 5 +wrword s w +w = or 2432696320 reg +w = or w shl reg 5 +w = or w shl and v3 4095 10 +wrword add s 4 w +end +end + +note vmadd2 D DI W WI A: two independent f64 lanes, D[DI+j] = D[DI+j] + A*W[WI+j]. +note All operands evaluate before either load. FMUL then FADD, never fused or reassociated. +note Both two-element ranges are checked before any store. Aliasing reads use the original lanes. +note AArch64 only; vector v0..v2 are scratch, never the scalar pool's v16..v31 twins. +fn smadd2 to void +if ne get irmode 0 0 +fail 9 +end +if ne get xtarget 0 0 +fail 25 +end +d = vpair 1 +w = vpair 0 +rdval 0 11 255 0 +if ne get rt 0 11 +fail 7 +end +a = matreg get rk 0 get rv 0 11 +eol +emit or 1035993088 shl d 5 +emit or 1035993089 shl w 5 +emit or 1309150210 shl a 5 +emit 1851907137 +emit 1315034112 +emit or 1031798784 shl d 5 +end +note Parse a checked contiguous f64 pair, return its address in an allocated pool register. +note Freeze/unknown-initialization arrays are conservatively refused like other bulk operations. +fn vpair editflag ulong to ulong +e = arrname +k = get nm_kind sub e 1 +if or ge k 6 ne get nm_type sub e 1 11 +fail 7 +end +if and ne editflag 0 or eq k 2 eq k 5 +fail 20 +end +fz_arg e +r = alloc +mark = get nslot 0 +rdval 0 5 255 0 +if ne get rt 0 5 +fail 7 +end +if and eq get rk 0 3 eq unsz sub e 1 0 +ln = get nm_len sub e 1 +if or lt ln 2 ge get rv 0 sub ln 1 +fail 21 +end +end +i = matreg get rk 0 get rv 0 5 +elemaddr e 1 i 5 +n = alloc +bo_add 33 5 i 1 1 n +elemaddr e 1 n 5 +e3 2332036096 r get ea_b 0 i +put nslot 0 mark +ret r +end + +note vdot4 D X XO W WO ROWS STRIDE: four independent ascending-row binary64 dot products. +note D has at least four writable elements. STRIDE >= 4; ROWS <= 999999. Zero rows write +0. +note All ranges are proved before reads or stores; only final results are stored, so aliasing is safe. +global vda ulong 8 +fn sdot4 to void +if ne get irmode 0 0 +fail 9 +end +if ne get xtarget 0 0 +fail 25 +end +ns = get nslot 0 +for i ulong 3 +e = arrname +k = get nm_kind sub e 1 +if or ge k 6 ne get nm_type sub e 1 11 +fail 7 +end +if and eq i 0 or eq k 2 eq k 5 +fail 20 +end +fz_arg e +put vda i e +if ne i 0 +rdval 0 5 255 0 +if ne get rt 0 5 +fail 7 +end +put vda add i 2 matreg get rk 0 get rv 0 5 +end +end +for i ulong 2 +rdval 0 5 255 0 +if ne get rt 0 5 +fail 7 +end +put vda add i 5 matreg get rk 0 get rv 0 5 +end +eol +save +for i ulong 3 +basearg i get vda i +end +for i ulong 4 +loadarg add i 3 1 get vda add i 3 +end +vdlen get vda 0 +emit 4043313471 +note cmp x9, #4 +trapc 3 3 +vdlen get vda 1 +emit 3943235711 +note cmp x3, x9 +trapc 8 3 +emit 3405971753 +note sub x9, x9, x3 +emit 3943235775 +note cmp x5, x9 +trapc 8 3 +vdlen get vda 2 +emit 3943235743 +note cmp x4, x9 +trapc 8 3 +emit 3406037289 +note sub x9, x9, x4 +matconst 10 999999 +emit 3943301311 +note cmp x5, x10 +trapc 8 4 +emit 1862329344 +note movi v0.2d, #0 +emit 1862329345 +note movi v1.2d, #0 +emit 4043309247 +note cmp x5, #0 +empty = mbranch 0 +emit 4043313375 +note cmp x6, #4 +trapc 3 3 +emit 4043313471 +note cmp x9, #4 +trapc 3 3 +emit 3506442537 +note sub x9, x9, #4 +emit 2596669737 +note udiv x9, x9, x6 +emit 2432697641 +note add x9, x9, #1 +emit 3943235775 +note cmp x5, x9 +trapc 8 3 +emit 2332232737 +note add x1, x1, x3, lsl #3 +emit 2332298306 +note add x2, x2, x4, lsl #3 +emit 3548246214 +note lsl x6, x6, #3 +loop = get oc 0 +emit 4232086562 +note ldr d2, [x1], #8 +emit 1309148226 +note dup v2.2d, v2.d[0] +emit 2906656835 +note ldp q3, q4, [x2] +emit 1852038211 +note fmul v3.2d, v2.2d, v3.2d +emit 1315165184 +note fadd v0.2d, v0.2d, v3.2d +emit 1852103748 +note fmul v4.2d, v2.2d, v4.2d +emit 1315230753 +note fadd v1.2d, v1.2d, v4.2d +emit 2332426306 +note add x2, x2, x6 +emit 4043310245 +note subs x5, x5, #1 +vloop = mbranch 1 +patch19 vloop loop +patch19 empty get oc 0 +emit 2902459392 +note stp q0, q1, [x0] +rr = restore 255 ns get svn 0 get sva 0 0 +end +fn vdlen e ulong to void +i = sub e 1 +if ne unsz i 0 +loadarg 9 1 ulong get nm_lr i +else +matconst 9 get nm_len i +end +end diff --git a/seed/omc/size-history.tsv b/seed/omc/size-history.tsv index 4881642eb..057e1a518 100644 --- a/seed/omc/size-history.tsv +++ b/seed/omc/size-history.tsv @@ -39,3 +39,4 @@ forbound-857-main #857 for ... bound N (1..2^63-1; IR 1..1000000), IR while boun scrub-flive scrub keeps live float registers: MOVI #0 for V0-V15 and the dead twins only, the V16+j twin of a live vsl slot is spared (#853 x #875); on main 3a163bc5 (#857); Wolfram (517856 - 176)/4 = 129420 words 16432 495 129420 be8c51301307555254fc59e351d281aae1aa096d91521777e33a41c8b446448a x86efi-1015 target x86efi on main ba5559d9 (#1015): PE32+ output, UEFI entry/exit, target-scoped efi 0..13 with general file efi 12, exit-time flush/close of an open efi 12 file, efi 13 ConOut NULL refusal 43; Wolfram (611620 - 176)/4 = 152861 words 18056 510 152861 b4f45121f6c6d5d8a6ed0f5c4f3934b7cc4bec369bfa89523699bd33928f9b55 x86efi-ident-1022 efi 14 machine identity (CPUID brand, FirmwareVendor/Revision, SMBIOS table copy) on #1015 882e93c0 (#1022); Wolfram (625676 - 176)/4 = 156375 words 18224 511 156375 3ad9f10f64309e7acf8a725082b28e23a2a4aeb07e98322fb4dc0fcd8fc93194 +aarch64efi-ordered-neon ARM64 UEFI ABI, persistent timer/network/file adapters, ordered binary64 vmadd2/vdot4; Wolfram (712708 - 176)/4 = 178133 words 20123 516 178133 c54c9a149a23fc86fb96e08b433e09b555f690a0266c43a4b0e6095449035496 diff --git a/seed/out/omc b/seed/out/omc index bec7cf3e3..2b263c123 100755 Binary files a/seed/out/omc and b/seed/out/omc differ diff --git a/seed/out/omc.sha256 b/seed/out/omc.sha256 index a17c9c4dd..5a7398c46 100644 --- a/seed/out/omc.sha256 +++ b/seed/out/omc.sha256 @@ -1 +1 @@ -b1d9cff6d765d85159e14d8346ed946704e32e9ca39554fb22a7c3f23fe0cca3 seed/out/omc +c54c9a149a23fc86fb96e08b433e09b555f690a0266c43a4b0e6095449035496 diff --git a/tests/.crumb b/tests/.crumb index 0707a364b..4b5cdd7c6 100644 --- a/tests/.crumb +++ b/tests/.crumb @@ -314,14 +314,14 @@ } ], "children_root": "sha256:e86ac2a28d07eba800824efc763d45fc8bb3e3961be3a64206fb5022e3585f24", - "compiled_at": "2026-11-06T13:59:13Z", + "compiled_at": "2026-11-06T19:04:53Z", "compiler": "crumb-compile/1", - "digest": "sha256:30ff9017b760b1486add5c105f2a3b2bd3c4bf9b7e2cb656d666d87a6c6289eb", + "digest": "sha256:9389099648c968b6e6942664491b7488140fbf60dbbfd372097d4fb60e0ed178", "evidence_files": 74, "evidence_root": "sha256:9aa38bf7dcfa5eb3499356a0a2a1dd7704fedfae2d16822a7c9e1400f3a72723", - "files": 2082, - "generated_at_commit": "e45dbca3518b081dd94b18039a79e30f36dfd42d", - "source_tree": "sha256:23f10c08d370ac44d88f41d0d5a1a49f851a36549b9346217092da949324ab38" + "files": 2089, + "generated_at_commit": "fd3751b314299f16a624aefb0cc1bb919e7fa65f", + "source_tree": "sha256:531a3bd5750625b2ccc986f12d885b8cee1be7f8d05ccc91825d63754f9a146b" }, "owner_lane": "", "provenance": { diff --git a/tests/aarch64efi/address.om b/tests/aarch64efi/address.om new file mode 100644 index 000000000..bb48ce86d --- /dev/null +++ b/tests/aarch64efi/address.om @@ -0,0 +1,33 @@ +target aarch64efi +text payload "address" +text pass "ARM ADDRESS PASS\n" +global store ulong 4096 +global output uchar 64 +fn copy a view uchar 7 to ulong +v = ulong 0 +for i ulong len a +v = add v ulong get a i +end +ret v +end +fn main to int +note Literal numeric addresses must not be relocated with text or pool addresses. +n = ulong 4194304 +if ne n 4194304 +ret 71 +end +for i ulong 4096 +put store i add n i +end +if ne get store 4095 add n 4095 +ret 72 +end +if ne copy payload 742 +ret 73 +end +for j ulong len pass +put output j get pass j +end +r = efi 13 0 output 0 len pass +ret 0 +end diff --git a/tests/aarch64efi/bounds.om b/tests/aarch64efi/bounds.om new file mode 100644 index 000000000..f014a6ad3 --- /dev/null +++ b/tests/aarch64efi/bounds.om @@ -0,0 +1,7 @@ +target aarch64efi +global output uchar 4 +fn main to int +n = ulong 5 +r = efi 13 0 output 0 n +ret 99 +end diff --git a/tests/aarch64efi/file-wait.om b/tests/aarch64efi/file-wait.om new file mode 100644 index 000000000..2502fb8f5 --- /dev/null +++ b/tests/aarch64efi/file-wait.om @@ -0,0 +1,44 @@ +target aarch64efi +text path "\\TEST.TXT" +text done "ARM FILE WAIT FLOAT PASS\n" +fn main to int +buf = new uchar 64 0 +for i ulong len path +put buf i get path i +end +r = efi 12 65280 buf 0 len path +if ne r 5 +ret 71 +end +r = efi 12 65282 buf 0 64 +if ne r 5 +ret 72 +end +if ne get buf 0 104 +ret 73 +end +r = efi 12 65284 buf 0 0 +if ne r 0 +ret 74 +end +v = 1.25f64 +r = efi 15 100 buf 0 0 +if ne r 0 +ret 75 +end +for wait ulong 4 +r = efi 15 mul wait 3 buf 0 0 +if ne r 0 +ret 77 +end +end +v = mul v 2.0 +if ne v 2.5 +ret 76 +end +for j ulong len done +put buf j get done j +end +r = efi 13 0 buf 0 len done +ret 0 +end diff --git a/tests/aarch64efi/hello.om b/tests/aarch64efi/hello.om new file mode 100644 index 000000000..d9a5cc019 --- /dev/null +++ b/tests/aarch64efi/hello.om @@ -0,0 +1,10 @@ +target aarch64efi +text msg "ARM64 OMEGA EFI\n" +fn main to int +buf = new uchar 64 0 +for i ulong len msg +put buf i get msg i +end +r = efi 13 0 buf 0 len msg +ret int r +end diff --git a/tests/aarch64efi/run.py b/tests/aarch64efi/run.py new file mode 100644 index 000000000..49dbbe4e9 --- /dev/null +++ b/tests/aarch64efi/run.py @@ -0,0 +1,157 @@ +#!/usr/bin/env python3 +"""Targeted ARM64 EFI/HVF verifier. Test infrastructure only, never guest implementation.""" +import argparse +import hashlib +import json +import platform +import shutil +import struct +import subprocess +import time +from pathlib import Path + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--omc", required=True) + ap.add_argument("--sha256", required=True) + ap.add_argument("--out", type=Path, required=True) + ap.add_argument("--firmware", type=Path, required=True) + ap.add_argument("--runner", nargs=argparse.REMAINDER, default=[]) + args = ap.parse_args() + if platform.system() != "Darwin" or platform.machine() != "arm64": + ap.error("HVF qualification requires an ARM64 Mac; emulation is not a fallback") + qemu = shutil.which("qemu-system-aarch64") + assert qemu and args.firmware.is_file() + assert "hvf" in subprocess.check_output([qemu, "-accel", "help"], text=True).split() + identity = subprocess.check_output(args.runner + ["sha256sum", args.omc], text=True).split()[0] + if identity != args.sha256: + raise SystemExit("compiler pin mismatch") + args.out.mkdir(parents=True, exist_ok=False) + root = Path(__file__).resolve().parents[2] + tests = root / "tests/aarch64efi" + floats = root / "tests/x86efi/float" + rows = [] + + def compile_unit(name, source, rc=0): + case = args.out / name + case.mkdir() + (case / "source.om").write_bytes(source) + run = subprocess.run(args.runner + [args.omc], input=source, capture_output=True, timeout=30) + (case / "compile.err").write_bytes(run.stderr) + assert run.returncode == rc, (name, run.returncode, run.stderr) + if rc: + rows.append({"case": name, "compile_exit": rc}) + return None + image = case / "esp/EFI/BOOT/BOOTAA64.EFI" + image.parent.mkdir(parents=True) + image.write_bytes(run.stdout) + assert run.stdout[:2] == b"MZ" + pe = struct.unpack_from("= 1, "vector instruction missing" + target.write_bytes(raw.replace(old, new, 1)) + log = case / "serial.log" + cmd = [qemu, "-machine", "virt", "-accel", "hvf", "-cpu", "host", "-smp", "1", + "-m", "256", "-bios", str(args.firmware), "-drive", + f"format=raw,file=fat:ro:{case / 'esp'},readonly=on", "-display", "none", + "-serial", f"file:{log}", "-monitor", "none", "-nic", "none", "-no-reboot"] + proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + try: + deadline = time.monotonic() + 30 + while time.monotonic() < deadline: + data = log.read_bytes() if log.exists() else b"" + if marker in data: + break + assert proc.poll() is None, proc.stderr.read() + time.sleep(0.1) + else: + raise AssertionError((name, "firmware marker missing", data[-2000:])) + finally: + proc.terminate() + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + proc.wait() + rows.append({"case": name, "result": "PASS", "acceleration": "hvf", "cpu": "host", + "source_sha256": hashlib.sha256(source).hexdigest(), + "image_sha256": hashlib.sha256((case / "esp/EFI/BOOT/BOOTAA64.EFI").read_bytes()).hexdigest()}) + print("PASS", name, flush=True) + return data.replace(b"\r", b"") + + for name, marker in [("hello", b"ARM64 OMEGA EFI"), ("address", b"ARM ADDRESS PASS"), + ("file-wait", b"ARM FILE WAIT FLOAT PASS")]: + boot(name, (tests / (name + ".om")).read_bytes(), marker) + source = b"target aarch64efi\n" + (tests / "vector-dot.om").read_bytes().replace(b"fn main to int", b"fn vectest to int") + source += b'''text vmark "ARM VECTOR PASS\\n" +text vfail "ARM VECTOR REJECTED\\n" +fn main to int +r = vectest +b = new uchar 64 0 +if ne r 0 +for i ulong len vfail +put b i get vfail i +end +s = efi 13 0 b 0 len vfail +ret r +end +for i ulong len vmark +put b i get vmark i +end +s = efi 13 0 b 0 len vmark +ret int s +end +''' + boot("vector", source, b"ARM VECTOR PASS") + # Change the vector multiply into an add in the executable, leaving the independent + # scalar oracle intact. A successful compile and boot must still reject wrong code. + boot("vector-mutant", source, b"ARM VECTOR REJECTED", (struct.pack('