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
GitHub aien-dev/omega-mv#903 (code only)
Apply it
git checkout -b patch-0dbdcd8ef513cf6a e5b32567a7aff3ce594e3254a622a846a6cd190b curl -fsSL https://interplane.io/drakestapleton/omega-mv/patches/0dbdcd8ef513cf6a.patch | git am
Provenance
github-import 1
aien-dev/omega-mv
903
f9956ee731554aa23c6f0748dc5c3612d7bf81e3
{"kind":"github-import","owner":"aien-dev","repo":"omega-mv","number":903,"url":"https://github.com/aien-dev/omega-mv/pull/903","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:39:15Z","metadata":"unavailable","state_derived":true}
Changes
diff --git a/.crumb b/.crumb index f62f2f33c..5a4f0d659 100644 --- a/.crumb +++ b/.crumb @@ -47,8 +47,8 @@ "purpose": "Directory calibration. Purpose not yet described by a human." }, { - "digest": "26c2fbf4515e981db72f56dad2fc3fe0667c469551cf6071e28ac50005a36e42", - "last_commit": "943f5139f", + "digest": "3c40375aeaa691fe4eb8379c61b104deb8671f6220e865035442b177b532a53f", + "last_commit": "ef92bd700", "name": "docs", "purpose": "Directory docs. Purpose not yet described by a human." }, @@ -95,15 +95,15 @@ "purpose": "Directory tools. Purpose not yet described by a human." } ], - "children_root": "sha256:534f796d8e0fc81c75e714b05cf9bf36f60f0b5d31d5430fdea52d8bf179e6ea", - "compiled_at": "2026-10-27T00:45:25Z", + "children_root": "sha256:49c031925ef96b378bfe50577a5dd9706fb064ee8009f45b97d4449db8697b95", + "compiled_at": "2026-10-27T16:27:34Z", "compiler": "crumb-compile/1", - "digest": "sha256:fcb2fe9e59c8b7feeffedb41f1ae7cb713c34e33e1985e5aad1d473df75567f0", + "digest": "sha256:c3878d59a4254d147913aaf5ab2772e47e8657182267395e37bf40ac912fe79b", "evidence_files": 12477, "evidence_root": "sha256:9d96c8c22e5c574c4768d1eadd333b9750f73cd27be276a0f190c876960008a1", - "files": 17302, - "generated_at_commit": "52eba8831aa0b8db9fa2f2e13289920be4fa85f6", - "source_tree": "sha256:cd64f35f93a5dbeb923558fcae52ddcc8b82be786c4ca2e84e4d0a61ec07dcd6" + "files": 17308, + "generated_at_commit": "ef92bd700958b72be75d72922151d54d16c79da0", + "source_tree": "sha256:1c16d998ac0b3e0c9146c207ea2574512cf1e0413cb7e64b6b289dadeae93929" }, "owner_lane": "", "provenance": { diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index fb8cb6227..3dbe1057e 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -32,3 +32,4 @@ This table starts with the numeric work on this branch. Earlier work in this rep Update this table in the same commit as the work it credits. | Claude Opus 5.5 | Seed-chain bootstrap challenge: `seed/challenge/run.sh` rebuilds omc from the 408-byte seed out of a pinned `git archive` and checks every input and rung against a table read from committed files, with tampered-rung and wrong-value negative controls | +| Claude Opus 5.5 | Seeded compiler: `pread` needs a writable array (error 20) and `pwrite` takes a text, the writable check moved from code 162 to 161 in `hpread`; s4 regression rows, a reintroducing mutant and the 2c824805 negative control | diff --git a/docs/.crumb b/docs/.crumb index dcf015737..db91c7200 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": "8b926a045985692f116d9469af5aaa06d778bca78cf5d7e891e68c2486ed789e", - "last_commit": "8ec82485", + "last_commit": "8ec82485d", "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": "2ab37838f8694e5060a3789f08a16146996050af949fba329ed805429d85f695", - "last_commit": "f633e343", + "last_commit": "f633e3430", "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:c81d43c0c392dfec2b6ed5b38ba95ea7c592782b283950e32b777e7b9cfd9d61", - "compiled_at": "2026-10-26T17:56:57Z", + "compiled_at": "2026-10-27T16:27:15Z", "compiler": "crumb-compile/1", - "digest": "sha256:26c2fbf4515e981db72f56dad2fc3fe0667c469551cf6071e28ac50005a36e42", + "digest": "sha256:3c40375aeaa691fe4eb8379c61b104deb8671f6220e865035442b177b532a53f", "evidence_files": 34, "evidence_root": "sha256:589d8b3706e6d7a202ab20b278dac5fc5bafc973f1c2a867b2668aa7210b65cc", "files": 135, - "generated_at_commit": "943f5139f3f91f586ca03e707332afb2048d59d2", - "source_tree": "sha256:e91c9c4dc91d9680759d217e532ccacbaceea2f0ae8acc0b1ee957e627f1381d" + "generated_at_commit": "e5b32567a7aff3ce594e3254a622a846a6cd190b", + "source_tree": "sha256:d08e6995cc9b8529b1471cd65380996709bb4812a74c1133f5325aea3cd47b97" }, "owner_lane": "", "provenance": { diff --git a/docs/one_layer/OMEGESE.md b/docs/one_layer/OMEGESE.md index 119c55955..5de8d3f23 100644 --- a/docs/one_layer/OMEGESE.md +++ b/docs/one_layer/OMEGESE.md @@ -480,7 +480,9 @@ gate that tests it (`seed/rung4/gate4.sh`, section numbers of that script). Deci moved, or minus the Linux error number. They trap 3 unless n <= len A and off <= len A - n, before the call. `read` needs a writable array (error 20). A must be an array of uchar for the counts to be bytes. `pread fd A off n pos` / `pwrite fd A off n pos` (pos long) do the same at an explicit file position - without changing the descriptor's offset, with the same slice checks and result. (s.6 echo, bytecopy, t_rw) + without changing the descriptor's offset, with the same slice checks and result. Like `read`, `pread` + needs a writable array (error 20); `pwrite`, like `write`, also takes a text or a view. (s.6 echo, + bytecopy, t_rw; s4 v-bad-pread-text, v-pwrite-text) - `exit v` (v int) ends the program with status v modulo 256. Like `ret`, it ends the path: a line after it in the same block is error 17. (s.6 t_exit, s.7) - `note ...` is a line the translator does not read beyond its first word. (s.6 sort, fib) diff --git a/seed/omc/om2/s4/mut/preadwr.from b/seed/omc/om2/s4/mut/preadwr.from new file mode 100644 index 000000000..e76919fa0 --- /dev/null +++ b/seed/omc/om2/s4/mut/preadwr.from @@ -0,0 +1,2 @@ +if eq c 161 +wr = ulong 1 diff --git a/seed/omc/om2/s4/mut/preadwr.to b/seed/omc/om2/s4/mut/preadwr.to new file mode 100644 index 000000000..3295dc0d0 --- /dev/null +++ b/seed/omc/om2/s4/mut/preadwr.to @@ -0,0 +1,2 @@ +if eq c 162 +wr = ulong 1 diff --git a/seed/omc/om2/s4/s4-mutants.cases b/seed/omc/om2/s4/s4-mutants.cases index 164a29b23..f71ce6529 100644 --- a/seed/omc/om2/s4/s4-mutants.cases +++ b/seed/omc/om2/s4/s4-mutants.cases @@ -1,6 +1,7 @@ # S4 compiled mutants of omc.om. Expected verdicts fixed in advance: ctl-* PASS, m-* FAIL (detected). deadline 60 cc seed/omc/omc.om +ctl-v-bad-pread-text refuse seed/omc/om2/s4/v-bad-pread-text.om 20 ctl-v-ok run seed/omc/om2/s4/v-ok.om - - - 0 ctl-v-trap-get run seed/omc/om2/s4/v-trap-get.om - - - 103 ctl-p-ok run seed/omc/om2/s4/p-ok.om - - - 0 @@ -12,6 +13,10 @@ ctl-p-bad-base refuse seed/omc/om2/s4/p-bad-base.om 19 subst seed/omc/om2/s4/mut/uce.from seed/omc/om2/s4/mut/uce.to cc seed/omc/omc.om m-uce run seed/omc/om2/s4/v-trap-get.om - - - 103 +# pread/pwrite: the writable-array check on pwrite instead of pread (pread into a text compiles) +subst seed/omc/om2/s4/mut/preadwr.from seed/omc/om2/s4/mut/preadwr.to +cc seed/omc/omc.om +m-preadwr refuse seed/omc/om2/s4/v-bad-pread-text.om 20 # parameter slots: every parameter one slot at the call (the count slot of an unsized view not skipped) subst seed/omc/om2/s4/mut/slot.from seed/omc/om2/s4/mut/slot.to cc seed/omc/omc.om diff --git a/seed/omc/om2/s4/s4.cases b/seed/omc/om2/s4/s4.cases index d59475d03..6f3b0df5e 100644 --- a/seed/omc/om2/s4/s4.cases +++ b/seed/omc/om2/s4/s4.cases @@ -17,6 +17,9 @@ s4-v-bad-type refuse seed/omc/om2/s4/v-bad-type.om 7 s4-v-bad-viewedit refuse seed/omc/om2/s4/v-bad-viewedit.om 20 s4-v-bad-put refuse seed/omc/om2/s4/v-bad-put.om 20 s4-v-bad-read refuse seed/omc/om2/s4/v-bad-read.om 20 +s4-v-bad-pread-text refuse seed/omc/om2/s4/v-bad-pread-text.om 20 +s4-v-bad-pread-view refuse seed/omc/om2/s4/v-bad-pread-view.om 20 +s4-v-pwrite-text run seed/omc/om2/s4/v-pwrite-text.om - file:seed/omc/om2/s4/v-pwrite-text.out - 0 s4-v-bad-fresh refuse seed/omc/om2/s4/v-bad-fresh.om 16 s4-v-bad-local refuse seed/omc/om2/s4/v-bad-local.om 16 s4-v-bad-global refuse seed/omc/om2/s4/v-bad-global.om 19 diff --git a/seed/omc/om2/s4/v-bad-pread-text.om b/seed/omc/om2/s4/v-bad-pread-text.om new file mode 100644 index 000000000..825e7d412 --- /dev/null +++ b/seed/omc/om2/s4/v-bad-pread-text.om @@ -0,0 +1,7 @@ +note S4: pread writes its array, so pread into a text is error 20 (as read). +om2 +text t "ABC" +fn main to int +r = pread 0 t 0 3 0 +ret 0 +end diff --git a/seed/omc/om2/s4/v-bad-pread-view.om b/seed/omc/om2/s4/v-bad-pread-view.om new file mode 100644 index 000000000..6738546ee --- /dev/null +++ b/seed/omc/om2/s4/v-bad-pread-view.om @@ -0,0 +1,10 @@ +note S4: pread into an unsized view is error 20 (as read). +om2 +fn g v view uchar * to long +ret pread 0 v 0 1 0 +end +fn main to int +a = new uchar 4 0 +r = g a +ret 0 +end diff --git a/seed/omc/om2/s4/v-pwrite-text.om b/seed/omc/om2/s4/v-pwrite-text.om new file mode 100644 index 000000000..4f56b7fde --- /dev/null +++ b/seed/omc/om2/s4/v-pwrite-text.om @@ -0,0 +1,19 @@ +note S4: pwrite only reads its array, so a text and a view are allowed (error 20 is for pread). +note Writes ABC at file position 0 and a newline at 3 of stdout (exit 0). +om2 +text t "ABC" +fn g v view uchar * to long +ret pwrite 1 v 0 len v 0 +end +fn main to int +r = g t +if ne r 3 +ret 1 +end +nl = new uchar 1 10 +r = pwrite 1 nl 0 1 3 +if ne r 1 +ret 2 +end +ret 0 +end diff --git a/seed/omc/om2/s4/v-pwrite-text.out b/seed/omc/om2/s4/v-pwrite-text.out new file mode 100644 index 000000000..5da849b5c --- /dev/null +++ b/seed/omc/om2/s4/v-pwrite-text.out @@ -0,0 +1 @@ +ABC diff --git a/seed/omc/omc.om b/seed/omc/omc.om index eed86971c..6cd487167 100644 --- a/seed/omc/omc.om +++ b/seed/omc/omc.om @@ -5005,10 +5005,11 @@ end note stat: path slice (readonly) + output slice, at least 128 bytes for the ARM64 stat structure. note Linux newfstatat(AT_FDCWD, path, out, 0); returns 0 or -errno. A short output traps 3. note pread/pwrite: fd, byte slice (off, n), position long. The file offset is not moved. +note pread (161) writes A, so A must be writable (error 20); pwrite (162) only reads A, so a text is allowed. fn hpread c ulong dst ulong x ulong to void harg x 4 8 wr = ulong 0 -if eq c 162 +if eq c 161 wr = ulong 1 end e = harray x wr