interplane.Get Omega
Read in your language

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

branch main Branches Tags History

omega-mv / docs / X86-LINUX.md

597 lines · 38654 bytes Raw Blame History Rendered
1# x86-64 Linux backend (FR-9)
2
3Status: **DRAFT; native x86 qualification NOT_RUN**, measured again 2026-10-30.
4The canonical integration base is `aien-dev/omega-mv` commit
5`d94a503f7aae57d09697046405da2e9a5895be6d`, with compiler batch 3 integrated
6at `7bce2a4fddc43268ac2af09cddc4a5a67d78312d`; the historical backend is
7`7eca2ac3fbd1f35a7d65471065408ce4bea07fd4`. Current implementation lives in
8`seed/omc/omc.om`. Source anchors describe implementation, not by themselves
9execution evidence. The dated baseline below is immutable history; resumed
10qualification 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 |
15seed/out/omc` is a static x86-64 ELF compiler. omc's own arena is a run-time pool (`global a_ar ulong *`),
16so this needed run-time pools on x86linux (OMEGESE 9.15): `xepool` (slot read after the operands, LEA, MOV,
17CMP, JAE trap 3), `pl_len`, the pool path of `vs_chk` / `xio`, and `xenlarge` (inline mmap 9 / mremap 25).
18An x86 element access of a global now loads the global's address into RDX at the access (`xbase`, ea_b
19254) instead of holding it in an operand slot, so an OM-2 unit that the AArch64 path compiles with pinned
20globals keeps the same operand budget on x86 (the Visor console needed it). Every byte is emitted by the
21handwritten `x*` emitters, each instruction with its Intel SDM volume 2 form in the source notes. `fopen`
22takes the language's open flags (Linux asm-generic values) and `xoflags` renumbers the four that x86-64
23numbers differently (O_DIRECTORY, O_NOFOLLOW, O_DIRECT, O_LARGEFILE) before `openat`; before this, an x86
24program's O_DIRECTORY open was an O_DIRECT open (found when the omega package left its temporary
25directories on x86-64; `tools/omega/gate.sh` now checks the directory open and the ENOTDIR refusal).
26
27Measured on Linux AArch64 (Lima VM) with the x86-64 programs under qemu-x86_64 (EMULATED; no physical
28x86-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
43Native x86 execution remains NOT_RUN until a run on an x86-64 machine is recorded.
44
45## Selection and implementation boundary
46
47The required opt-in is the exact first line `target x86linux`. Inputs without
48that line retain the AArch64 default. Target selection belongs in `xlead`,
49before `prescan` and normal parsing; it must preserve diagnostic line numbers.
50Whitespace variants, truncated/extended target names, a later target line, and
51combining the target with another output mode must not accidentally select a
52backend. The historical `xlead` token comparison is not itself sufficient proof
53of the exact-line contract: the tokenizer packs only the initial name bytes.
54
55The backend is handwritten Omega in `seed/omc/omc.om`, not a C, Python or
56assembly implementation behind an Omega facade. Shared semantic operations
57select x86 emission before the AArch64 `emit` path. `emit` refuses with error 25
58when a nondefault target reaches it. This is a refusal boundary, not a substitute
59for implementing a reachable language operation. The historical commit also
60contained `target x86efi` and a firmware boundary; those are removed from this
61Linux-only integration. FR-9 does not qualify PE32+, OVMF or physical firmware.
62
63## Instruction selection
64
65The backend lowers language operations directly; it does not decode AArch64
66words. `xb`, `xword`, `ximm`, `xrr`, and `xmem` emit bytes, little-endian
67immediates, REX prefixes, ModRM and (for a stack base) SIB. Hardware register
68numbers are private emitter operands, distinct from the language value IDs.
69The instruction references are the Intel SDM volume 2 entries cited beside the
70backend 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
84its relative displacement and a padding NOP; conditional branches use the long
85Jcc form. `xpatch` distinguishes their displacement positions. Calls have a
86separate rel32 fixup in `resolve`.
87
88The x86 byte output, like the AArch64 output, is part of omc's arena and grows with it (OMEGESE 9.6,
89since 2026-11-11; it was a 16 MiB pool here and 8 MiB for AArch64).
90Dead then-arms do not emit an unreachable skip branch past the final bare-unit
91instruction. Numeric and value `for` loops both check invariant obligations at
92the loop head, including final false heads and `continue` backedges.
93
94The historical backend refused floating-point paths. The current draft adds
95baseline SSE2 scalar lowering through `xfmov`, `xfsse`, `xfucom`, `xfbin`,
96`xfminmax`, `xfcmp`, `xfint`, `xftoint` and `xfconv`, routed from `fp_*`.
97Float bits retain the same frame slots; f32 extraction zero-extends its bits.
98Comparisons normalize unordered/parity handling to the existing boolean flag
99contract rather than adding a public condition code. The source implements
100signaling-NaN priority and quieting, numeric selection for quiet NaNs in min/max,
101signed-zero min/max, and default positive NaN for invalid arithmetic.
102Float-to-integer conversion truncates and saturates to the destination bounds,
103with NaN producing zero, rather than raising the checked integer-conversion
104trap. Unsigned 64-bit conversion has dedicated high-half handling. These are
105IMPLEMENTED source paths, not exercised IEEE parity claims; full fixtures must
106still cover arithmetic, comparisons, conversions, arrays, pools and structs.
107
108## Sixteen-value register model and frame map
109
110The parser's allocation model is retained; frame storage is not general spilling
111and 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
119The historical operand-ID holes `7` (runtime) and `16` (scratch) are retained.
120For **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
122new 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
124addresses values; RSP moves for local arrays and call reservations. R15 retains
125the owned-stack floor. RAX, RCX and RDX are commonly temporary integer operands;
126R11 temporarily retains the caller's frame pointer during prologue entry.
127
128The source constants for Linux startup are stack floor `268435456` and initial
129RSP `276824064`. `xcheck` compares prospective RSP against R15. `xsave` checks
130space 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
132argument/environment stack.
133
134## Internal ABI versus Linux SysV
135
136This is a private Omega calling convention, **not** the SysV C function ABI.
137`xsave` snapshots caller storage into a 256-byte reservation. `xarg` installs
138arguments in caller frame slots, and `xpro` copies parameters from the old RBP
139into 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.
141The existing six-parameter/slot accounting is a front-end contract; OM-2 unsized
142arrays additionally require their pointer/count slot accounting (`pwid`,
143`pslot`), not a scalar-only parameter loop.
144
145Bare-function output is now implemented by `xunit` using this same private
146frame ABI. Each exported entry occupies a six-byte JMP/NOP slot in source
147order; without exports, the unit enters its last function. `writeout 512`
148removes the image reservation, so the result is raw code, not ELF or an
149independently executable process. The caller must establish the private frame
150and owned-stack convention. Existing `fnstore` restrictions on globals/text,
151call-cycle checks and refusal boundaries remain in force.
152
153For bare units, physical R12 holds the wrapper's recovery-stack anchor, R14
154points to an immutable table of 32 runtime entry pointers, and R15 holds the
155owned-stack floor. These physical registers are distinct from language operand
156IDs. The native host-extension helpers overwrite R12/R14 in program mode and
157remain forbidden in bare units. Legacy byte `read`/`write` use the separate
158`xio` syscall path, preserve these registers and remain allowed in bare units.
159Before CALL, the wrapper supplies a separate 256-byte old-RBP slot area,
160including pointer/count argument slots, and at least 272 writable bytes below
161pre-CALL RSP for the return address, saved RBP and callee frame. The first
162prologue does not check this caller-owned initial allowance.
163
164A 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:
166there is no new return address and the current frame may be incomplete. The
167landing pad restores RSP from R12 and the wrapper's saved SysV callee-preserved
168registers and RBP, then returns the status without storing a result. It must
169validate trap codes and restore SysV alignment before any foreign CALL. Normal
170unit returns still produce their value in RAX through LEAVE/RET. Trap recovery
171does not roll back earlier writes or I/O.
172
173The raw compiler output itself has no SysV C-callable export, shared-object
174relocation contract, PLT/GOT, dynamic linker, libc startup or general foreign-call
175boundary. The separate omega-bridge x86 wrapper supplies the C boundary; its
176qualification is separate from the private compiler ABI. Linux syscall register
177conventions alone do not establish FR-7.
178
179## Linux syscalls and cross-architecture records
180
181The imported Linux implementation covers `read` and `write` through `xio`, and
182process termination through `xleave`. `xio` supplies fd in RDI, the checked byte
183slice address in RSI, count in RDX and the syscall number in RAX; SYSCALL returns
184in RAX. Its source selects `read`/`write` numbers with `c - 53`. `xleave` moves
185the status to RDI and uses syscall number 60. Caller frame storage must survive
186the architectural RCX/R11 clobbers. Raw kernel error returns must retain the
187existing host-word result convention, rather than silently becoming success.
188
189**Historical host gap:** imported `hostval` refused every nondefault target with
190error 25. The draft now contains an `xhost` dispatcher and native host helpers,
191including socket, polling and device/mapping routes; wiring and coverage are
192still being integrated. Their presence alone does not establish support for
193every 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)
196before `execve`, and a nonzero result skips the exec and returns that kernel error, matching the
197AArch64 descriptor boundary. Its argument packet has the AArch64 limits (1..1024 records, at most
19865536 bytes, an 81920-byte frame; `execenv` 90112), qualified under qemu-x86_64 by the `x86-*` rows
199of `seed/qualification/security673/packets.cases`.
200`execpure` (word 198) has no x86 strict-profile lowering (Landlock,
201seccomp and limits are AArch64-only); `xhost` refuses it with error 25.
202
203A complete host lowering needs a per-word x86 Linux syscall-number and
204argument-order mapping, checked against the x86 UAPI rather than
205`asm-generic/unistd.h`. Record layouts need a separate audit: `stat` fields and
206offsets, `timespec`, polling records, socket addresses/options, ancillary data,
207`iovec`/`msghdr`, wait results and architecture-dependent flags cannot be assumed
208portable by changing a syscall number. Private kernel records must be translated
209to the existing language-visible layout where those layouts differ. No kernel
210pointer may escape into a source scalar; slice bounds and refusal allowlists
211must remain enforced. Startup argument/environment support must preserve the
212initial Linux stack before replacing RSP. This paragraph is a design obligation,
213not 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
218for 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).
220The output is ELF64 little-endian ET_EXEC, without a PT_INTERP or dynamic
221linker. `xeof` emits startup after the functions, installs the owned stack,
222calls parameterless `main`, then exits. The Linux code reservation starts at
223byte 512 in the historical path.
224
225`mataddr`, `xaddr`, and `xfixaddr` retain address origin separately from integer
226constants and patch RIP-relative LEA displacements after layout. A numeric
227constant that happens to resemble a pool address must not relocate. Calls and
228branches are resolved against code byte offsets. Static fixed-address segments
229are 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
234site to process termination with status `100 + code` in program mode, or the
235runtime-table landing pad described above in bare mode. Trap numbers and
236source-level boundaries match AArch64, including signed overflow (1), division
237by 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.
239Linux termination is not a host signal oracle.
240
241Compiler refusal is distinct from runtime trapping: error 25 identifies an
242unsupported target/emission path, while existing parse, type, capacity and
243bounds refusals remain compiler errors. The historical program-only restriction
244has been replaced by the private bare-unit output described above. No unsupported
245construct may be represented by empty emission or a fallback AArch64 instruction.
246
247## Integration gaps and acceptance evidence
248
249The historical import lacked host words beyond byte I/O/exit, floating-point
250lowering, OM-2 unsized-array checks, pointer/count parameter accounting and newer
251semantic operations. The current draft adds SSE2 lowering, an `xhost` dispatcher,
252`nm_lr` checks in `xelem`, parameter-slot integration, and core/layout/rotate
253lowering (`xrot` among the native helpers). These are source integration changes,
254not execution evidence. The guard against AArch64 emission remains required.
255
256The historical target-name prefix comparison is now length checked in `xlead`;
257the exact-first-line contract still needs its complete negative controls.
258Bare-function and multi-entry output boundaries, all host records and every
259current language path must be accounted for by the final differential. No gap
260listed here is an approved reduction of FR-9 scope. Final source pins and
261exercised coverage must supersede draft observations before FR-9 is complete.
262
263Acceptance requires the **full existing fixture differential**, not a selected
264integer subset: default AArch64 bytes/refusals/diagnostics unchanged against the
265independently pinned baseline; x86 results, stdout/stderr, side effects and trap
266statuses compared to the corresponding AArch64 executions; documented treatment
267of architecture-specific fixtures without silently omitting them. An independent
268`objdump` instruction oracle must inspect emitted instructions and fixups, and
269wrong-encoding mutants must demonstrably fail that oracle or the behavioral
270checks. Record exact commands, source/compiler pins, baseline hashes and both
271expected and observed results. An x86 QEMU run is **EMULATED**; it is not a
272physical x86 execution receipt. Full acceptance remains pending for this draft.
273
274## Seed impact
275
276The compiler source and its generated seed compiler are separate artifacts.
277Adding x86 output does not replace the AArch64 seed ladder or authorize editing
278handwritten bootstrap rungs. The source remains within om4's unchanged
279512-function table: two one-use ELF/relocation helpers were inlined after a
280514-function candidate correctly failed bootstrap error 14. No bootstrap gate,
281table capacity, seed0, hex1, asm2 or om4 was weakened or replaced. (That table is om4 `d0da40e4`;
282the `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
308The full cross-target runner completed with verdict **FAIL**: 7,537 PASS,
309152 FAIL, 399 NOT_RUN, five MISSING_IMPLEMENTATION, 570 EXCLUDED and
310257 MISSING_INPUT records. Both encoding mutants were caught. Exact pins,
311command, counts and unresolved cases are recorded in
312`seed/qualification/x86-linux/20261028.json`; the unchanged complete JSONL
313is preserved at the path and SHA256 recorded there. This is not stage-C PASS.
314
315Failures include contract `forfinal`/`forcontinue` refusal, x86 output capacity
316on C2 case 05712, four bare-unit direct-branch boundary failures, structured
317diagnostic positions, explicit-refusal oracle mismatches and device fixtures.
318Uncomposed bare callers, unreviewed host drivers and missing SHA fixture inputs
319also remain. These are not silently excluded from the overall failing verdict.
320
321For the invalid-fd `devcall` discrepancy, a minimal trace returned EBADF (9)
322on AArch64, while QEMU translated the same x86
323`ioctl(-1,0xc020462b,...)` to ENOTTY (25). No backend errno shim or weakened
324gate was introduced. This dated baseline did not satisfy full stage-C
325acceptance; the resumed run must retain the original cases and explain each
326remaining deviation.
327Native x86 execution and a native x86 seed0 chain are **NOT_RUN**.
328
329Word-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
332oracles only, not production dependencies of the emitted static programs.
333
334## Resumed differential and operator wrap-up
335
336The complete resumed run at `66807b62914461b88df5ac73b827a8c809a854b4`
337used QEMU 10.0.14 and the original/private/bridge callers. It remained **FAIL**:
3388,243 PASS, 476 FAIL, 211 EXCLUDED, six NOT_RUN and one
339MISSING_IMPLEMENTATION. These counts are not directly comparable as a fixed
340denominator: previously excluded metadata/conductor arms and missing inputs
341were expanded into exercised cases. All 570 original exclusions and all
342remaining exclusions are individually recorded in
343`seed/qualification/x86-linux/20261028-resumed.json`, alongside unresolved
344records, hashes, commands and the exact counting rule. The historical baseline
345has 152 top-level FAIL records; its summary is not another failing case.
346
347At `4f14b2d8f1eeb470836fcd2adf1e6ad5b7608c16`, the source additionally repaired
348OM-2 constant-index temporary allocation and missing x86 trap-site diagnostics.
349The SHA unit compiled for both targets
350and the contract diagnostic fixture emits matching source-site records after
351target-prefix line translation. The seed ladder rebuilds to compiler SHA256
352`7d1739cc46c04bb8b585c5a255690ae58e30e9ffaa329defa19da3375c5fa316`.
353Additional entryless callers and trap authorities are implemented in the oracle.
354The full differential after those changes was **NOT_RUN** at that operator
355wrap-up. Do not attribute the earlier counts or host gates to that unrerun patch.
356
357The recovered source `efd15c234afc584e1e67492e736cbb42806c2a7d` (source
358SHA256 `e9d70e7cbe1b7026b2fcac5bbf61a64bde931b50a632c954355ba5299954a61c`,
359AArch64 compiler `f7752bc5c800e85c2393a08153786d0a6bc4516c9cea955fe27624228d6d1409`)
360passed `sh seed/host/check.sh` and `sh seed/omc/gate5.sh` on the AArch64 host.
361Its complete differential exited 1: **14,930 PASS, 60 FAIL, 10 NOT_RUN,
362216 EXCLUDED**. Verdict **FAIL**. The remaining failures are structured
363diagnostic mismatches, unclean expansion-growth refusals, OM-2 fold/unroll
364mutant 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
367EMULATOR_ARTIFACT cases and eight entryless callers remain NOT_RUN. Exact case
368names and receipts are in `seed/qualification/x86-linux/20261028-recovered-corpus.json`
369and `20261028-recovered-host.json`.
370
371Two invalid-fd ioctl cases in the resumed run have concrete emulator evidence:
372QEMU's own trace records request `0xc020462b`, fd `-1`, errno ENOTTY, while the
373native 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)
375returns `-TARGET_ENOTTY` for an unknown request before checking the descriptor.
376The receipt pins the source, source archive, emulator binary and trace. These
377are NOT_RUN/EMULATOR_ARTIFACT records, not backend PASS or native-x86 evidence.
378
379## Corpus authority and compatibility
380
381The 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
400The original C2 compatibility contract conflicts with intentional later native
401changes, including corrected `getppid`, the socket-option safety allowlist and
402expanded name/function capacities. Those failures remain visible. Revising the
403contract requires an explicit decision; neither reverting safety fixes nor
404silently replacing current-candidate checks with historical replay is allowed.
405
406### Recovered OM-2 growth bound
407
408Through omc f4fa7951 the x86 byte emitter enforced the per-function emitted-storage budget of the
409AArch64 word emitter (262144 bytes in an OM-2 function). Since 2026-11-11 neither target has that
410budget (OMEGESE 9.6); x86 branches are rel32, and the expansion-fuel bounds remain unchanged.
411The existing growth fixtures must refuse with error 14 and empty stdout;
412their diagnostic twins must retain `obligation=growth`. Rolled and OM-1 controls
413remain accepted. Removing only the new guard is the negative control.
414
415Different instruction sizes reach that storage ceiling at different source
416locations. The corpus deliberately retains its literal cross-target refusal
417and diagnostic equality assertions: a clean refusal does not turn a different
418source 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
420imitate AArch64's program-mode-only stack checks.
421
422The interrupted current-compiler mutant repairs re-anchor the S2 cycle and S3
423error-16 substitutions to their intended guards and distinguish the x86
424constant-index guard from the unchanged AArch64 occurrence. Historical mutant
425sources and frozen receipts remain unchanged. A5 kept-constructor and rotate
426bare-unit callers use the independently recorded exits in
427`candidates/s4/export/sec5.cases`, rather than incorrectly requiring exit zero.
428
429Source `3e66b6744590cc72c623d8e09413b9072bcab36e` (compiler source SHA256
430`4b5392fffd25a3a37844ad8bb5138fbaada690be7dae95132614524bdb78a1e0`)
431rebuilds to seeded compiler
432`badedbb0c6287887641fcd7e97301b43b5f82f2d7a2838bbe0d17547873108be`.
433The seed ladder, `sh seed/host/check.sh` and `sh seed/omc/gate5.sh` passed.
434The complete corpus exited 1: **14,936 PASS, 54 FAIL, 10 NOT_RUN,
435216 EXCLUDED**, verdict **FAIL**. All 15,216 outcome-row case names and their
436multiplicities match the preceding complete corpus; no failing case was removed.
437Both independent encoding mutants were caught.
438
439The 54 remaining FAIL records are 17 literal successful-diagnostic mismatches,
4408 growth-refusal coordinate mismatches, 16 historical S2 mutant obligations,
44112 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.
443Two formerly passing S2 growth records now fail literal coordinate parity:
444both targets cleanly refuse error 14, but their emitted-storage ceilings cross
445at different source tokens. These are not relabelled PASS.
446
447The ten NOT_RUN records remain two concrete QEMU ioctl artifacts and eight
448entryless diagnostic-site callers. Native x86 execution remains NOT_RUN.
449The 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
451unmasked store changed that exit to 44. x86 execution is EMULATED; AArch64
452execution is HOST_TESTED.
453
454Additive receipts are `seed/qualification/x86-linux/20261028-orphan-host.json`
455and `20261028-orphan-corpus.json`. They record exact commands, binary/source
456digests, the guard-removal negative control, every remaining obligation, and the
457complete JSONL SHA256. Earlier failed and interrupted receipts are preserved.
458Literal parity, current-C2 compatibility and historical kill assertions remain
459unchanged; an explicit contract decision is required before any revised gate
460scope. This repair is IMPLEMENTED and EXERCISED, not QUALIFIED, MERGED or DEPLOYED.
461
462Disassembly uses bounded chunks starting at decoded instruction boundaries,
463with lookahead for crossing instructions. Every code byte and direct-branch
464target is still checked, including large generated images; the child output
465file 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
471At source `7ab5fdd067884fd3044155084b39163da1be5c8a`, the complete runner
472reported 15179 PASS, 4 NOT_RUN and 222 EXCLUDED, with no FAIL cases. Its aggregate
473verdict remains FAIL because NOT_RUN is not PASS. All three original large-input
474SHA cases passed. Source `00ebdee8461467f26e7ec7b56289ab6549f2c0a2` then added
475only the reviewed text-write driver: both previously unrun text-write cases and
476the exit/encoding controls passed (5 PASS). The remaining unrun cases are the
477two invalid-fd ioctl fixtures affected by QEMU's ENOTTY versus native EBADF.
478The compiler binary is identical for both runs. Native x86 qualification and
479independent review remain outstanding. The additive acceptance receipt records
480both revisions and the original full-run verdict.
481
482Re-measured at source `62d1d0d668f897386a0e311374f8dbcc5c32dde8` (2026-10-30)
483with the same compiler binary (sha256 `62775d2a…`), the pinned QEMU 10.0.14
484oracle (sha256 `fd7ae776…`) and omega-bridge at `1958a189` (x86 support merged):
48515182 PASS, 0 FAIL, 2 NOT_RUN, 222 EXCLUDED, runner exit 1, aggregate verdict
486FAIL because NOT_RUN is not PASS. The three additional PASS rows against the
4872026-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
491EMULATOR_ARTIFACT by the runner's own QEMU `-strace` challenge (invalid fd -1,
492requests `0xc020462b` and `0x30000001`, QEMU errno 25 ENOTTY against the native
493requirement of EBADF). x86 execution is EMULATED; AArch64 execution is
494HOST_TESTED. Native x86 execution remains NOT_RUN. The additive receipt is
495`seed/qualification/x86-linux/20261030-main-62d1d0d6.json`; the historical
496receipt is unchanged. This measurement is EXERCISED, not QUALIFIED, MERGED or
497DEPLOYED.
498
499The current integration preserves every frozen manifest and historical receipt.
500Current 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
502the original rows against their pinned historical compiler. The old OM-1
503`s1-rot-refused` assertion likewise remains a historical replay; the current
504assertion comes from `leak/candidate.cases` and requires OM-2 acceptance.
505
506`seed/omc/x86-diagnostic-contracts.json` declares exact diagnostics for specific,
507source-hash-pinned inputs on each target. It retains all stack checks, source
508coordinates and unrolled iteration records. Changed, missing or extra records
509fail. Growth refusals require the declared error and empty output. For the
510frozen branch-range cases that x86 accepts, the checker additionally decodes the
511artifact and requires an explicit execution result; a default-target refusal
512alone cannot qualify that target artifact. Inputs outside this table retain
513the exact translated diagnostic comparison.
514
515The historical S2 mutant experiments include failed kills. Their original
516expected PASS and observed FAIL remain in the replay record, with the exact
517failure line. A successful reproduction means only that the old failed
518experiment was reproduced; it is never evidence of a successful mutant kill or
519current compiler acceptance. The current S1-S4 mutant suites remain separate.
520
521Repeated conductor decoding may reuse a result only for identical artifact
522and source hashes. It does not cache case verdicts or skip conductor execution.
523Empty text emits no literal bytes, so the decoder does not carve out an empty
524data 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
527implementation or a build/runtime dependency. The coordinator command
528on AArch64 Linux is:
529
530```sh
531python3 seed/omc/qualify-x86.py --compiler /absolute/path/to/candidate/omc --objdump /usr/bin/x86_64-linux-gnu-objdump
532```
533
534It requires Python 3, `qemu-x86_64` and an x86-capable objdump. `--inventory`
535categorizes source files and `.cases` rows without invoking the compiler.
536The inventory also includes the frozen `seed/qualification/om2/manifest-c2*.txt`
537corpus alongside live fixture roots and composed `.cases` inputs. A frozen
538manifest is not a substitute for accounting for new fixture files.
539Results go to JSONL stdout and isolated temporary storage, not historical
540receipts. Mode snippets, conductor self-tests and alternate-compiler arms are
541accounted for separately. Reviewed, SHA-pinned host fixtures have dedicated
542drivers for temporary files, normalized clock/random results, invalid-fd device
543calls, private Unix sockets and ephemeral loopback sockets. The two executions
544use separate architecture-local directories with identical argv0/environment.
545Unreviewed host effects remain NOT_RUN, not automatic PASS; unresolved
546implementation/input/driver gaps must fail the overall verdict. Resource limits
547and a temporary working directory are not a security sandbox, so only trusted
548fixture sources belong in the runner.
549
550Coverage 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
592The disassembly check linearly decodes code bytes, including unreachable code,
593while carving source-matched jump-protected literal spans. A mnemonic inventory
594is not exhaustive instruction-template proof. The oracle includes an invalid
595opcode control and a valid-but-wrong-immediate control; they must be rejected,
596not merely disassembled. Both controls were exercised and caught. The complete
597differential verdict was FAIL, not a qualification claim.