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
omega-mv / docs / X86-LINUX.md
| 1 | # x86-64 Linux backend (FR-9) |
| 2 | |
| 3 | Status: **DRAFT; native x86 qualification NOT_RUN**, measured again 2026-10-30. |
| 4 | The canonical integration base is `aien-dev/omega-mv` commit |
| 5 | `d94a503f7aae57d09697046405da2e9a5895be6d`, with compiler batch 3 integrated |
| 6 | at `7bce2a4fddc43268ac2af09cddc4a5a67d78312d`; the historical backend is |
| 7 | `7eca2ac3fbd1f35a7d65471065408ce4bea07fd4`. Current implementation lives in |
| 8 | `seed/omc/omc.om`. Source anchors describe implementation, not by themselves |
| 9 | execution evidence. The dated baseline below is immutable history; resumed |
| 10 | qualification records supersede it only for their exact source/tool pins. |
| 11 | |
| 12 | ## The x86-64 compiler (2026-11-23) |
| 13 | |
| 14 | `seed/omc/omc.om` compiles itself for x86-64: `cat si/directives/target-x86linux.om seed/omc/omc.om | |
| 15 | seed/out/omc` is a static x86-64 ELF compiler. omc's own arena is a run-time pool (`global a_ar ulong *`), |
| 16 | so this needed run-time pools on x86linux (OMEGESE 9.15): `xepool` (slot read after the operands, LEA, MOV, |
| 17 | CMP, JAE trap 3), `pl_len`, the pool path of `vs_chk` / `xio`, and `xenlarge` (inline mmap 9 / mremap 25). |
| 18 | An x86 element access of a global now loads the global's address into RDX at the access (`xbase`, ea_b |
| 19 | 254) instead of holding it in an operand slot, so an OM-2 unit that the AArch64 path compiles with pinned |
| 20 | globals keeps the same operand budget on x86 (the Visor console needed it). Every byte is emitted by the |
| 21 | handwritten `x*` emitters, each instruction with its Intel SDM volume 2 form in the source notes. `fopen` |
| 22 | takes the language's open flags (Linux asm-generic values) and `xoflags` renumbers the four that x86-64 |
| 23 | numbers differently (O_DIRECTORY, O_NOFOLLOW, O_DIRECT, O_LARGEFILE) before `openat`; before this, an x86 |
| 24 | program's O_DIRECTORY open was an O_DIRECT open (found when the omega package left its temporary |
| 25 | directories on x86-64; `tools/omega/gate.sh` now checks the directory open and the ENOTDIR refusal). |
| 26 | |
| 27 | Measured on Linux AArch64 (Lima VM) with the x86-64 programs under qemu-x86_64 (EMULATED; no physical |
| 28 | x86-64 run is recorded): |
| 29 | |
| 30 | - `seed/out/omc` 28fca13d44054e26f78c33d1753fd5c005d08e9144d95985c90bd75b60885072, born from |
| 31 | `seed/rung0/seed0.hex` (`sh seed/omega-from-seed.sh` with no prebuilt compiler) and reproduced bit for |
| 32 | bit from the independent Strand B seed (`sh seed/helix/helix-from-seeds.sh`). |
| 33 | - The x86-64 compiler rebuilds itself byte for byte, and from `seed/omc/omc.om` builds `seed/out/omc` byte |
| 34 | for byte (`seed/omc/gate-pools.sh` section X); every pool case gives its `.want` on x86, and the mutants |
| 35 | x86cmp (no bounds check), x86base (base not stored after mremap), x86belowlen (n below the length |
| 36 | shrinks), x86ovf (no 2^63 overflow test) and x86slotfail (a refused mmap stored as the base) are caught. |
| 37 | - An independent decoder (`python3 seed/omc/decode-x86.py IMAGE`, here with Apple LLVM 17 `objdump`) |
| 38 | accounts for every byte of the x86-64 compiler: a 512-byte header, the instructions, and the literal |
| 39 | islands the code branches around, with no undecoded byte and every direct branch on an instruction |
| 40 | boundary. |
| 41 | - The whole `omega` package runs as x86-64 (docs/OMEGA-PACKAGE.md). |
| 42 | |
| 43 | Native x86 execution remains NOT_RUN until a run on an x86-64 machine is recorded. |
| 44 | |
| 45 | ## Selection and implementation boundary |
| 46 | |
| 47 | The required opt-in is the exact first line `target x86linux`. Inputs without |
| 48 | that line retain the AArch64 default. Target selection belongs in `xlead`, |
| 49 | before `prescan` and normal parsing; it must preserve diagnostic line numbers. |
| 50 | Whitespace variants, truncated/extended target names, a later target line, and |
| 51 | combining the target with another output mode must not accidentally select a |
| 52 | backend. The historical `xlead` token comparison is not itself sufficient proof |
| 53 | of the exact-line contract: the tokenizer packs only the initial name bytes. |
| 54 | |
| 55 | The backend is handwritten Omega in `seed/omc/omc.om`, not a C, Python or |
| 56 | assembly implementation behind an Omega facade. Shared semantic operations |
| 57 | select x86 emission before the AArch64 `emit` path. `emit` refuses with error 25 |
| 58 | when a nondefault target reaches it. This is a refusal boundary, not a substitute |
| 59 | for implementing a reachable language operation. The historical commit also |
| 60 | contained `target x86efi` and a firmware boundary; those are removed from this |
| 61 | Linux-only integration. FR-9 does not qualify PE32+, OVMF or physical firmware. |
| 62 | |
| 63 | ## Instruction selection |
| 64 | |
| 65 | The backend lowers language operations directly; it does not decode AArch64 |
| 66 | words. `xb`, `xword`, `ximm`, `xrr`, and `xmem` emit bytes, little-endian |
| 67 | immediates, REX prefixes, ModRM and (for a stack base) SIB. Hardware register |
| 68 | numbers are private emitter operands, distinct from the language value IDs. |
| 69 | The instruction references are the Intel SDM volume 2 entries cited beside the |
| 70 | backend in the source. |
| 71 | |
| 72 | | Operation | Source anchors and selection | |
| 73 | |---|---| |
| 74 | | Integer constants and moves | `matconst`, `force`, `ximm`, `xload`, `xstore`: materialize a full-width immediate or copy a frame value through a hardware register | |
| 75 | | Add/subtract/multiply and bitwise operations | `bo_add`, `bo_mul`, `bo_log`, `xarith`: ADD, SUB, two-operand IMUL, AND, OR, XOR; signed checks branch before later operations overwrite flags | |
| 76 | | Division/remainder | `bo_div`, `xdiv`: test zero first, DIV for unsigned, CQO/IDIV for signed; handle the signed divisor-minus-one case explicitly so remainder does not raise a hardware divide exception | |
| 77 | | Shifts | `xshift`: check count against the language width before CL-based SHL/SHR/SAR; signed left shifts must retain the overflow check | |
| 78 | | Unary/conversion | `xunary`, `xconv`, `xcanrax`, `xext`: NEG/NOT, shift-based width canonicalization and checked narrowing; bool conversions retain language restrictions | |
| 79 | | Comparison | `xcmp`, `xcc`, `cset`: CMP and SETcc followed by zero extension; signed/unsigned predicates must not be interchanged | |
| 80 | | Branch/call/return | `xbranch`, `xpatch`, `ca_bl`, `resolve`, `epi`: rel32 Jcc, JMP, CALL, then LEAVE/RET; patch byte displacements, not AArch64 word displacements | |
| 81 | | Arrays and cells | `xelem`, `xmemval`, `st_ld`, `st_put`: bounds check, scaled index, width-specific MOV/MOVZX/MOVSX/MOVSXD; internal addresses are not source scalar pointers | |
| 82 | |
| 83 | `xbranch` reserves six bytes for every branch site. An unconditional JMP uses |
| 84 | its relative displacement and a padding NOP; conditional branches use the long |
| 85 | Jcc form. `xpatch` distinguishes their displacement positions. Calls have a |
| 86 | separate rel32 fixup in `resolve`. |
| 87 | |
| 88 | The x86 byte output, like the AArch64 output, is part of omc's arena and grows with it (OMEGESE 9.6, |
| 89 | since 2026-11-11; it was a 16 MiB pool here and 8 MiB for AArch64). |
| 90 | Dead then-arms do not emit an unreachable skip branch past the final bare-unit |
| 91 | instruction. Numeric and value `for` loops both check invariant obligations at |
| 92 | the loop head, including final false heads and `continue` backedges. |
| 93 | |
| 94 | The historical backend refused floating-point paths. The current draft adds |
| 95 | baseline SSE2 scalar lowering through `xfmov`, `xfsse`, `xfucom`, `xfbin`, |
| 96 | `xfminmax`, `xfcmp`, `xfint`, `xftoint` and `xfconv`, routed from `fp_*`. |
| 97 | Float bits retain the same frame slots; f32 extraction zero-extends its bits. |
| 98 | Comparisons normalize unordered/parity handling to the existing boolean flag |
| 99 | contract rather than adding a public condition code. The source implements |
| 100 | signaling-NaN priority and quieting, numeric selection for quiet NaNs in min/max, |
| 101 | signed-zero min/max, and default positive NaN for invalid arithmetic. |
| 102 | Float-to-integer conversion truncates and saturates to the destination bounds, |
| 103 | with NaN producing zero, rather than raising the checked integer-conversion |
| 104 | trap. Unsigned 64-bit conversion has dedicated high-half handling. These are |
| 105 | IMPLEMENTED source paths, not exercised IEEE parity claims; full fixtures must |
| 106 | still cover arithmetic, comparisons, conversions, arrays, pools and structs. |
| 107 | |
| 108 | ## Sixteen-value register model and frame map |
| 109 | |
| 110 | The parser's allocation model is retained; frame storage is not general spilling |
| 111 | and does not remove error 12. `poolc` allocates these sixteen operand IDs: |
| 112 | |
| 113 | | Pool positions (source `poolc`) | Stored operand IDs | |
| 114 | |---|---| |
| 115 | | Before the first branch in `poolc` | `0, 1, 2, 3, 4, 5, 6` | |
| 116 | | Before the second branch in `poolc` | `8, 9, 10, 11, 12, 13, 14, 15` | |
| 117 | | Final return in `poolc` | `17` | |
| 118 | |
| 119 | The historical operand-ID holes `7` (runtime) and `16` (scratch) are retained. |
| 120 | For **each** operand ID `s`, `xload` and `xstore` use exactly the source expression |
| 121 | `RBP - ((s + 1) * 8)` for its slot. This is an operand-ID-indexed frame, not a |
| 122 | new dense renumbering of the sixteen values. `xpro` reserves 256 bytes below RBP; |
| 123 | `xsave` and `xrestore` copy storage indices `0..17`, including the holes. RBP |
| 124 | addresses values; RSP moves for local arrays and call reservations. R15 retains |
| 125 | the owned-stack floor. RAX, RCX and RDX are commonly temporary integer operands; |
| 126 | R11 temporarily retains the caller's frame pointer during prologue entry. |
| 127 | |
| 128 | The source constants for Linux startup are stack floor `268435456` and initial |
| 129 | RSP `276824064`. `xcheck` compares prospective RSP against R15. `xsave` checks |
| 130 | space for a callee return address, saved frame pointer and frame before CALL; |
| 131 | `xsp` checks before stack subtraction. The owned stack is not Linux's original |
| 132 | argument/environment stack. |
| 133 | |
| 134 | ## Internal ABI versus Linux SysV |
| 135 | |
| 136 | This is a private Omega calling convention, **not** the SysV C function ABI. |
| 137 | `xsave` snapshots caller storage into a 256-byte reservation. `xarg` installs |
| 138 | arguments in caller frame slots, and `xpro` copies parameters from the old RBP |
| 139 | into the new frame. `epi` loads result slot zero into RAX and emits LEAVE/RET. |
| 140 | `xrestore` preserves that result while restoring other saved storage and RSP. |
| 141 | The existing six-parameter/slot accounting is a front-end contract; OM-2 unsized |
| 142 | arrays additionally require their pointer/count slot accounting (`pwid`, |
| 143 | `pslot`), not a scalar-only parameter loop. |
| 144 | |
| 145 | Bare-function output is now implemented by `xunit` using this same private |
| 146 | frame ABI. Each exported entry occupies a six-byte JMP/NOP slot in source |
| 147 | order; without exports, the unit enters its last function. `writeout 512` |
| 148 | removes the image reservation, so the result is raw code, not ELF or an |
| 149 | independently executable process. The caller must establish the private frame |
| 150 | and owned-stack convention. Existing `fnstore` restrictions on globals/text, |
| 151 | call-cycle checks and refusal boundaries remain in force. |
| 152 | |
| 153 | For bare units, physical R12 holds the wrapper's recovery-stack anchor, R14 |
| 154 | points to an immutable table of 32 runtime entry pointers, and R15 holds the |
| 155 | owned-stack floor. These physical registers are distinct from language operand |
| 156 | IDs. The native host-extension helpers overwrite R12/R14 in program mode and |
| 157 | remain forbidden in bare units. Legacy byte `read`/`write` use the separate |
| 158 | `xio` syscall path, preserve these registers and remain allowed in bare units. |
| 159 | Before CALL, the wrapper supplies a separate 256-byte old-RBP slot area, |
| 160 | including pointer/count argument slots, and at least 272 writable bytes below |
| 161 | pre-CALL RSP for the return address, saved RBP and callee frame. The first |
| 162 | prologue does not check this caller-owned initial allowance. |
| 163 | |
| 164 | A bare trap places its code in ESI and jumps through runtime table entry 2 |
| 165 | (`JMP [R14 + 16]`). This is a private nonlocal landing pad, not a C function call: |
| 166 | there is no new return address and the current frame may be incomplete. The |
| 167 | landing pad restores RSP from R12 and the wrapper's saved SysV callee-preserved |
| 168 | registers and RBP, then returns the status without storing a result. It must |
| 169 | validate trap codes and restore SysV alignment before any foreign CALL. Normal |
| 170 | unit returns still produce their value in RAX through LEAVE/RET. Trap recovery |
| 171 | does not roll back earlier writes or I/O. |
| 172 | |
| 173 | The raw compiler output itself has no SysV C-callable export, shared-object |
| 174 | relocation contract, PLT/GOT, dynamic linker, libc startup or general foreign-call |
| 175 | boundary. The separate omega-bridge x86 wrapper supplies the C boundary; its |
| 176 | qualification is separate from the private compiler ABI. Linux syscall register |
| 177 | conventions alone do not establish FR-7. |
| 178 | |
| 179 | ## Linux syscalls and cross-architecture records |
| 180 | |
| 181 | The imported Linux implementation covers `read` and `write` through `xio`, and |
| 182 | process termination through `xleave`. `xio` supplies fd in RDI, the checked byte |
| 183 | slice address in RSI, count in RDX and the syscall number in RAX; SYSCALL returns |
| 184 | in RAX. Its source selects `read`/`write` numbers with `c - 53`. `xleave` moves |
| 185 | the status to RDI and uses syscall number 60. Caller frame storage must survive |
| 186 | the architectural RCX/R11 clobbers. Raw kernel error returns must retain the |
| 187 | existing host-word result convention, rather than silently becoming success. |
| 188 | |
| 189 | **Historical host gap:** imported `hostval` refused every nondefault target with |
| 190 | error 25. The draft now contains an `xhost` dispatcher and native host helpers, |
| 191 | including socket, polling and device/mapping routes; wiring and coverage are |
| 192 | still being integrated. Their presence alone does not establish support for |
| 193 | every existing host fixture. Reusing AArch64 emitters is not an implementation. |
| 194 | |
| 195 | `execprog` (word 124) in `xhpack` calls `close_range(3, ~0U, CLOSE_RANGE_UNSHARE)` (syscall 436) |
| 196 | before `execve`, and a nonzero result skips the exec and returns that kernel error, matching the |
| 197 | AArch64 descriptor boundary. Its argument packet has the AArch64 limits (1..1024 records, at most |
| 198 | 65536 bytes, an 81920-byte frame; `execenv` 90112), qualified under qemu-x86_64 by the `x86-*` rows |
| 199 | of `seed/qualification/security673/packets.cases`. |
| 200 | `execpure` (word 198) has no x86 strict-profile lowering (Landlock, |
| 201 | seccomp and limits are AArch64-only); `xhost` refuses it with error 25. |
| 202 | |
| 203 | A complete host lowering needs a per-word x86 Linux syscall-number and |
| 204 | argument-order mapping, checked against the x86 UAPI rather than |
| 205 | `asm-generic/unistd.h`. Record layouts need a separate audit: `stat` fields and |
| 206 | offsets, `timespec`, polling records, socket addresses/options, ancillary data, |
| 207 | `iovec`/`msghdr`, wait results and architecture-dependent flags cannot be assumed |
| 208 | portable by changing a syscall number. Private kernel records must be translated |
| 209 | to the existing language-visible layout where those layouts differ. No kernel |
| 210 | pointer may escape into a source scalar; slice bounds and refusal allowlists |
| 211 | must remain enforced. Startup argument/environment support must preserve the |
| 212 | initial Linux stack before replacing RSP. This paragraph is a design obligation, |
| 213 | not a claim that these translations are present. |
| 214 | |
| 215 | ## Static ELF64 and address fixups |
| 216 | |
| 217 | `xelf` reuses the static `elfhdr` layout, replacing the executable/machine word |
| 218 | for x86-64 and the entry address. The two PT_LOAD mappings remain code at |
| 219 | `0x400000` (read/execute) and owned pools/stack at `0x10000000` (read/write). |
| 220 | The output is ELF64 little-endian ET_EXEC, without a PT_INTERP or dynamic |
| 221 | linker. `xeof` emits startup after the functions, installs the owned stack, |
| 222 | calls parameterless `main`, then exits. The Linux code reservation starts at |
| 223 | byte 512 in the historical path. |
| 224 | |
| 225 | `mataddr`, `xaddr`, and `xfixaddr` retain address origin separately from integer |
| 226 | constants and patch RIP-relative LEA displacements after layout. A numeric |
| 227 | constant that happens to resemble a pool address must not relocate. Calls and |
| 228 | branches are resolved against code byte offsets. Static fixed-address segments |
| 229 | are not a claim of PIE or a shared-object ABI. |
| 230 | |
| 231 | ## Traps and refusal paths |
| 232 | |
| 233 | `xtrap` records a branch site and language trap code; `xfinish` resolves each |
| 234 | site to process termination with status `100 + code` in program mode, or the |
| 235 | runtime-table landing pad described above in bare mode. Trap numbers and |
| 236 | source-level boundaries match AArch64, including signed overflow (1), division |
| 237 | by zero (2), bounds (3), loop bound (4), conversion (5), stack (6) and shift count |
| 238 | (7). Explicit and contract-related traps retain their existing definitions. |
| 239 | Linux termination is not a host signal oracle. |
| 240 | |
| 241 | Compiler refusal is distinct from runtime trapping: error 25 identifies an |
| 242 | unsupported target/emission path, while existing parse, type, capacity and |
| 243 | bounds refusals remain compiler errors. The historical program-only restriction |
| 244 | has been replaced by the private bare-unit output described above. No unsupported |
| 245 | construct may be represented by empty emission or a fallback AArch64 instruction. |
| 246 | |
| 247 | ## Integration gaps and acceptance evidence |
| 248 | |
| 249 | The historical import lacked host words beyond byte I/O/exit, floating-point |
| 250 | lowering, OM-2 unsized-array checks, pointer/count parameter accounting and newer |
| 251 | semantic operations. The current draft adds SSE2 lowering, an `xhost` dispatcher, |
| 252 | `nm_lr` checks in `xelem`, parameter-slot integration, and core/layout/rotate |
| 253 | lowering (`xrot` among the native helpers). These are source integration changes, |
| 254 | not execution evidence. The guard against AArch64 emission remains required. |
| 255 | |
| 256 | The historical target-name prefix comparison is now length checked in `xlead`; |
| 257 | the exact-first-line contract still needs its complete negative controls. |
| 258 | Bare-function and multi-entry output boundaries, all host records and every |
| 259 | current language path must be accounted for by the final differential. No gap |
| 260 | listed here is an approved reduction of FR-9 scope. Final source pins and |
| 261 | exercised coverage must supersede draft observations before FR-9 is complete. |
| 262 | |
| 263 | Acceptance requires the **full existing fixture differential**, not a selected |
| 264 | integer subset: default AArch64 bytes/refusals/diagnostics unchanged against the |
| 265 | independently pinned baseline; x86 results, stdout/stderr, side effects and trap |
| 266 | statuses compared to the corresponding AArch64 executions; documented treatment |
| 267 | of architecture-specific fixtures without silently omitting them. An independent |
| 268 | `objdump` instruction oracle must inspect emitted instructions and fixups, and |
| 269 | wrong-encoding mutants must demonstrably fail that oracle or the behavioral |
| 270 | checks. Record exact commands, source/compiler pins, baseline hashes and both |
| 271 | expected and observed results. An x86 QEMU run is **EMULATED**; it is not a |
| 272 | physical x86 execution receipt. Full acceptance remains pending for this draft. |
| 273 | |
| 274 | ## Seed impact |
| 275 | |
| 276 | The compiler source and its generated seed compiler are separate artifacts. |
| 277 | Adding x86 output does not replace the AArch64 seed ladder or authorize editing |
| 278 | handwritten bootstrap rungs. The source remains within om4's unchanged |
| 279 | 512-function table: two one-use ELF/relocation helpers were inlined after a |
| 280 | 514-function candidate correctly failed bootstrap error 14. No bootstrap gate, |
| 281 | table capacity, seed0, hex1, asm2 or om4 was weakened or replaced. (That table is om4 `d0da40e4`; |
| 282 | the `feat/om4-fn-table` draft proposes 4096 entries with unchanged omc bytes.) |
| 283 | |
| 284 | ### Historical baseline at `becf5c817bcb7e0846d12ebfc2be91042d8ad89a` |
| 285 | |
| 286 | - `sh seed/host/check.sh`: PASS, including seed ladder/fixpoint, IR C-oracle |
| 287 | comparisons, gates 7 through 18, 44 contract cases, enforcement/prover |
| 288 | negative controls, native host checks, 53 negative controls and 62 unchanged |
| 289 | historical fixture outputs. |
| 290 | - `sh seed/omc/gate5.sh`: GATE5 PASS, including 153 corpus inputs, 4,860 |
| 291 | cut/changed inputs and the existing wrong-compiler mutants. |
| 292 | - Baseline source: 15,525 lines, 512 functions, SHA256 |
| 293 | `3a40637bfc11eb4b0c0af80a73bd228a3975c25ef805859f06cb1f6d7fc089f4`. |
| 294 | - AArch64 compiler: 473,348 bytes, SHA256 |
| 295 | `5f0faab7cd4fc12158cf8e099418098d278df644efc10e4e7e2e5ca6141fca86`. |
| 296 | - x86 compiler: 3,652,870 bytes, SHA256 |
| 297 | `a95de640177954118482f4fab45945e6cdefc8935afe3eb4e0ac0ec314dc78fc`. |
| 298 | Under QEMU it compiled the complete compiler source for both targets to |
| 299 | bytes identical to the AArch64-hosted compiler, including its own x86 image. |
| 300 | This is **EMULATED**, not a native x86 seed chain. |
| 301 | - Independent GNU x86-64 objdump 2.42 decoded all 517,049 instructions of that |
| 302 | x86 compiler image without invalid opcodes or undecoded bytes. |
| 303 | - Exit-42 ELF behavior matched native AArch64 and QEMU x86. All four actual |
| 304 | CUDA++ units (`bw_enc_sm121`, `cubin_elf`, `ampere_enc_sm86`, `amp_runtime`) |
| 305 | compiled for both targets; their bare ABI behavior is not established by |
| 306 | compilation. |
| 307 | |
| 308 | The full cross-target runner completed with verdict **FAIL**: 7,537 PASS, |
| 309 | 152 FAIL, 399 NOT_RUN, five MISSING_IMPLEMENTATION, 570 EXCLUDED and |
| 310 | 257 MISSING_INPUT records. Both encoding mutants were caught. Exact pins, |
| 311 | command, counts and unresolved cases are recorded in |
| 312 | `seed/qualification/x86-linux/20261028.json`; the unchanged complete JSONL |
| 313 | is preserved at the path and SHA256 recorded there. This is not stage-C PASS. |
| 314 | |
| 315 | Failures include contract `forfinal`/`forcontinue` refusal, x86 output capacity |
| 316 | on C2 case 05712, four bare-unit direct-branch boundary failures, structured |
| 317 | diagnostic positions, explicit-refusal oracle mismatches and device fixtures. |
| 318 | Uncomposed bare callers, unreviewed host drivers and missing SHA fixture inputs |
| 319 | also remain. These are not silently excluded from the overall failing verdict. |
| 320 | |
| 321 | For the invalid-fd `devcall` discrepancy, a minimal trace returned EBADF (9) |
| 322 | on AArch64, while QEMU translated the same x86 |
| 323 | `ioctl(-1,0xc020462b,...)` to ENOTTY (25). No backend errno shim or weakened |
| 324 | gate was introduced. This dated baseline did not satisfy full stage-C |
| 325 | acceptance; the resumed run must retain the original cases and explain each |
| 326 | remaining deviation. |
| 327 | Native x86 execution and a native x86 seed0 chain are **NOT_RUN**. |
| 328 | |
| 329 | Word-count bookkeeping was checked through WolframLanguageEvaluator: |
| 330 | `(473348-176)/4 -> 118293`. QEMU version was 8.2.2 |
| 331 | (`1:8.2.2+ds-0ubuntu1.18`); Python was 3.12.3. These are verification |
| 332 | oracles only, not production dependencies of the emitted static programs. |
| 333 | |
| 334 | ## Resumed differential and operator wrap-up |
| 335 | |
| 336 | The complete resumed run at `66807b62914461b88df5ac73b827a8c809a854b4` |
| 337 | used QEMU 10.0.14 and the original/private/bridge callers. It remained **FAIL**: |
| 338 | 8,243 PASS, 476 FAIL, 211 EXCLUDED, six NOT_RUN and one |
| 339 | MISSING_IMPLEMENTATION. These counts are not directly comparable as a fixed |
| 340 | denominator: previously excluded metadata/conductor arms and missing inputs |
| 341 | were expanded into exercised cases. All 570 original exclusions and all |
| 342 | remaining exclusions are individually recorded in |
| 343 | `seed/qualification/x86-linux/20261028-resumed.json`, alongside unresolved |
| 344 | records, hashes, commands and the exact counting rule. The historical baseline |
| 345 | has 152 top-level FAIL records; its summary is not another failing case. |
| 346 | |
| 347 | At `4f14b2d8f1eeb470836fcd2adf1e6ad5b7608c16`, the source additionally repaired |
| 348 | OM-2 constant-index temporary allocation and missing x86 trap-site diagnostics. |
| 349 | The SHA unit compiled for both targets |
| 350 | and the contract diagnostic fixture emits matching source-site records after |
| 351 | target-prefix line translation. The seed ladder rebuilds to compiler SHA256 |
| 352 | `7d1739cc46c04bb8b585c5a255690ae58e30e9ffaa329defa19da3375c5fa316`. |
| 353 | Additional entryless callers and trap authorities are implemented in the oracle. |
| 354 | The full differential after those changes was **NOT_RUN** at that operator |
| 355 | wrap-up. Do not attribute the earlier counts or host gates to that unrerun patch. |
| 356 | |
| 357 | The recovered source `efd15c234afc584e1e67492e736cbb42806c2a7d` (source |
| 358 | SHA256 `e9d70e7cbe1b7026b2fcac5bbf61a64bde931b50a632c954355ba5299954a61c`, |
| 359 | AArch64 compiler `f7752bc5c800e85c2393a08153786d0a6bc4516c9cea955fe27624228d6d1409`) |
| 360 | passed `sh seed/host/check.sh` and `sh seed/omc/gate5.sh` on the AArch64 host. |
| 361 | Its complete differential exited 1: **14,930 PASS, 60 FAIL, 10 NOT_RUN, |
| 362 | 216 EXCLUDED**. Verdict **FAIL**. The remaining failures are structured |
| 363 | diagnostic mismatches, unclean expansion-growth refusals, OM-2 fold/unroll |
| 364 | mutant oracle mismatches, A5 bare-unit fixture exits, and frozen C2 mismatches |
| 365 | `c2-00015`, `c2-00033`, `c2-00304`, `c2-00306`, `c2-00675`, `c2-00728` and |
| 366 | `c2-05713` through `c2-05719` except `c2-05718`. Two QEMU ioctl |
| 367 | EMULATOR_ARTIFACT cases and eight entryless callers remain NOT_RUN. Exact case |
| 368 | names and receipts are in `seed/qualification/x86-linux/20261028-recovered-corpus.json` |
| 369 | and `20261028-recovered-host.json`. |
| 370 | |
| 371 | Two invalid-fd ioctl cases in the resumed run have concrete emulator evidence: |
| 372 | QEMU's own trace records request `0xc020462b`, fd `-1`, errno ENOTTY, while the |
| 373 | native fixture requires EBADF. QEMU 10.0.14 |
| 374 | [`linux-user/syscall.c:5713–5717`](https://github.com/qemu/qemu/blob/v10.0.14/linux-user/syscall.c#L5713-L5717) |
| 375 | returns `-TARGET_ENOTTY` for an unknown request before checking the descriptor. |
| 376 | The receipt pins the source, source archive, emulator binary and trace. These |
| 377 | are NOT_RUN/EMULATOR_ARTIFACT records, not backend PASS or native-x86 evidence. |
| 378 | |
| 379 | ## Corpus authority and compatibility |
| 380 | |
| 381 | The runner distinguishes current-candidate checks from historical authorities: |
| 382 | |
| 383 | - Frozen `sec/*/pinned.cases` assertions execute through the original Omega |
| 384 | conductor with the independently checked compiler SHA256 |
| 385 | `734f0a39319fbfa930bcc62cb30dbf06d47d78e126372b74f5baf478e6126b61`. |
| 386 | Separate current-candidate differential records do not replace those assertions. |
| 387 | - C2 still requires the current candidate to reproduce its frozen compile bytes |
| 388 | and diagnostics. A separate `:frozen-provenance` replay checks the historical |
| 389 | authority; its PASS cannot satisfy a failing current-candidate C2 row. |
| 390 | - Historical candidate manifests receive the compiler source at their recorded |
| 391 | stage revision. Compiler substitutions, builds, controls and mutant executions |
| 392 | run through their original conductor, rather than testing a healthy compiler |
| 393 | against a mutant-only expected output. |
| 394 | - Standalone mutant specifications must map to executable mutation blocks. |
| 395 | Actual build/control/kill transcripts are filed once in the JSONL as |
| 396 | `original-conductor-evidence`; per-row records reference their hashes. |
| 397 | Adequacy controls must fail specifically because the mutant survived, not |
| 398 | because its compiler failed to build. |
| 399 | |
| 400 | The original C2 compatibility contract conflicts with intentional later native |
| 401 | changes, including corrected `getppid`, the socket-option safety allowlist and |
| 402 | expanded name/function capacities. Those failures remain visible. Revising the |
| 403 | contract requires an explicit decision; neither reverting safety fixes nor |
| 404 | silently replacing current-candidate checks with historical replay is allowed. |
| 405 | |
| 406 | ### Recovered OM-2 growth bound |
| 407 | |
| 408 | Through omc f4fa7951 the x86 byte emitter enforced the per-function emitted-storage budget of the |
| 409 | AArch64 word emitter (262144 bytes in an OM-2 function). Since 2026-11-11 neither target has that |
| 410 | budget (OMEGESE 9.6); x86 branches are rel32, and the expansion-fuel bounds remain unchanged. |
| 411 | The existing growth fixtures must refuse with error 14 and empty stdout; |
| 412 | their diagnostic twins must retain `obligation=growth`. Rolled and OM-1 controls |
| 413 | remain accepted. Removing only the new guard is the negative control. |
| 414 | |
| 415 | Different instruction sizes reach that storage ceiling at different source |
| 416 | locations. The corpus deliberately retains its literal cross-target refusal |
| 417 | and diagnostic equality assertions: a clean refusal does not turn a different |
| 418 | source location into PASS. Likewise, x86 bare-unit stack checks retain every |
| 419 | `omc-site` record required by the recovery ABI; they are not suppressed to |
| 420 | imitate AArch64's program-mode-only stack checks. |
| 421 | |
| 422 | The interrupted current-compiler mutant repairs re-anchor the S2 cycle and S3 |
| 423 | error-16 substitutions to their intended guards and distinguish the x86 |
| 424 | constant-index guard from the unchanged AArch64 occurrence. Historical mutant |
| 425 | sources and frozen receipts remain unchanged. A5 kept-constructor and rotate |
| 426 | bare-unit callers use the independently recorded exits in |
| 427 | `candidates/s4/export/sec5.cases`, rather than incorrectly requiring exit zero. |
| 428 | |
| 429 | Source `3e66b6744590cc72c623d8e09413b9072bcab36e` (compiler source SHA256 |
| 430 | `4b5392fffd25a3a37844ad8bb5138fbaada690be7dae95132614524bdb78a1e0`) |
| 431 | rebuilds to seeded compiler |
| 432 | `badedbb0c6287887641fcd7e97301b43b5f82f2d7a2838bbe0d17547873108be`. |
| 433 | The seed ladder, `sh seed/host/check.sh` and `sh seed/omc/gate5.sh` passed. |
| 434 | The complete corpus exited 1: **14,936 PASS, 54 FAIL, 10 NOT_RUN, |
| 435 | 216 EXCLUDED**, verdict **FAIL**. All 15,216 outcome-row case names and their |
| 436 | multiplicities match the preceding complete corpus; no failing case was removed. |
| 437 | Both independent encoding mutants were caught. |
| 438 | |
| 439 | The 54 remaining FAIL records are 17 literal successful-diagnostic mismatches, |
| 440 | 8 growth-refusal coordinate mismatches, 16 historical S2 mutant obligations, |
| 441 | 12 frozen current-C2 obligations, and one pre-OM-2 refusal expectation in |
| 442 | `leak.cases`. Eight formerly failing mutation-anchor/A5 caller records now pass. |
| 443 | Two formerly passing S2 growth records now fail literal coordinate parity: |
| 444 | both targets cleanly refuse error 14, but their emitted-storage ceilings cross |
| 445 | at different source tokens. These are not relabelled PASS. |
| 446 | |
| 447 | The ten NOT_RUN records remain two concrete QEMU ioctl artifacts and eight |
| 448 | entryless diagnostic-site callers. Native x86 execution remains NOT_RUN. |
| 449 | The source-bound guide examples ran on both targets: FNV input `abc` emitted |
| 450 | `0be9471a` with exit 0, narrowing trapped with exit 105, and removing only the |
| 451 | unmasked store changed that exit to 44. x86 execution is EMULATED; AArch64 |
| 452 | execution is HOST_TESTED. |
| 453 | |
| 454 | Additive receipts are `seed/qualification/x86-linux/20261028-orphan-host.json` |
| 455 | and `20261028-orphan-corpus.json`. They record exact commands, binary/source |
| 456 | digests, the guard-removal negative control, every remaining obligation, and the |
| 457 | complete JSONL SHA256. Earlier failed and interrupted receipts are preserved. |
| 458 | Literal parity, current-C2 compatibility and historical kill assertions remain |
| 459 | unchanged; an explicit contract decision is required before any revised gate |
| 460 | scope. This repair is IMPLEMENTED and EXERCISED, not QUALIFIED, MERGED or DEPLOYED. |
| 461 | |
| 462 | Disassembly uses bounded chunks starting at decoded instruction boundaries, |
| 463 | with lookahead for crossing instructions. Every code byte and direct-branch |
| 464 | target is still checked, including large generated images; the child output |
| 465 | file limit is not treated as malformed compiler output or waived. |
| 466 | |
| 467 | ## Standalone qualification oracle |
| 468 | |
| 469 | ### Current acceptance contracts (2026-10-28 integration) |
| 470 | |
| 471 | At source `7ab5fdd067884fd3044155084b39163da1be5c8a`, the complete runner |
| 472 | reported 15179 PASS, 4 NOT_RUN and 222 EXCLUDED, with no FAIL cases. Its aggregate |
| 473 | verdict remains FAIL because NOT_RUN is not PASS. All three original large-input |
| 474 | SHA cases passed. Source `00ebdee8461467f26e7ec7b56289ab6549f2c0a2` then added |
| 475 | only the reviewed text-write driver: both previously unrun text-write cases and |
| 476 | the exit/encoding controls passed (5 PASS). The remaining unrun cases are the |
| 477 | two invalid-fd ioctl fixtures affected by QEMU's ENOTTY versus native EBADF. |
| 478 | The compiler binary is identical for both runs. Native x86 qualification and |
| 479 | independent review remain outstanding. The additive acceptance receipt records |
| 480 | both revisions and the original full-run verdict. |
| 481 | |
| 482 | Re-measured at source `62d1d0d668f897386a0e311374f8dbcc5c32dde8` (2026-10-30) |
| 483 | with the same compiler binary (sha256 `62775d2a…`), the pinned QEMU 10.0.14 |
| 484 | oracle (sha256 `fd7ae776…`) and omega-bridge at `1958a189` (x86 support merged): |
| 485 | 15182 PASS, 0 FAIL, 2 NOT_RUN, 222 EXCLUDED, runner exit 1, aggregate verdict |
| 486 | FAIL because NOT_RUN is not PASS. The three additional PASS rows against the |
| 487 | 2026-10-28 count are fixtures added since `7ab5fdd0` |
| 488 | (`seed/omc/contracts/forvalcontinue.om`, `seed/omc/contracts/forvalfinal.om`, |
| 489 | `tests/ecosystem663/metadata-test.om`). The two NOT_RUN rows are unchanged: |
| 490 | `seed/host/tests/devcall.om` and `seed/host/tests/uvmctl.om`, both classified |
| 491 | EMULATOR_ARTIFACT by the runner's own QEMU `-strace` challenge (invalid fd -1, |
| 492 | requests `0xc020462b` and `0x30000001`, QEMU errno 25 ENOTTY against the native |
| 493 | requirement of EBADF). x86 execution is EMULATED; AArch64 execution is |
| 494 | HOST_TESTED. Native x86 execution remains NOT_RUN. The additive receipt is |
| 495 | `seed/qualification/x86-linux/20261030-main-62d1d0d6.json`; the historical |
| 496 | receipt is unchanged. This measurement is EXERCISED, not QUALIFIED, MERGED or |
| 497 | DEPLOYED. |
| 498 | |
| 499 | The current integration preserves every frozen manifest and historical receipt. |
| 500 | Current acceptance applies the already declared `manifest-c2-capacity.txt`, |
| 501 | `manifest-c2-batch2.txt`, `manifest-c2-fpvreg.txt`, `manifest-c2-closerange.txt` and `manifest-c2-longnames.txt` deltas to their named rows, while separately replaying |
| 502 | the original rows against their pinned historical compiler. The old OM-1 |
| 503 | `s1-rot-refused` assertion likewise remains a historical replay; the current |
| 504 | assertion comes from `leak/candidate.cases` and requires OM-2 acceptance. |
| 505 | |
| 506 | `seed/omc/x86-diagnostic-contracts.json` declares exact diagnostics for specific, |
| 507 | source-hash-pinned inputs on each target. It retains all stack checks, source |
| 508 | coordinates and unrolled iteration records. Changed, missing or extra records |
| 509 | fail. Growth refusals require the declared error and empty output. For the |
| 510 | frozen branch-range cases that x86 accepts, the checker additionally decodes the |
| 511 | artifact and requires an explicit execution result; a default-target refusal |
| 512 | alone cannot qualify that target artifact. Inputs outside this table retain |
| 513 | the exact translated diagnostic comparison. |
| 514 | |
| 515 | The historical S2 mutant experiments include failed kills. Their original |
| 516 | expected PASS and observed FAIL remain in the replay record, with the exact |
| 517 | failure line. A successful reproduction means only that the old failed |
| 518 | experiment was reproduced; it is never evidence of a successful mutant kill or |
| 519 | current compiler acceptance. The current S1-S4 mutant suites remain separate. |
| 520 | |
| 521 | Repeated conductor decoding may reuse a result only for identical artifact |
| 522 | and source hashes. It does not cache case verdicts or skip conductor execution. |
| 523 | Empty text emits no literal bytes, so the decoder does not carve out an empty |
| 524 | data region. Native x86 execution remains a separate qualification requirement. |
| 525 | |
| 526 | `seed/omc/qualify-x86.py` is a read-only host verification oracle, not backend |
| 527 | implementation or a build/runtime dependency. The coordinator command |
| 528 | on AArch64 Linux is: |
| 529 | |
| 530 | ```sh |
| 531 | python3 seed/omc/qualify-x86.py --compiler /absolute/path/to/candidate/omc --objdump /usr/bin/x86_64-linux-gnu-objdump |
| 532 | ``` |
| 533 | |
| 534 | It requires Python 3, `qemu-x86_64` and an x86-capable objdump. `--inventory` |
| 535 | categorizes source files and `.cases` rows without invoking the compiler. |
| 536 | The inventory also includes the frozen `seed/qualification/om2/manifest-c2*.txt` |
| 537 | corpus alongside live fixture roots and composed `.cases` inputs. A frozen |
| 538 | manifest is not a substitute for accounting for new fixture files. |
| 539 | Results go to JSONL stdout and isolated temporary storage, not historical |
| 540 | receipts. Mode snippets, conductor self-tests and alternate-compiler arms are |
| 541 | accounted for separately. Reviewed, SHA-pinned host fixtures have dedicated |
| 542 | drivers for temporary files, normalized clock/random results, invalid-fd device |
| 543 | calls, private Unix sockets and ephemeral loopback sockets. The two executions |
| 544 | use separate architecture-local directories with identical argv0/environment. |
| 545 | Unreviewed host effects remain NOT_RUN, not automatic PASS; unresolved |
| 546 | implementation/input/driver gaps must fail the overall verdict. Resource limits |
| 547 | and a temporary working directory are not a security sandbox, so only trusted |
| 548 | fixture sources belong in the runner. |
| 549 | |
| 550 | Coverage distinctions must accompany any result: |
| 551 | |
| 552 | - `directories` and `fchdir` adapt their pinned `O_DIRECTORY` literal for the |
| 553 | target, with separate hashes; this is not identical-source parity. |
| 554 | - Entryless units are compiled/refused and fully decoded, but runtime is |
| 555 | NOT_RUN without an explicit composed caller. Existing wasm `cases.tsv` and |
| 556 | SPIR-V demo/regression tables supply full-width native wrapper callers. |
| 557 | - Embedded memory-check refusals and pread/pwrite view controls are included. |
| 558 | - The process fixture executes a native AArch64 child helper in both runs; |
| 559 | it does not establish exec of an x86 child. `genlimit` uses an explicitly |
| 560 | recorded fixture-only compiler variant with the fixture-required generation |
| 561 | ceiling 3 on both targets; the production compiler's ceiling is unchanged. |
| 562 | - `psync` invokes syncfs on the scratch descriptor and therefore flushes its |
| 563 | filesystem; a temporary directory does not isolate that kernel effect. |
| 564 | - `effect-scratch` (`seed/omc/x86_corpus_drivers.py` `effect_plan`) drives the |
| 565 | security673 and S5 conductors that launch programs or touch files, each keyed |
| 566 | by exact source sha: `pkt-consumer`, `runimage`, `embed`, `scrub-ctl`, |
| 567 | `scrub-mem`, `path-consumer`, `renames-consumer`, `exec-parent` and |
| 568 | `pure-child`. Inputs are SHA-pinned repository files copied into the private |
| 569 | per-architecture scratch; launched programs are the same native AArch64 file |
| 570 | in both runs (`exec-child` built natively from pinned `exec-child.om`, the |
| 571 | pinned evidence images, or the host `/bin/true`, `/bin/echo` and `/bin/tr` |
| 572 | pinned to Ubuntu coreutils 9.4-3ubuntu6.3 arm64, whose mismatch is BLOCKED). |
| 573 | Each run gets a 10-second CPU limit; only `exec-parent` raises |
| 574 | `RLIMIT_NOFILE` to 65600 because it duplicates a descriptor to 65537. |
| 575 | `pure-child` runs outside `execpure`, so it exits 43 at its first fd check; |
| 576 | its later arms are not exercised. `gate669.om` (sha `1f0e7222`) runs as the |
| 577 | x86 parent in a repository-shaped scratch: its 21 compiled, executed or |
| 578 | copied repository inputs (security673 corpora and consumers, the six |
| 579 | `seed/authority` gates, `effect-ok`, `seed/trace/sha256-gate.om`) are |
| 580 | SHA-pinned, `seed/rung4/om4.bin` is a copy of the operator compiler, and |
| 581 | `seed/omc/omc.om`, the source the gate rebuilds twice and compares, is copied |
| 582 | with its sha recorded. Its host children `/usr/bin/objdump` (binutils |
| 583 | 2.42-4ubuntu2.10 arm64) with its shared objects and loader, and `/bin/true`, |
| 584 | are pinned; any pin mismatch is BLOCKED. The full run and argument `3` |
| 585 | (#671 hostile ingress) must exit 0; arguments `0`, `1` and `2` are the gate's |
| 586 | own fail-closed controls (child exit 7, self-SIGKILL, 30-second deadline |
| 587 | overrun) and must exit 99. Only whole `elapsed_ns=<digits>` stdout lines, the |
| 588 | gate's wall-clock observations, are masked before the native/x86 comparison; |
| 589 | their count and every other byte and scratch file must match. Each arm has a |
| 590 | 300-second deadline. |
| 591 | |
| 592 | The disassembly check linearly decodes code bytes, including unreachable code, |
| 593 | while carving source-matched jump-protected literal spans. A mnemonic inventory |
| 594 | is not exhaustive instruction-template proof. The oracle includes an invalid |
| 595 | opcode control and a valid-but-wrong-immediate control; they must be rejected, |
| 596 | not merely disassembled. Both controls were exercised and caught. The complete |
| 597 | differential verdict was FAIL, not a qualification claim. |