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 / seed / host / MAPPING.md

439 lines · 31701 bytes Raw Blame History Rendered
1# Native mapped memory and checked device calls
2
3This extends the existing native-host compiler. It supports the strict Omega
427B experiment's memory prerequisite. It does not yet implement a GPU launcher,
5model execution, complete state rollback or a hardware performance comparison.
6The seed compiler and added tests are handwritten Omega. The existing shell
7bootstrap and test orchestration remain disclosed development tools.
8
9| Expression | Result and contract |
10| --- | --- |
11| `devctl fd request A off n` | Signed Linux ioctl result. `fd` is int; `request` is a literal uint; `A` is writable bytes; offsets/counts are ulong. Exact encoded size, checked range. Accepts FIONREAD, the existing encoded read/write NVRM F requests, or the five exact aien-gpu ABI1 A requests below. |
12| `mapnew fd offset bytes access mode` | Positive long handle or negative Linux errno. fd is int, offset/bytes ulong, access/mode literal ints. Access 1 means read, 3 read/write. Modes 1/2 mean shared/private file; 33/34 shared/private anonymous. Anonymous mappings require fd -1 and offset zero. |
13| `mapdrop handle` | Unmap the entire owned mapping. Zero on success or negative errno. Retires the slot on success; the next mapping gets a different generation. |
14| `mapread handle offset A off n` | Copy n bytes from the mapping into writable byte array A. Return n as long. |
15| `mapwrite handle offset A off n` | Copy n bytes from byte array A into a writable mapping. Return n as long. Read-only source views/text are accepted. |
16| `devcall fd request H hoff 32 P poff n` | RM_ALLOC or RM_CONTROL only. Binds a checked writable parameter span in a private header, sets its length, and copies back non-pointer fields. Caller pointer bytes must be zero; header and parameter spans must not overlap. Parameter length is at most 1048576 bytes (1 MiB); larger lengths trap 3 (exit 103). |
17| `uvmctl fd command A off n` | Literal Linux UVM request from the explicit ABI580.173.02 allowlist, with its exact writable payload length. |
18| `vfioctl fd request A off n` | Literal VFIO request from the allowlist below, with its exact byte count. Signed Linux ioctl result. `fd` is int; `request` a literal uint; `A` uchar bytes. |
19| `vfiomap fd A off 32` | Read-only shared mapping of one VFIO region. `A off 32` is the `vfio_region_info` returned by `DEVICE_GET_REGION_INFO`; its flags must contain READ and MMAP, and the compiler maps exactly its size at its offset. Returns a mapping handle or negative errno. `mapset`/`mapwrite` through the handle trap. |
20| `vfiomapw fd A off 32` | As `vfiomap`, but the region flags must contain READ, WRITE and MMAP and the mapping is shared read/write, so `mapget`/`mapset` drive device registers (one aligned access each, DSB SY on both sides). |
21| `eventfd initial` | `initial` is uint. Creates Linux eventfd2 with CLOEXEC and NONBLOCK, no semaphore mode; returns long fd or negative errno. Use existing `read`/`write` with exactly eight bytes, `waitio`/`pollfds` for readiness, and `fclose` for close. |
22| `vfioirq fd request A off n` | `fd` is int acquired by successful `vfioctl GROUP_GET_DEVICE_FD`; request is literal uint15213 (GET_IRQ_INFO) or15214 (SET_IRQS). A is writable uchar bytes, offsets/counts ulong. Checks exact caller-supplied argsz and the bounded IRQ contract below. Returns signed Linux ioctl result. |
23| `mapaddr handle` | The owned live mapping's base address as ulong, for driver address serialization. Does not permit access through an arbitrary integer address. Works on reservations. |
24| `mapget handle offset width` | Aligned uint32 or uint64 load, returned as ulong; width is literal int4 or8. Exactly one load, bracketed by DSB SY on AArch64 or MFENCE on x86-64. Requires readable memory. |
25| `mapset handle offset width value` | Aligned uint32 or uint64 store from ulong, returning long0; width is literal int4 or8. A uint32 store refuses truncation. Exactly one store, bracketed by DSB SY on AArch64 or MFENCE on x86-64. Requires writable memory. |
26| `maphold address bytes` | Reserve an unused, page-aligned span with PROT_NONE and MAP_FIXED_NOREPLACE. Address is at least64KiB and the whole span is below1TiB. Return an owned handle or errno. A kernel that ignores NOREPLACE is detected by checking the returned address; an unexpected result is unmapped and returns -95. |
27| `mapbind handle fd offset access` | Bind a shared file/device mapping to the entire owned reservation, with literal access1 or3. No existing data mapping may be replaced. Return long0 or errno. Failed bind with successful cleanup retires the handle. Function-mode double failure quarantines it for cleanup only (below). |
28| `cpufence` | Statement, keyword 199: a standalone host CPU publication barrier, AArch64 `DSB SY`, x86-64 `MFENCE`. It orders ordinary stores, for example `mapwrite` or plain array stores, before a later `mapset` doorbell or flag. A `mapget`/`mapset` access already carries its own barriers. See OMEGESE ยง10, "Host CPU ordering words". Proof: `seed/host/cpufence.sh`. |
29| `cpurelax` | Statement, keyword 200: spin-wait hint for a bounded `mapget` poll loop, AArch64 `YIELD`, x86-64 `PAUSE`. It gives no ordering. Proof: `seed/host/cpufence.sh`. |
30
31### Draft aien-gpu ABI1 ioctl admission
32
33**Trust-surface extension: Drake must approve this contract before merge.** The
34shared AArch64/x86-Linux `devctl` allowlist additionally admits exactly:
35
36| Request | Full Linux number | Direction | Writable payload bytes |
37| --- | --- | --- | --- |
38| `AGPU_IOCTL_INFO` | `0x80704110` (`2154840336`) | READ | 112 |
39| `AGPU_IOCTL_MEM_ALLOC` | `0xc0304121` (`3224387873`) | READ/WRITE | 48 |
40| `AGPU_IOCTL_MEM_FREE` | `0xc0184122` (`3222815010`) | READ/WRITE | 24 |
41| `AGPU_IOCTL_CHAN_CREATE` | `0xc0484123` (`3225960739`) | READ/WRITE | 72 |
42| `AGPU_IOCTL_CHAN_DESTROY` | `0xc0184124` (`3222815012`) | READ/WRITE | 24 |
43
44Source: `aien-dev/aien-gpu`, the ABI1 UAPI imported in CUDApp at
45`third_party/aien-gpu-abi1/aien_gpu_uapi.h`, last changed by
46`200015e6011d3c517803968fcccab52554c671be`, file SHA-256
47`1071e2a1338d258a654dc96f8c6d637db0e06fb4c47329cd73dc69fdf443eda7`.
48Linux `asm-generic/ioctl.h` defines direction at bit30, type at bit8,
49number at bit0 and size at bit16. READ=2 and WRITE=1. The aligned struct
50layouts and `_IOC` encoding are recomputed through Wolfram; the exact
51queries, results, UAPI pin and refusal matrix are recorded in
52`aien-ioctl-matrix.json`.
53
54Equality is over the **whole request**, not its type/number alone. Nonliteral
55requests, changed encoded sizes/directions/types, neighbours, `BOOT`,
56`ARENA_READ` and `RM_INIT` remain compiler error9 unless independently admitted
57by the unchanged FIONREAD/NVRM boundary. Even an admitted request traps3 when
58the writable view count is shorter or longer than its exact encoded size.
59An exact-length call reaches ioctl and returns the signed Linux result.
60The driver and caller still validate device identity, ABI version, reserved
61fields, flags, handles, address values and state. Admission is not a payload
62validator or authorization to open a GPU.
63
64CPU-only qualification is the handwritten Omega `aien-ioctl.om`: five exact
65requests, shorter/longer views, thirty encoded refusals and nonliteral
66refusals; native AArch64 execution, x86-Linux execution under QEMU, and
67AArch64 function-mode admission/refusal. Every executed ioctl uses fd-1,
68so no driver or device is opened. Native AArch64 expects EBADF (-9).
69QEMU 8.2.2 intercepts these unknown x86 requests before checking fd and
70returns ENOTTY (-25); the fixture requires that exact emulated result,
71not an EBADF/ENOTTY alternative. Its trace must show the five exact request
72numbers, no ioctl on short/long refusal, and an ioctl after the x86 guard
73mutant. This qualifies emitted admission and length guards, not x86 kernel
74or driver admission. Native x86, hardware and real driver integration are
75NOT_RUN. Four compiler mutants widen or narrow the allowlist or remove either
76backend's exact-length guard. A mutation counts as killed only at its intended
77admission or short-length assertion, never for an unrelated child/compiler failure.
78Only the last line is the verdict: `AIEN-IOCTL PASS ...` with exit 0. While a
79mutant runs, the case it breaks prints `AIEN-IOCTL expected mutant failure N`
80followed by `AIEN-IOCTL mutant killed M`; a FAIL line appears only for the
81unmutated compiler. Each mutant is located textually in `seed/omc/omc.om` (the
82`mfrom`/`mto` texts); a compiler change that respells or moves an anchor makes
83the step exit 92 with `AIEN-IOCTL INVALID mutant anchor ... (mutant not
84applied; not a compiler verdict)` naming the mutant and its occurrence count,
85before any case runs. Respell the anchor in the same change. An existing scratch
86directory (it must not exist) or an unbuildable mutated compiler exits 91, named.
87
88
89### Function and program mapping contexts
90
91`cpufence` and `cpurelax` are accepted in every function unit. An OM-2 function unit
92(first line `om2`, no `fn main`) may also use `devctl`, `mapnew`, `mapdrop`, `mapread`,
93`mapwrite`, `devcall`, `uvmctl`, `mapaddr`, `mapget`, `mapset`, `maphold` and `mapbind`.
94These words are supported on AArch64 Linux and `target x86linux`; they remain
95error9 in OM-1 function units and other targets (gate
96`seed/omc/om2/fnhost/fnhost.cases`). A handle is a long; `mapaddr` exposes only its
97owned live address, not general integer-pointer access.
98
99**Program mode remains unchanged:** its private raw128-slot table uses32-byte
100slots (address, length, generation, access) and eight low handle bits for slot+1.
101The129th live mapping returns-24 without calling mmap.
102
103**Function-mode context ABI (draft, Drake approval required before merge):**
104entry31 of the caller's runtime table (`LDR` from `[x7,#248]` on AArch64;
105`MOV` from `[r14+248]` on x86-64) is a data pointer
106to four u64 header words: capacity, generation base, generation limit, zero-reserved;
107then capacity32-byte slots. Capacity is1..4098. Handles use13 low bits for slot+1
108and50 generation bits; each slot starts at the caller's generation base and is
109incremented only on successful allocation, never beyond the header's limit.
110Slot exhaustion returns-24 without mmap. A caller must initialize the table,
111keep it alive and serialize accesses. Missing/invalid pointers are not checked
112stub calls and can fault; entry31 must really point at this format.
113
114The bridge gives each explicit context a distinct nonreused24-bit ID and26-bit
115per-slot generations: base=`id<<26`, limit=`((id+1)<<26)-1`. This prevents a
116foreign-context handle from aliasing a local generation. Default contextID1 has
117128 slots. Explicit contexts admit4098:4096 C NVRM allocation mappings, one
118usermode mapping and one transient slot. GPU channel VA bookkeeping uses no
119CPU mmap reservation. WolframLanguageEvaluator:
120`{4096+1+1,2^13-1,2^26-1,2^24-1,2^50-1,32+4098*32}`
121-> `{4098,8191,67108863,16777215,1125899906842623,131168}`.
122The last value is the table byte size. Context creation/destruction and read-only
123dispatch-table publication are the bridge compatibility ABI, not new Omega words.
124The caller quiesces all users/waiters before destruction, which refuses live
125slots; it also serializes whole multi-call transactions in a context.
126
127`mapbind` replaces only the whole live PROT_NONE reservation in this selected
128table. Before cleanup, function mode changes access to4 (quarantined): bind,
129read and write are refused but `mapaddr` and `mapdrop` retain ownership for
130cleanup. If cleanup munmap fails, trap3 leaves that quarantined owner live and
131the bridge returns nonzero status with outputs unchanged. Destroy must return36
132until a later `mapdrop` succeeds. If cleanup succeeds, the slot is fully retired
133and the original mmap errno is returned normally. Linux may leave a gap after
134MAP_FIXED failure: reservation preservation is not promised in either case.
135No external munmap/mremap/fixed replacement may interfere with owned ranges.
136This format supersedes the unmerged raw128-slot function-mode draft in#1040;
137mixing those compiler/runtime formats is unsupported and the bridge rejects a
138mapping unit with an incompatible compiler fingerprint. Program-mode tables
139and handles are not changed by this context extension.
140Mappings are between 1 byte and 64 GiB each. This bounds each extent, not the
141total physical memory the OS permits. Closing a file descriptor does not close
142its mapping. Close the mapping explicitly before reclaiming its backing object.
143
144Invalid/stale handles, range overflow, writes through read-only mappings, zero
145or oversized extents, inaccessible reservations, misaligned word access and
146malformed anonymous arguments trap with exit 103.
147An array's normal bounds and mutability checks still apply. Empty copies are
148allowed at the exact end of both spans, through a valid handle. Slot generation
149never wraps: exhausted generations are retired permanently. File offset alignment
150and device mapping permission errors come from Linux. Fixed-address binding is
151limited to entire owned reservations. There is no executable map, arbitrary
152syscall or access through an arbitrary integer address in this extension.
153
154These are process-local resource handles, not an authority or sandbox boundary.
155Fork inherits independent tables and Linux's ordinary shared/private map behavior;
156the new process must manage its copies. A successful file mapping does not verify
157the file's contents, prevent truncation, guarantee residency, or suppress Linux
158mapping faults. The owner must keep mapped files/device objects valid for the
159mapping's full lifetime. The model runner must freeze and verify weight identities.
160
161Device calls use checked byte spans. `devcall` supplies one scoped parameter
162pointer in a private32-byte NVOS21/NVOS54 header. It never copies that pointer
163back. This work does not qualify arbitrary device commands.
164The parameter cap is the default `RMAPI_PARAM_COPY_MAX_PARAMS_SIZE` in
165[`param_copy.h`](https://github.com/NVIDIA/open-gpu-kernel-modules/blob/20e4e6e1/src/nvidia/inc/kernel/rmapi/param_copy.h#L63).
166WolframLanguageEvaluator: `2^20` -> `1048576` bytes.
167The runtime passes the already checked caller span directly; only the private
16832-byte header is allocated on the stack, independent of parameter length.
169Large callers can use image-backed `global` arrays without a stack allocation.
170This does not change `devctl`: its payload size remains encoded in the ioctl request.
171GPU submission and mapped-device coherency require their separate existing
172runtime qualifications. Tests here open ordinary files, anonymous memory and
173pipes; compiler host tests do not open a GPU device or alter a running model.
174
175The UVM allowlist is INITIALIZE805306369/16bytes, MM_INITIALIZE75/8,
176REGISTER_GPU37/40, UNREGISTER_GPU38/20, REGISTER_GPU_VASPACE25/32,
177UNREGISTER_GPU_VASPACE26/20, REGISTER_CHANNEL27/56, UNREGISTER_CHANNEL28/28,
178MAP_EXTERNAL_ALLOCATION33/9264, FREE34/24 and CREATE_EXTERNAL_RANGE73/24.
179Only the Linux ABI from the pinned NVIDIA580.173.02 headers is covered.
180Independent GCC header-layout and GNU assembler instruction oracles were used
181while developing the runtime. They are not linked into the compiler or products.
182
183The VFIO allowlist (`_IO(';', 100+k)`, Linux `include/uapi/linux/vfio.h`) is
184GET_API_VERSION15204/0, CHECK_EXTENSION15205/4, SET_IOMMU15206/4 (value must be
185TYPE1v2 = 3), GROUP_GET_STATUS15207/8, GROUP_SET_CONTAINER15208/4,
186GROUP_GET_DEVICE_FD15210 (nonempty device name without zero bytes, copied with a
187terminator to private stack memory), DEVICE_GET_INFO15211/24,
188DEVICE_GET_REGION_INFO15212/32, IOMMU_MAP_DMA15217/32 and IOMMU_UNMAP_DMA15218/24
189(both checked as described under DMA below). DEVICE_RESET15215 is refused: W0 is approved
190without a device reset, so Omega code cannot request one. For spans of 8 bytes or
191more the compiler writes `argsz = n` before the call, so the kernel copies at most
192n bytes back. CHECK_EXTENSION and SET_IOMMU pass the 4-byte value read from the
193span. Every other request, a non-literal request, a non-uchar span or library
194mode is refused at compile time; a wrong count, a bad SET_IOMMU value or an empty
195device name traps 3 at run time. IRQ requests use the separate `vfioirq` word
196below; reset and migration remain excluded. Note that closing a vfio-pci device
197fd lets Linux reset the function (FLR) or, when every reset method is disabled,
198the bus (SBR); the allowlist cannot prevent that kernel behaviour.
199
200### Typed IRQ and eventfd extension
201
202The original profile extended compiler base
203`397e67040fb74853c6814097fe02ae4e1ebd6f66` (the historical driver pin).
204Current-main integration assigns `vfioctl`228, `vfiomap`229,
205`vfiomapw`230, `eventfd`231 and `vfioirq`232, preserving the existing
206efi/qty/peername/fma words. It emits AArch64 Linux syscalls directly.
207These additions are program-mode only; hosted x86 VFIO and function-mode
208VFIO are not implemented. Neither hardware IRQ delivery nor a driver-pin
209compatibility claim follows from host qualification.
210
211`vfioirq GET_IRQ_INFO` requires exactly16 bytes and an argsz field equal to16.
212The caller supplies flags/index/count bytes; Linux validates the IRQ index and
213reports capabilities. No capability chain beyond the fixed header is admitted.
214`SET_IRQS` accepts only these exact forms (all fields are Linux little-endian):
215
216| flags | count and payload |
217| --- | --- |
218| DATA_EVENTFD \| ACTION_TRIGGER =36 | count1..64; n =20+4*count, argsz=n. Each signed32 payload fd is a live eventfd created by `eventfd`, or -1 to deassign that vector. |
219| DATA_NONE \| ACTION_TRIGGER =33 | count0, start0, argsz=n=20; disables the selected IRQ index. |
220| DATA_NONE \| ACTION_MASK =9 or ACTION_UNMASK =17 | count1..64, argsz=n=20; no payload. The driver must first check GET_IRQ_INFO's MASKABLE capability; Linux enforces the device's masking support. The compiler does not invent that capability. |
221
222For every SET form, start+count must fit uint32. Index selection and actual
223device vector bounds remain kernel checks. Other flags, mismatched argsz,
224oversized counts and malformed payload sizes trap3 (exit103) before ioctl.
225Unlike older `vfioctl` records, `vfioirq` validates argsz rather than overwriting it.
226There is no DATA_BOOL, userspace trigger-without-eventfd, arbitrary ioctl or
227arbitrary syscall escape hatch.
228
229A separate private128-slot descriptor-kind table is keyed by the complete int
230fd, not indexed by its numeric magnitude. GET_DEVICE_FD and eventfd reserve a
231slot *before* their acquisition syscall; table exhaustion returns -24 without
232acquiring or closing a resource. Only successful acquisitions get a kind tag.
233`fclose` retires its tag before calling Linux, even when close returns an error.
234A successful `dupfd` (dup3) retires the destination tag; failed duplication leaves
235it unchanged. Duplication does not propagate tags. Helpers compiled before the
236first acquisition use the same table. Fork inherits the table; exec creates a
237new program table, and new eventfds have CLOEXEC.
238
239These are current-descriptor kind checks, not generation handles or an isolation
240boundary. Kernel fd-number reuse can make a stale integer name a newly acquired
241resource. Do not retain stale descriptors. Successful GET_DEVICE_FD is trusted
242under Linux's VFIO group-fd contract, not an authentication proof for arbitrary
243inherited descriptors or a malicious kernel. A raw/inherited device or eventfd
244is not admitted by `vfioirq`. Closing an eventfd does not explicitly deassign
245its VFIO IRQ registration: the driver must deassign/disable before closing the
246eventfd and device, then observe its normal channel quiescence contract.
247
248NONBLOCK prevents an empty eventfd read from blocking indefinitely; EAGAIN is
249returned unchanged. CLOEXEC prevents incidental eventfd inheritance across exec.
250Readiness, eventfd write/read success and the host fixture are not GPU completion
251or physical interrupt-delivery evidence. Kernel errors remain signed errno.
252
253Run `taskset -c 10-14 nice -n 10 sh seed/host/irq.sh` after the seed fixpoint.
254The GCC UAPI layout oracle compares C and Omega serialized records byte for byte.
255The ptrace fixture executes real ioctls against a memfd (ENOTTY); only the
256GROUP_GET_DEVICE_FD return is replaced to exercise the admitted-kind path.
257It checks actual syscall arguments and errno, descriptor invalidation, high
258numeric fds and capacity before acquisition. It never opens a VFIO/NVIDIA device.
259QEMU user-mode checks a VFIO-less refusal and translated eventfd behavior; it
260is not system-emulator VFIO delivery or hardware qualification. Compiler mutants
261must compile and execute and then be killed by the independent runtime oracle.
262Real VFIO IRQ delivery is NOT_RUN until Drake authorizes a hardware window.
263
264
265DMA: IOMMU_MAP_DMA15217/32 (`struct vfio_iommu_type1_dma_map`, vfio.h) never
266takes an address from Omega code. The caller writes an Omega mapping handle into
267the vaddr field (bytes 8..15) and the IOVA into bytes 16..23. The compiler checks
268the handle exactly as `mapget` does (live slot, matching generation), requires a
269read/write mapping and flags exactly READ|WRITE (3), then stores the mapping's own
270base address into vaddr and its whole length into size before the call; any
271failed check traps 3. So only a whole live mapping that the program owns can be
272handed to the IOMMU, and the IOVA is the only free choice. IOMMU_UNMAP_DMA15218/24
273requires flags 0 (no dirty bitmap, no ALL, no VADDR). Request numbers are shared by
274`_IO(';', 113/114)` with VFIO_DEVICE_PCI_HOT_RESET and VFIO_DEVICE_QUERY_GFX_PLANE on a
275device fd: hot reset refuses any non-zero flags with EINVAL (Linux
276drivers/vfio/pci/vfio_pci_core.c, `vfio_pci_ioctl_pci_hot_reset`, `hdr.flags` check),
277and MAP_DMA always passes flags 3; vfio-pci does not implement QUERY_GFX_PLANE.
278Unmapping or dropping an Omega mapping while it is DMA-mapped leaves the pages pinned
279by the kernel until the container is closed; the driver must unmap before dropping.
280`vfiomap` refuses a size of zero and region flags
281without READ|MMAP; it never requests PROT_WRITE. `vfiomapw` additionally requires
282WRITE and is the only VFIO word that maps device memory writable. Host tests use an
283invalid fd and a memfd stand-in; the device path is exercised only in the QEMU bench
284of aien-dev/omega-gpu-driver, not on hardware.
285
286Kernel constants/layouts are from Linux asm-generic/unistd.h, mman-common.h and
287linux/mman.h. AArch64 encodings use seed/rung2/table.s2. The device request rule
288comes from the reviewed L605 src/device/omc.om, source 0dee699. Existing host
289source is f0499f415571bdd7496b6de391096915e78f7556. These device words are on
290main: `hdevctl` is defined in seed/omc/omc.om (verified at main e5b32567).
291
292## Hosted x86-64 Linux lowering
293
294Hosted and program-mode x86 calls share the existing emitter. Mapping uses Linux
295`mmap` syscall9 and `munmap` syscall11; `devctl`, `devcall` and `uvmctl` use
296`ioctl` syscall16. The argument registers are RDI, RSI, RDX, R10, R8 and R9;
297RAX carries the signed result. No libc syscall wrapper is linked. Mapping flags
298are unchanged: MAP_SHARED/PRIVATE with the existing anonymous options,
299PROT_NONE|MAP_FIXED_NOREPLACE for `maphold`, and MAP_SHARED|MAP_FIXED for
300`mapbind`. Copies (`mapread`/`mapwrite`) are byte copies, not ordered MMIO;
301`mapaddr` only exports a checked owned address.
302
303The hosted admission set is the same as AArch64: the mapping/ioctl words above,
304`fclose`, `fopen`, `fstat`, `stat`, `lstat`, `getuid`, `geteuid`, `getgid`,
305`getegid`, `monons`, `realns` and `sleepns`, plus the existing basic input/output.
306There is no new generic syscall or arbitrary-address operation.
307
308`mapget` and `mapset` each emit exactly one aligned load or store between two
309MFENCE instructions. `cpufence` emits MFENCE and `cpurelax` PAUSE. Do not replace
310these fences with a compiler barrier based on ordinary write-back TSO: mapped
311device memory can be write-combining and weakly ordered. Intel SDM volume2B,
312order253667-093US, September2026, **MFENCE**, page4-15, guarantees that preceding
313loads and stores become globally visible before later loads or stores, and
314explicitly discusses weakly ordered memory types. **SFENCE** orders stores but
315not loads; MFENCE is the deliberately conservative common barrier for both
316operations. Source: [Intel SDM volume2B](https://cdrdv2.intel.com/v1/dl/getContent/671241).
317The compiler emits instructions in order without a host-language optimizer;
318there is no separate C compiler-barrier substitution. CPU ordering does not prove
319PCIe completion, GPU coherency or hardware suitability.
320
321The x86 emitter leaves R12 (native nonlocal return anchor), R14 (runtime table)
322and R15 (stack floor) untouched. RBX anchors the saved slot snapshot; R13 scratch
323is restored before returning. The ordinary program-mode initial argument stack
324in R13 is therefore preserved too.
325
326The hosted compiler cases pin both targets' emitted bytes. Wrong-mmap-syscall and
327missing-MFENCE compiler mutants must fail those byte checks; this is instruction
328structure evidence, not a claim that QEMU reproduces WC reordering. The bridge
329adds memfd/ioctl/C differential runtime fixtures under the x86 QEMU oracle.
330
331The draft ABI1 hosted-x86 superset stacks the #1046 lowerers and fixtures on
332#1047's exact five-request allowlist. Its seed0-born compiler fingerprint is
333`c5ac9979232afd0d750e1d5088af69692032997136f761e585a25aa9a1cfc87e`.
334This is a new profile, not an in-place replacement of the frozen AArch64
335`b8f8f137...`, previous hosted-x86 `cf4fcbbb...` or pure-x86 `be8c5130...`
336profiles. The bridge selects the new hosted-x86 fingerprint explicitly.
337Program mode retains its128-slot contract; function-mode context layout and
338ownership are unchanged. Drake must approve the draft compiler/bridge
339contracts before merge. Native x86, driver/GPU behavior and WC timing remain
340NOT_RUN unless separately qualified.
341
342The current-main landing rebuild of #1050 preserves every stack head, including
343#1046's original commits, and produces compiler fingerprint
344`96eda108a064e419a6cda9112d3bf56ab64f2265fb04f8bb62c08a0786569763`.
345The full native-host qualification and `tests/gates/run.sh om-units` pass with
346that compiler on Linux AArch64 under a device-hidden bwrap sandbox. This updates
347active compiler-consumer pins, not frozen bridge profiles or hardware evidence.
348
349The subsequent #1045 VFIO integration births compiler
350`b1d9cff6d765d85159e14d8346ed946704e32e9ca39554fb22a7c3f23fe0cca3`
351from source
352`5419943aad39c6205bb673c1ddb1be874b1877163cc2f143c07a742cf347456c`.
353Its508 source functions fit the unchanged512-function om4 seed;
354single-caller helper consolidation, not a seed-capacity change, provides the
355space. Descriptor-kind bookkeeping is restricted to program mode, retaining
356the existing function-mode host-word byte contracts. The full native-host
357gate passes under the device-hidden sandbox, including the IRQ runtime
358oracle and compiler mutants. This is host qualification, not hardware IRQ
359delivery or authorization to repin a downstream driver's compiler.
360
361The x86efi anchor fix (branch `hive/omega-mv-x86efi-semhash`) births compiler
362`5f90edea61bac241398df5036990d899361a5acd9decb37954ce088ec0f6f6df`
363from source
364`2c0fc44bdd607f9e84315e15c7c7ea263a5f0b6d83aa3f446fa6ed975e8ef34c`.
365Since #1050, `xhbegin` anchors the slot snapshot in RBX, but `xefival` still
366loaded the firmware ARG into RBX before reading the A and N slots and returned
367through an unset R14, so every `efi` operation faulted. `xefival` now saves the
368caller's R14 at snapshot offset 152, carries the anchor in firmware-preserved
369R14 across the call, loads ARG last and restores R13 and R14 from the snapshot
370tail. `tests/x86efi/run.sh` under QEMU/OVMF goes from 4/25 to 25/25; this is
371emulated, not hardware evidence.
372
373The execenv 233 host word (branch `hive/execprog-env`) births compiler
374`ee5fc83e357c7285e20ae9246d8129cdf8833b74f7205242e17fa62382334dfa`
375from source
376`062c9649af6a1d499b911e5b2f39b5419d7b75047616fe59fbcdc25f7b7b5b73`.
377`execenv A off n B off m` is `execprog` with a private environment packet B,
378decoded by a second `hpack`/`xhpack` pass; no function was added (508 of 512).
379Every one of the 1357 tracked `.om` files compiles to the same bytes, exit
380status and diagnostics under `5f90edea` and `cfd96b48`, so no existing unit's
381emission changes. Gate: `seed/host/execenv/execenv.cases`.
382
383x86 types `fma` operands before its error 9 (branch `fix/x86-fma-order`,
384OMEGESE.md 9.9) births compiler
385`0f2de85153b07656f4b992d101272987fe6ed1eee471ef70b132a37f5ba6b02f`
386from source
387`7d8026837cfcafe53222228f076e4dab58279ae78a4b008440e6262f5b3c91ab`.
388No host word changes and no function was added (508 of 512). Each of the 1485
389tracked `.om` files was compiled alone for AArch64 and for `target x86linux`
390under `cfd96b48` and `0f2de851`: 2962 of the 2970 compiles give the same bytes,
391exit status and diagnostics; the other 8 are the x86 compiles of the ill-typed
392`seed/omc/tests/float/neg_fma_*` refusals, error 9 before and now the AArch64
393error 7 or 11. Gate: `seed/omc/gate8.sh` (`refuse_x86`).
394
395The prlimit 235 host word (branch `seed/prlimit-host-word`, now on main as
396keyword 235 of `seed/omc/omc.om`; first born as `3c2817a5` on rad main `da8b7e66`, then merged with rad
397main `408c76b7`) births compiler
398`6d1b1cf5a44803389a831b67f750ea4cd1c9f53edfde9d6d9241d7352887f1f8`
399from source
400`7995e0e31bb3abcf9905fbb6257d56613b2dc67dd22be56f7396151fa84e7189`.
401`prlimit pid res A off n` is Linux `prlimit64`: AArch64 syscall 261 (`hprlim`,
402x0 pid, x1 res, x2 new, x3 old) and x86-64 syscall 302 (`xhprlim`, rdi pid,
403rsi res, rdx new, r10 old). `n` 16 passes new = NULL and old = &A[off]; `n` 32
404passes new = &A[off] and old = &A[off+16]; any other `n` sets -22 and skips the
405SVC/`syscall`. Two functions were added (510 of 512). Each of the 1496 tracked
406`.om` files was compiled alone for AArch64 and for `target x86linux` under
407`0f2de851` and `6d1b1cf5`: 2980 of the 2992 compiles give the same bytes, exit
408status and diagnostics; the other 12 are the AArch64 and x86 compiles of the six
409`seed/host/prlimit/` sources, which use the new word (error 3 before). Gate:
410`seed/host/prlimit/prlimit.cases`.
411Names of up to 63 bytes (branch `omc/long-names`, OMEGESE.md 9.2) birth compiler
412`3e46f1d9bdfd9c00ebdd1abb615d038d6db998e596b58482a6bdcc131f9af5c6`
413from source
414`4da2fd20f0c40d1d7aa85ddbd45a70cc5c35c5feaa925d34907b1a3ca7bc7416`.
415No host word changes and no function was added (508 of 512). Each of the 1485
416tracked `.om` files was compiled alone for AArch64 and for `target x86linux`
417under `cfd96b48` and `3e46f1d9`: 2948 of the 2970 compiles give the same bytes,
418exit status and diagnostics; the other 22 are 11 files that were error 13 under
419`cfd96b48` and are fragments or tests of that refusal (refused either way, or
420`seed/omc/om2/s1/bad-kw-field.om`, now `kw-long-field.om`, accepted).
421Gate: `seed/omc/gate-longnames.sh`.
422
423
424## Scheduler-word compiler pin (ham/om-threads, draft)
425
426Scheduler host words 236..240 are additive; first born on Radicle main a59a425b
427(`13a0c88c`, ham/om-threads-3 on f71942bb), now on `ham/om-threads-4`, stacked on
428`ham/omc-perf-loops-5` on Radicle main 12bdb787.
429The seed-born compiler is
430`0ed21175a1709cb755c289383cd8fcbfaac8330c3967fe4656b9f82fc96a3c4f`,
431from compiler source
432`232f89ebe688e81c289a9d0225dd06e4d8e8aaad8e489433634e7f8bf0b9b0a9`.
433The seed birth, both-parent equality and self-rebuild fixpoint were EXERCISED.
434The contract is in `spec/omegese-cpu-workers.md`; the full scheduler module is
435`seed/host/affinity/sched.cases`, included in `seed/host/check.sh`.
436All new words are program-only. No function-mode mapping context or device word
437changes. CPU threads and scaling are NOT_RUN in this head, deferred by parent
438mac-ham to a separate run. Historical compiler and mapping receipts above stay
439unchanged.