From 29d4559e68b0396cc83e96931e15c4d69c9ad159 Mon Sep 17 00:00:00 2001 From: Drake Stapleton <213298340+drakestapleton@users.noreply.github.com> Date: Fri, 6 Nov 2026 23:52:56 -0600 Subject: [PATCH 1/4] omega-encoding: critical source profile (pending omega-mv #1063, DRA-419) Rules B1 B2 B3 E1 X1 P1 C1, check.sh usage, new authority return codes 43/40/76..79, example p10_profile (gate 111/111 at pinned omc 3ad9f10f). Refs DRA-419 --- README.md | 4 +- examples/p10_profile.expect | 2 + examples/p10_profile.om | 39 +++++++++++++++++++ examples/p10_profile.stdout | 1 + skills/omega-encoding/SKILL.md | 70 +++++++++++++++++++++++++++++++++- 5 files changed, 113 insertions(+), 3 deletions(-) create mode 100644 examples/p10_profile.expect create mode 100644 examples/p10_profile.om create mode 100644 examples/p10_profile.stdout diff --git a/README.md b/README.md index 7b97e88..1e5b4cc 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,7 @@ These host experiments do not qualify device execution or deployment. ## Check the examples yourself -The examples run on Linux AArch64 hosts only. [`examples/`](examples/) holds 105 programs, each +The examples run on Linux AArch64 hosts only. [`examples/`](examples/) holds 106 programs, each `NAME.om` with `NAME.expect` (and `NAME.stdout` when it prints): every trap, one refusal per error code, the common mistakes and the known defects. `examples/gate.sh` refuses any compiler but the pinned one, then compiles and runs every program here and in `skills/*/examples/`: @@ -115,7 +115,7 @@ examples/gate.sh omega-src/seed/out/omc ``` It prints `PASS name` or `FAIL name: reason` per program and ends with -`GATE PASS examples=110 pass=110 fail=0 omc=3ad9f10f...` (exit 0), `GATE FAIL ...` (exit 1), or a hash +`GATE PASS examples=111 pass=111 fail=0 omc=3ad9f10f...` (exit 0), `GATE FAIL ...` (exit 1), or a hash refusal (exit 2), for example `GATE FAIL omc sha256 b4f45121..., pinned 3ad9f10f... (omega-mv f4df8239...)` for the previous pin's compiler. The `omega-encoding` skill (section 0 and section 13) records the observed results and the negative controls; [`examples/WOLFRAM.md`](examples/WOLFRAM.md) records the Wolfram checks of diff --git a/examples/p10_profile.expect b/examples/p10_profile.expect new file mode 100644 index 0000000..420e65e --- /dev/null +++ b/examples/p10_profile.expect @@ -0,0 +1,2 @@ +compile 0 +exit 0 diff --git a/examples/p10_profile.om b/examples/p10_profile.om new file mode 100644 index 0000000..b2feb5b --- /dev/null +++ b/examples/p10_profile.om @@ -0,0 +1,39 @@ +note p10_profile: annotations read by the critical source profile seed/profile/profile.om +note (omega-mv #1063, pending). omc treats them as notes; the profile enforces them: +note "note p10 pure" (no put, pure callees only), "note p10 effect" (host words allowed), +note bounded while (bound <= 8192) and every assigned call result read before it is lost. +global ob uchar 24 +note p10 pure +fn sq v ulong to ulong +ret mul v v +end +note p10 effect +fn outu v ulong to ulong +i = ulong 23 +put ob 23 10 +n = v +while true bound 20 +i = sub i 1 +put ob i uchar add rem n 10 48 +n = div n 10 +if eq n 0 +break +end +end +w = write 1 ob i sub 24 i +if ne w long sub 24 i +ret 1 +end +ret 0 +end +fn main to int +s = ulong 0 +for k ulong 10 +s = add s sq k +end +e = outu s +if ne e 0 +ret 1 +end +ret 0 +end diff --git a/examples/p10_profile.stdout b/examples/p10_profile.stdout new file mode 100644 index 0000000..6cf4452 --- /dev/null +++ b/examples/p10_profile.stdout @@ -0,0 +1 @@ +285 diff --git a/skills/omega-encoding/SKILL.md b/skills/omega-encoding/SKILL.md index 94dd8fa..b8258d0 100644 --- a/skills/omega-encoding/SKILL.md +++ b/skills/omega-encoding/SKILL.md @@ -1296,6 +1296,74 @@ the bound ranges below are those of the pin `3a163bc5`, and the cited lines are - No loop runs forever and recursion is bounded by the 8 MiB stack. A long-running service needs an explicit epoch/restart design, not a bigger bound. +### Critical source profile `seed/profile` (pending omega-mv #1063, DRA-419; not on main) + +`seed/profile/profile.om` is a seeded-Omega, token-level checker that adapts Holzmann's Power of Ten to +`.om` units. It is stricter than `omc`, which compiles every B1/B2/B3 refusal fixture. Run it from the +omega-mv root, because it reads host words from `seed/effects/effects.om`: +`profile [bounds] [SOURCE ...]`. The sources are concatenated, and stdin is used when no source is +given. It prints one token: + +| Exit | Output | Meaning | +|---|---|---| +| 0 | `PROFILE-PASS` | the unit passes | +| 1 | `PROFILE-REFUSED::` | a rule was violated | +| 2 | | usage error | +| 3 | `PROFILE-INVALID` | the unit exceeds a capacity | +| 4 | | I/O error | + +Capacities are 65535 bytes, 4095 lines, 16383 tokens, 63-byte tokens and 128 functions. The rules: + +- **B1:** a `while` has `bound N` with N ≤ 8192. A `for` count is a literal, a `const`, `len X`, or carries `bound`. +- **B2:** recursion is allowed only in qualified form. Every function on a cycle takes `depth` first, never assigns it and has no `new`. + - An in-cycle call passes `depth`, or a name guarded by `NAME = add depth 1` / `if gt NAME LIM` (LIM ≤ 64) / `ret`, `exit` or `trap`. + - An entry from outside the cycle passes a literal or `const` ≤ 64. + - The omc/DRA-311 leaf removal then runs over the remaining edges. +- **B3:** each `global` and each `new` is ≤ 65536 elements. The global bytes, and the `new` bytes per function and in total, are each ≤ 65536. +- **E1:** an assigned call or host result is read before it is reassigned or the function returns. The exemption is `note p10 allow E1 ` on the line before. +- **X1:** host words appear only in a function preceded by `note p10 effect`. +- **P1:** a function preceded by `note p10 pure` has no `put` and calls only pure functions. +- **C1:** `requires`, `ensures` and `invariant` need `om2`. `om2 release` is refused. + +`bounds` mode skips E1 and X1. `sh seed/profile/check.sh` runs these checks: + +- the 44 fixture, capacity and stop rows; +- one killed `profile.om` mutant per rule; +- the profile of the `seed/authority` unit (`action`, `store`, `lock`, `dispatch`); +- the authority gates, including `dispatch-fault-gate`; +- negative controls with the pre-fix modules. + +The `om-profile-arm64` workflow runs `check.sh` weekly and on PRs. The fixes that this profile forced add the following codes: + +| Code | Where | Meaning | +|---|---|---| +| 43 | `lacq` | more than 1000 tries requested | +| 40 | `ltry` | the owner pid could not be read: `lerr` is 32 (open), 33 (close) or 34 (short read). Before the fix, a live pid 32 was misread as an error. | +| 76 | `dispatch` | reconcile refused | +| 77 | `dispatch` | post-effect record write failed | +| 78 | `dispatch` | release failed | +| 79 | `dispatch` | `actlost` failed after a generation change | + +What the profile does not do: + +- It is not path-sensitive and not a typechecker. +- It does not check callees outside the unit. +- It makes no whole-kernel claim. + +Example: `examples/p10_profile.om` passes both `omc` and the profile. On 2026-11-07, at omega-mv +`#1063` head, its mutants were refused: + +| Mutant | Output | +|---|---| +| bound removed | `PROFILE-REFUSED:B1:15` | +| effect note removed | `PROFILE-REFUSED:X1:23` | +| result overwritten | `PROFILE-REFUSED:E1:34` | + +Its output, 285, was checked with Wolfram: `Sum[k^2,{k,0,9}] -> 285`. +Rerun 2026-11-07 on Linux AArch64 with this example added: `bash examples/gate.sh` against omc +`3ad9f10f…3194` (omega-mv `f4df8239`, the pin of `gate.sh`) printed `GATE PASS examples=111 pass=111 +fail=0`, exit 0. The profile runs used omega-mv `943d9555` omc `5f90edea…f6df` (`OMC_PIN` at that main). + ### Compiler limits checked at main `bf54b19fa` (2026-10-29; rechecked at `91c83438d` on 2026-10-31) Checked with main's `seed/out/omc` (sha256 `62775d2a391cfef7cde64e387655caa9809a267093112910ec76bfa568f3712b`) @@ -2250,7 +2318,7 @@ are `seed/omc/omc.om` at `9920aab1`. traps of section 11b (exit 20, `omc: line 8: error 7`, `omc: line 5: error 12`). Each carries `.expect` (and `fnv1a32` also `.stdin` `abc` and the 4 expected bytes in `.stdout`) and -runs in [`examples/gate.sh`](../../examples/gate.sh) with the 105 programs in the repository's +runs in [`examples/gate.sh`](../../examples/gate.sh) with the 106 programs in the repository's `examples/` directory; section 0 records the `e5b32567` rerun of every row below. The portable guide for writing a first program is [`skills/writing-omega/SKILL.md`](../writing-omega/SKILL.md). From 7330e56a6c002f5b16231c8aa3af6f3d6d6d82e3 Mon Sep 17 00:00:00 2001 From: Drake Stapleton <213298340+drakestapleton@users.noreply.github.com> Date: Sat, 7 Nov 2026 00:05:38 -0600 Subject: [PATCH 2/4] omega-encoding: B2 guard-structure rules after #1063 review fix (795f5d0d) Refs DRA-419 --- skills/omega-encoding/SKILL.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/skills/omega-encoding/SKILL.md b/skills/omega-encoding/SKILL.md index b8258d0..6760bbf 100644 --- a/skills/omega-encoding/SKILL.md +++ b/skills/omega-encoding/SKILL.md @@ -1316,10 +1316,11 @@ Capacities are 65535 bytes, 4095 lines, 16383 tokens, 63-byte tokens and 128 fun - **B1:** a `while` has `bound N` with N ≤ 8192. A `for` count is a literal, a `const`, `len X`, or carries `bound`. - **B2:** recursion is allowed only in qualified form. Every function on a cycle takes `depth` first, never assigns it and has no `new`. - - An in-cycle call passes `depth`, or a name guarded by `NAME = add depth 1` / `if gt NAME LIM` (LIM ≤ 64) / `ret`, `exit` or `trap`. + - An in-cycle call passes `depth`, or a name guarded by `NAME = add depth 1` / `if gt NAME LIM` (LIM ≤ 64) / an optional call to a unit function / `ret`, `exit` or `trap` / `end`. + - The stop must close the guard's then-block. An `else` or any other block line inside the guard is refused. + - The assignment and the call must sit in the same block instance. No line between them may leave that block or start its `else` arm; equal nesting depth alone is not enough. - An entry from outside the cycle passes a literal or `const` ≤ 64. - The omc/DRA-311 leaf removal then runs over the remaining edges. -- **B3:** each `global` and each `new` is ≤ 65536 elements. The global bytes, and the `new` bytes per function and in total, are each ≤ 65536. - **E1:** an assigned call or host result is read before it is reassigned or the function returns. The exemption is `note p10 allow E1 ` on the line before. - **X1:** host words appear only in a function preceded by `note p10 effect`. - **P1:** a function preceded by `note p10 pure` has no `put` and calls only pure functions. @@ -1327,8 +1328,8 @@ Capacities are 65535 bytes, 4095 lines, 16383 tokens, 63-byte tokens and 128 fun `bounds` mode skips E1 and X1. `sh seed/profile/check.sh` runs these checks: -- the 44 fixture, capacity and stop rows; -- one killed `profile.om` mutant per rule; +- the 48 fixture, capacity and stop rows; +- one killed `profile.om` mutant per rule, plus two more for the B2 guard structure; - the profile of the `seed/authority` unit (`action`, `store`, `lock`, `dispatch`); - the authority gates, including `dispatch-fault-gate`; - negative controls with the pre-fix modules. @@ -1351,7 +1352,7 @@ What the profile does not do: - It makes no whole-kernel claim. Example: `examples/p10_profile.om` passes both `omc` and the profile. On 2026-11-07, at omega-mv -`#1063` head, its mutants were refused: +#1063 heads `7ae0a1df` (profile sha256 `98c95aff…e613`) and `795f5d0d` (`f4d730cb…1671`), its mutants were refused: | Mutant | Output | |---|---| From 4d87b40d41d947976dd82252a95b5154902ee919 Mon Sep 17 00:00:00 2001 From: Drake Stapleton <213298340+drakestapleton@users.noreply.github.com> Date: Sat, 7 Nov 2026 00:24:27 -0600 Subject: [PATCH 3/4] omega-encoding: profile classifies omc NAME value assignments (#1063 e6974c5d) Refs DRA-419 --- skills/omega-encoding/SKILL.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/skills/omega-encoding/SKILL.md b/skills/omega-encoding/SKILL.md index 6760bbf..68b0d28 100644 --- a/skills/omega-encoding/SKILL.md +++ b/skills/omega-encoding/SKILL.md @@ -1325,11 +1325,12 @@ Capacities are 65535 bytes, 4095 lines, 16383 tokens, 63-byte tokens and 128 fun - **X1:** host words appear only in a function preceded by `note p10 effect`. - **P1:** a function preceded by `note p10 pure` has no `put` and calls only pure functions. - **C1:** `requires`, `ensures` and `invariant` need `om2`. `om2 release` is refused. +- **Assignments:** omc accepts `name [=] value`, so B2, B3 and E1 share one classifier that recognises both spellings. A line assigns when its second token is `=`, or when its first token is not a statement keyword, a unit function or a host word. omc refuses names that shadow a function (error 10) or a host word (error 16). So `nd sub nd 1`, `depth ulong 0`, `b new T N` and `r f 2` are checked like their `=` forms. The canonical B2 guard must still be written `NAME = add depth 1`. `bounds` mode skips E1 and X1. `sh seed/profile/check.sh` runs these checks: -- the 48 fixture, capacity and stop rows; -- one killed `profile.om` mutant per rule, plus two more for the B2 guard structure; +- the 53 fixture, capacity and stop rows; +- one killed `profile.om` mutant per rule, plus three more for B2 (guard structure and `=`-less assignment); - the profile of the `seed/authority` unit (`action`, `store`, `lock`, `dispatch`); - the authority gates, including `dispatch-fault-gate`; - negative controls with the pre-fix modules. @@ -1352,7 +1353,7 @@ What the profile does not do: - It makes no whole-kernel claim. Example: `examples/p10_profile.om` passes both `omc` and the profile. On 2026-11-07, at omega-mv -#1063 heads `7ae0a1df` (profile sha256 `98c95aff…e613`) and `795f5d0d` (`f4d730cb…1671`), its mutants were refused: +#1063 heads `7ae0a1df` (profile sha256 `98c95aff…e613`), `795f5d0d` (`f4d730cb…1671`) and `e6974c5d` (`2d19340a…f5f7`), its mutants were refused: | Mutant | Output | |---|---| From f061d394a848e42159cb01e48270aa9b93d7c69b Mon Sep 17 00:00:00 2001 From: Drake Stapleton <213298340+drakestapleton@users.noreply.github.com> Date: Sat, 7 Nov 2026 01:55:02 -0600 Subject: [PATCH 4/4] omega-encoding: profile checker is the seeded driver check.om (#1063 b27482f4) seed/profile/check.sh was ported to seed/profile/check.om (Drake rule 4, 2026-11-07). Build/run command, PASS/FAIL/NOT_RUN lines and exit codes, and the p10_profile rerun at b27482f4: PROFILE-PASS, mutants B1:15 X1:23 E1:34, gate.sh 111/111 at omc 3ad9f10f. Refs DRA-419 Agent: PureDrivers (omp subagent of omp-queen-spark) --- skills/omega-encoding/SKILL.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/skills/omega-encoding/SKILL.md b/skills/omega-encoding/SKILL.md index 68b0d28..a37bb8c 100644 --- a/skills/omega-encoding/SKILL.md +++ b/skills/omega-encoding/SKILL.md @@ -1327,7 +1327,11 @@ Capacities are 65535 bytes, 4095 lines, 16383 tokens, 63-byte tokens and 128 fun - **C1:** `requires`, `ensures` and `invariant` need `om2`. `om2 release` is refused. - **Assignments:** omc accepts `name [=] value`, so B2, B3 and E1 share one classifier that recognises both spellings. A line assigns when its second token is `=`, or when its first token is not a statement keyword, a unit function or a host word. omc refuses names that shadow a function (error 10) or a host word (error 16). So `nd sub nd 1`, `depth ulong 0`, `b new T N` and `r f 2` are checked like their `=` forms. The canonical B2 guard must still be written `NAME = add depth 1`. -`bounds` mode skips E1 and X1. `sh seed/profile/check.sh` runs these checks: +`bounds` mode skips E1 and X1. The seeded driver `seed/profile/check.om` (it replaced `check.sh` at +#1063 head `b27482f4`; build it with the pinned compiler and run it from the omega-mv root: +`mkdir -p build/seed && seed/out/omc < seed/profile/check.om > build/seed/profile-check && chmod +x build/seed/profile-check && build/seed/profile-check`) +runs these checks and prints `PROFILE CHECK PASS` (exit 0), `PROFILE CHECK FAIL failed=N` (exit 1) +or `NOT_RUN …` (exit 3, wrong or missing omc): - the 53 fixture, capacity and stop rows; - one killed `profile.om` mutant per rule, plus three more for B2 (guard structure and `=`-less assignment); @@ -1335,7 +1339,7 @@ Capacities are 65535 bytes, 4095 lines, 16383 tokens, 63-byte tokens and 128 fun - the authority gates, including `dispatch-fault-gate`; - negative controls with the pre-fix modules. -The `om-profile-arm64` workflow runs `check.sh` weekly and on PRs. The fixes that this profile forced add the following codes: +The `om-profile-arm64` workflow builds and runs `check.om` weekly and on PRs. The fixes that this profile forced add the following codes: | Code | Where | Meaning | |---|---|---| @@ -1353,7 +1357,7 @@ What the profile does not do: - It makes no whole-kernel claim. Example: `examples/p10_profile.om` passes both `omc` and the profile. On 2026-11-07, at omega-mv -#1063 heads `7ae0a1df` (profile sha256 `98c95aff…e613`), `795f5d0d` (`f4d730cb…1671`) and `e6974c5d` (`2d19340a…f5f7`), its mutants were refused: +#1063 heads `7ae0a1df` (profile sha256 `98c95aff…e613`), `795f5d0d` (`f4d730cb…1671`), `e6974c5d` (`2d19340a…f5f7`) and `b27482f4` (`2d19340a…f5f7`, `PROFILE-PASS` on the example), its mutants were refused: | Mutant | Output | |---|---| @@ -1365,6 +1369,7 @@ Its output, 285, was checked with Wolfram: `Sum[k^2,{k,0,9}] -> 285`. Rerun 2026-11-07 on Linux AArch64 with this example added: `bash examples/gate.sh` against omc `3ad9f10f…3194` (omega-mv `f4df8239`, the pin of `gate.sh`) printed `GATE PASS examples=111 pass=111 fail=0`, exit 0. The profile runs used omega-mv `943d9555` omc `5f90edea…f6df` (`OMC_PIN` at that main). +At `b27482f4` the same gate printed the same line, and `build/seed/profile-check` printed `PROFILE CHECK PASS`, exit 0. ### Compiler limits checked at main `bf54b19fa` (2026-10-29; rechecked at `91c83438d` on 2026-10-31)