interplane.Get Omega
Read in your language

omega-bridge

Omega-first language interoperability: checked conversion backends and native language bindings

Brought by drakestapleton

branch main Branches Tags History

omega-bridge / docs / CAPABILITIES.md

369 lines · 28121 bytes Raw Blame History Rendered
1# Bridge v0 capability contract
2
3Input is the pinned seed's Omega program/function language, further bounded below. The shell entry point snapshots the source, asks the pinned Omega compiler to check the entire unit, then sends the same bytes to the Omega target compiler. Both targets consume the same typed nodes. The private build/bridge executable is an internal emitter, not a standalone validation API. Use tools/bridge.
4
5| Feature | C output | Python output |
6|---|---|---|
7| bool; unsigned/signed 8, 16, 32, 64-bit scalars | supported | supported using canonical 64-bit bits |
8| explicit checked numeric conversions | supported | supported |
9| unsigned arithmetic | wraps at declared width | same |
10| signed add/sub/mul/neg/shl overflow | trap 1 | same |
11| div/rem | truncation toward zero, zero divisor trap 2; min/-1 division trap 1; remainder zero | same |
12| shifts | arithmetic signed right shift; invalid amount trap 7 | same |
13| eager left-to-right operands/call arguments | sequenced GNU statement expressions | Python argument order |
14| if/else, bounded while, for | supported | supported |
15| forward/mutual calls and recursion in programs | supported within resource budget | same |
16| new arrays, global pools, view/edit parameters, get/put/len | checked; actual element widths; readonly views are `const void *` | bytearray for uchar (immutable `bytes` also accepted for a readonly uchar view), list for other widths |
17| read/write/exit in programs | POSIX, negative errno returned in long bits | os read/write, same errno mapping |
18| callable function units without main | generated checked C ABI wrappers | generated checked module functions |
19| text constants (`text NAME "..."`), baseline `tools/bridge` only | exact decoded bytes as `static const uint8_t` plus a separate length; get/len/write and readonly view arguments | immutable `bytes`; same |
20| inline text literals in expressions | refused by the seed, error 16 | same |
21| floating point, heap, free, own, reflection, concurrency, GPU, external calls | refused by seed or bridge | same |
22| arbitrary C/Python input | no frontend | no frontend |
23
24Capacity limits: input including the target selector is below 1,048,576 bytes, output at most 4,194,304 bytes, 32 functions, four parameters per function (arrays expand to address/length), eight globals (texts and global arrays share this table), 32,768 decoded text bytes per unit, 32 live locals, 32 block levels including the function, 1,024 expression nodes per statement, eight-character names. Global arrays have at most 524,288 elements. Local arrays total at most 32,768 bytes per function. Capacity exhaustion is a compile refusal (14, 23 or 24), never a partial generated file. The seed has further checked register and grammar limits.
25
26Text (docs/TEXT-CONVERSION.md): the bridge decodes exactly the seed's four escapes (`\n`, `\t`, `\\`, `\"`) and keeps every other byte inside the quotes, including raw NUL, CR, tab and bytes 128-255; empty text has length zero and no terminator. Output contains only decimal byte initializers, never source bytes. Writes, reads and edit arguments into a text are refused by the seed (error 20) and again by the bridge. Note bodies are skipped untokenized outside cabi library modes, so note bytes the seed ignores no longer cause a bridge error 16. The seeded frontends (`tools/bridge-seeded`) still refuse text.
27
28Resource boundary: generated execution has a 128-active-call limit, reported as trap 6. Native Omega instead checks its eight-MiB machine stack. Their exhaustion thresholds differ. Only executions within the bridge budget are claimed equivalent; t_stack verifies the eventual trap code only. C hosts must provide an eight-MiB stack. Resource consumption, allocation failure and OS signal/restart behavior are not cross-runtime equivalence claims. Python uses its host heap for fixed-size arrays and interpreter state; the Omega source language has no heap operations. This is not a no-allocation Python runtime.
29
30For loops evaluate a compound count once; a variable count is read each iteration. Variable-count for loops and while loops have a default one-million-iteration guard. Explicit while bounds retain the seed's allowed range. Arrays are never returned, transferred or stored as references. View writes, shape mismatches and overlapping array arguments inside Omega are refused by the shared frontend. Runtime bounds are always enabled.
31
32Full-program results are compared byte-for-byte on stdout/stderr and process status. Trap exits are 100 + code; explicit exit and main return use the low eight bits. I/O tests use ordinary pipes/files with no asynchronous signals. Neither backend optimizes away checks.
33
34Other conversion targets need a real emitter, capability checks, reference executor, differential corpus and an attachment gate; no language other than C and Python has a converter. Calling a compiled Omega function in place from C, C++, Python, Rust, Zig or Go is the native call adapter (docs/NATIVE-ABI.md): `tools/native` builds the library and writes each language's declarations from the Omega signatures. That is a call into Omega's machine code, a separate claim from conversion. JavaScript, Java, C#, Fortran and other languages have no implemented or tested adapter here.
35
36The seed's optional grouped-expression syntax and explicit `view A` argument prefix are not lowered by this bridge; use ordinary prefix expressions and view-typed parameters. Source constructs beyond the table may be accepted by the seed and then refused by the target compiler. Error 24 includes an unsupported-capability diagnostic; errors 13/14/23 identify name, table/output or storage limits. No target output is published on these failures.
37
38## Additive seeded frontend
39
40`tools/bridge-seeded c|python|h SOURCE.om` is an explicit frontend mode for
41omega-mv `e5b32567`, requiring `OMEGA_SEEDED_OMC` with sha256
42`2c82480596bbdc50cda9626866209ef662d5834f278f839ff4ce0250c495029f`.
43The source snapshot is checked by that exact compiler before conversion. A
44different compiler fingerprint refuses with status 65 and no target output.
45This mode keeps `tools/bridge`'s baseline seed
46`191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9` and the
47required `tools/test.sh` suite, but the shared `src/toc.om` emitter changes
48baseline `tools/bridge c|python` output text: exported scalar parameters of
49narrowing functions become `volatile`, the `o_get`/`o_io`/`o_buf` helpers take
50`const void *`, and unused loop counters are no longer emitted. The behavior
51suites (`tools/test.sh`, seeded, seeded-float, freestanding) are unchanged and
52pass; byte-identical output to the previous `tools/bridge` is not claimed.
53
54The additive mode accepts at most 1024 numeric constants (integer, `f32` or `f64`; error 14 beyond), 512 functions,
55six parameters per function, function names up to the frontend's 63-byte limit
56(other names retain its limits), fixed view/edit shapes up to
5716,777,216 elements, explicit `view`/`edit` call prefixes and bounded-loop
58`break`. Seeded C also supports `continue` within a checked enclosing loop.
59Default variable-loop and while guards match omc's 1,000,000-pass trap 4. Source and
60emission storage are bounded at 1 MiB and 4 MiB; seeded local array storage is
61bounded at 16 MiB, while the baseline local-storage refusal remains 32 KiB.
62Checked arithmetic, bounds, alias refusals, call budget and no-heap restrictions
63remain enforced. Text constants (refused, error 24) and external calls remain unsupported in this mode.
64These are implementation bounds, not performance measurements.
65
66Seeded C permits binary32 (`f32`) and binary64 (`f64`) scalars, including typed public parameters/results:
67float constants (`const K f64 0.1`; a suffixed literal is error 16 and an integer literal error 16,
68as in omc), typed or suffixed float literals in expressions, `add`/`sub`/`mul`/`div`, `neg`,
69`fabs`, `fsqrt`, ordered comparisons and `eq`/`ne`, int<->float and f32<->f64 conversions (an integer
70literal under a float conversion is typed `long`, as in omc), and same-width bitcasts
71between `f32` and `uint` and between `f64` and `ulong`/`long`. Operations go through `o_fp`/`o_fcv`
72with explicit ARM (AArch64) NaN propagation and FCVTZS/FCVTZU saturation, so results match the
73seeded omc's AArch64 bits. Decimal conversion reuses the pinned Omega e5b32567 implementation,
74including its limits: at most 2^63-1 significant digits (error 8) and overflow to infinity
75refused (error 8). That conversion is not always correctly rounded (aien-dev/omega-mv#1024);
76the converter reproduces omc's bits, and `tests/seeded_float.py` pins the two known misrounded
77literals. Storage is canonical IEEE-754 bits. Fast-math and incompatible binary32/binary64
78implementations are refused at C compilation. The `fsqrt` compatibility lowering uses the host's
79AArch64 FSQRT or x86-64 SSE scalar square-root instruction and normalizes NaN propagation to AArch64;
80it adds no libm dependency. Other host architectures are refused at C compilation.
81Where omc refuses a float program the converter reports omc's error code. Accepted but unlowered
82features (`f64` arrays, float shift counts, untyped float literals as a left operand,
83`int`/`long`-with-`f32` bitcasts) are refused with error 24, as are all Python and
84baseline float inputs. No approximate integer substitute is emitted.
85
86Seeded C views/edit arrays additionally admit `ushort`, `uint` and `f32`.
87Local and global `f32` arrays use fixed-width `uint32_t` raw IEEE bits; unsigned
88arrays use `uint16_t` and `uint32_t`. Loads/stores use alias-safe fixed-width
89builtin copies on the required little-endian host, retaining NaN payloads and
90signed zero without per-element byte loops. Unsigned operators still wrap at the declared width. Public
91arrays remain borrowed `void *`/`const void *` plus an exact element count.
92Alignment, wrap, result overlap and mutable-view alias checks use the declared
93element size (2, 4 or 8 bytes), not the old uchar/ulong-only assumption.
94Public scalar `f32`/`f64` parameters and result pointers are C `float`/`double`;
95integer scalars retain canonical uint64_t bits. Only success writes the result.
96Global arrays are standalone-program features: the pinned compiler refuses its
97global pool in function mode with error 9, before the converter emits anything.
98`tests/seeded_views.py` executes the pinned omc and emitted C on exhaustive u16
99values, edge cases and 2^20 deterministic random u32/f32 patterns (host and
100qemu-x86_64), and checks out-of-range refusals, runtime boundary errors and
101per-feature killed mutants.
102The same test checks GCC `-O2` AArch64 assembly for one scalar 16/32/64-bit
103load/store at constant-width calls and kills a restored-byte-loop mutant.
104The checked borrowed-view profile of `bridge-freest` shares this typed C lowering
105and ABI, but uses an import-free explicit status context instead of hosted traps.
106
107Function units export only their final function, using `omega_NAME`.
108`h` validates every function body through the same emitter before emitting the
109C declaration from checked signature metadata. Exported scalar value parameters
110are volatile inside the checked setjmp wrapper; the public ABI is unchanged.
111The result pointer comes first; integer scalars use canonical uint64_t bits; arrays
112use address and element-count pairs. Counts must equal the declared fixed
113shape. ABI statuses are 0 for completion, 1 through 14 for Omega traps, 32 for
114invalid host arguments or overlapping arrays, and 33 for reentry. Views are
115not written by Omega and use const-qualified C pointers. Generated C contains the implementation and checked
116runtime, not a call into AArch64 machine code, and can be compiled on Linux
117x86-64 with GNU C. Native call adapters remain a separate AArch64 path.
118Literal-count loops do not emit an unused runtime guard counter. Seeded C
119marks source scalar declarations as possibly unused, preserving evaluation of
120their initializers, including calls with side effects. This is declaration
121metadata, not a repository warning-flag change. The seeded strict-host test
122compiles with `-Wall -Wextra -Werror` and includes an annotation-removal mutant.
123
124Qualification is separate from implementation. Run the unchanged baseline
125`tools/test.sh` first, then `python3 tests/seeded.py` with both pinned compilers
126configured. The latter compares native Omega, generated C and Python,
127executes generated x86-64 machine code through qemu-x86_64, checks the header
128ABI, and includes wrong-seed and arithmetic-emitter negative controls.
129No device qualification is implied.
130
131`python3 tests/seeded_float.py` compares the seeded executable and generated C
132byte-for-byte (host and x86-64 under qemu) over zero, subnormal, normal, overflow, infinity
133and NaN inputs for f32 and f64, 132 constants against an exact round-to-nearest-even oracle
134(one-ulp mutant detected), and converter refusal codes cross-checked against omc.
135It includes baseline/Python, f64-array, numeric-cast, unsupported-op,
136header-validation and fast-math refusal controls. These are host/emulator results only.
137
138### Explicit runtime-extent hosted views
139
140`tools/bridge-seeded --runtime-views c|h unit.om` keeps the e5b32567 source
141validator and explicitly changes only the hosted view boundary policy. Numeric
142view/edit lengths are capacities: callers pass `0 <= n <= CAP`, and `len`,
143`get`, `put` and helper-call counts use the actual `n`. The default profile
144still requires exact declared counts; it is not a runtime-view alias.
145
146The runtime profile also lowers the pinned compiler's bare `om2` header and
147unsized `view T *` / `edit T *` parameters, without the numeric capacity ceiling.
148Only this narrow OM2 subset is added: layouts, `part`, exports, contracts and
149`om2 diag`/`om2 fmt` are not lowered. Unsupported constructs refuse without
150output. Six source parameters remain the maximum. The seed counts each numeric
151view as one machine slot and each unsized view as two; at most six native slots
152are available. Thus five bounded views are supported, but five unsized views
153are not. Numeric declarations still obey the seed's fixed-capacity limit.
154
155Kinds are `uchar`, `ushort` (halfword), `uint`, `ulong` and `f32`. Every
156nonempty view must be nonnull, naturally aligned and have a nonwrapping byte
157range. Empty views may have null or misaligned addresses and have no overlap
158range. Writable/view and writable/writable overlaps refuse; readonly aliases
159and adjacent disjoint actual ranges are accepted. Result storage remains
160nonnull, aligned and disjoint. Admission errors return 32; access outside
161the live count is trap 3. Writes completed before a trap are not rolled back.
162Generated headers and C identify the runtime profile. Count arguments in
163the checked wrapper are volatile for setjmp correctness, without changing
164the C calling ABI. Compile floating operations with `-ffp-contract=off`.
165The existing iteration/call guards are unchanged: accepting a large extent
166does not promise traversal beyond those guards.
167
168`tests/seeded_runtime_views.py` compares the generated C against independent
169checked reference semantics on the host and under x86 QEMU, across empty,
170one-element, capacity and maximum-address envelopes. It kills removed read/
171write bounds, declared-range overlap, null-check, byte-size overflow and
172byte-loop code-generation mutants. It also covers fixed-profile exact counts,
173helper count forwarding, readonly aliases and five-bounded-view signatures.
174See the appended hosted runtime-view ABI in `docs/NATIVE-ABI.md`.
175
176### Explicit draft-1049 float profile (not a default pin refresh)
177
178`OMEGA_SEEDED_NEXT_OMC=/path/to/candidate tools/bridge-seeded --float-next c|h unit.om`
179selects omega-mv draft #1049 at `7e93ca8e29b3fe81314a88c9f1cb70666fca27f5`,
180candidate compiler sha256
181`d89bdc08ca21ea9726f1117adc791f683287d3698ea112a9db5519df2e79aeec`.
182Source sha256 is `0a0f4bbc361e555de223d93e774ed5c8d96da401ab574983897ecc82539e0549`.
183It adds `fma a b c` with equal explicit f32/f64 operands and one hardware FMADD
184rounding, plus #1024's exact decimal-to-binary rounding. The compatibility emitter
185preserves left-to-right operand evaluation and copies the candidate compiler's
186bounded integer limb conversion into its separately selected literal path.
187The new FMA profile is AArch64-only, as is this compiler keyword; other C
188architectures refuse at compilation rather than silently emitting mul+add.
189The default e5 profile retains its exact historical literal bits and rejects
190the candidate compiler digest. No baseline/native compiler pin is replaced.
191`tests/seeded_next.py` compares edge triples and 2^20 random triples per float
192width against the candidate machine code, kills FMA and literal mutants, and
193checks all 512 literal/oracle rows copied from that exact compiler revision
194(including both filed #1024 counterexamples). The fixture's Wolfram provenance
195and compiler-side fixpoint, seed/host gate and exact-oracle mutants are recorded
196in omega-mv #1049. Neither PR is merged or deployed.
197
198### C ABI library mode (cabi-1, omega-bridge#83)
199
200`OMEGA_SEEDED_OMC=/path/to/e5b32567/omc tools/bridge-seeded lib-c|lib-h|lib-map unit.om`
201lowers one seeded Omega unit into a C shared library: `lib-c` emits the library C
202(the unit's functions, the runtime and one exported wrapper per declared symbol),
203`lib-h` the public header and `lib-map` the GNU ld version script (declared exports
204global, everything else local). Library modes use the frozen e5 profile only;
205`--float-next` and `--runtime-views` with a library mode exit 24. The pinned seed
206compiler checks the whole unit first, as in the other modes.
207
208The C surface is declared in `note cabi ...` lines, so the unit stays plain seeded
209Omega. Directives (fixture: `tests/cabi/fixture.om`; production user: CUDApp
210`native/nvml/api.om`):
211
212- `library SONAME header HEADER`; `lock NAME process mutex` (one process-wide pthread mutex).
213- `status TYPE ENUMTAG int32 trap CODE`, `value TYPE NAME N`, `enum TYPE TAG uint32`,
214 `define NAME TEXT`, `alias OLD NEW` under `aliasguard MACRO`.
215- `handle TYPE STRUCT pool STATE count N lock L`: opaque handles are tagged slot
216 addresses; a forged, foreign or never-issued handle decodes as invalid.
217- `record TYPE STRUCT size S align A [alias NAME]` and `field TYPE NAME KIND OFFSET`:
218 offsets and sizes are checked against the C layout rules.
219- `state NAME ELEM N process lock L`: library state lives in fixed C arrays owned by
220 the wrapper and passed to Omega as views; an Omega `global` in a library unit is
221 refused (error 51).
222- `cstr STATE slots N width W fallback "TEXT" lock L`: stable string storage for a
223 `const char *` result.
224- `export SYMBOL FN status TYPE lock L` (or `cstr STATE`), `bind SYMBOL PARAM STATE`,
225 `arg SYMBOL NAME [nullable] in|out|inout TYPE [length ARG|count ARG] [commit BIT]
226 [data STATE OFFSET]`.
227- `import FN SYMBOL result R (value P | span P OFFSET LENGTH)...` on a body-less
228 stub: calls an external C symbol (for example a unit emitted by `tools/bridge-seeded c`).
229
230Each export calls `FN fr edit ulong N ...` with a frame: slot 0 the status, slot 1
231the commit mask, one slot per argument (pointer arguments carry their non-null flag;
232length/count outputs add a slot). The wrapper takes the lock, runs the Omega
233function, and publishes nothing unless the call returned without a trap, the status
234is a declared value, the commit mask names only declared outputs and every committed
235output is in bounds: a record array must fit the caller's count, a string output must
236fit the caller's length and end in its NUL, a `data` copy must lie inside its state.
237Any violation returns the declared trap status (`NVML_ERROR_UNKNOWN`, 999, in the
238fixture) with no output written. A `cstr` result always points into its stable
239storage or at the fallback text.
240
241Refusals, all with nothing on stdout: 40 malformed lock kind, 41 duplicate export
242symbol, 42 unknown lock/state/function/alias target, 43 wrong nullability, 44 bad
243record offset or size, 45 bind to state of the wrong extent or a record array
244without a count, 46 raw pointer result or argument, 47 out span without length,
24548 non-stable or out-of-storage string, 49 import stub with a body, 50 `main` in a
246library unit, 51 Omega global, 52 provenance mismatch.
247
248Provenance: every artifact's first line names the SHA-256 of `src/toc.om` and of the
249source. `tools/bridge-seeded` appends both digests as a trailer and opens
250`src/toc.om` on descriptor 3; `build/bridge` recomputes both with its own SHA-256
251(in Omega) and refuses any mismatch, a missing trailer or a withheld descriptor 3
252with error 52.
253
254Gate (seeded Omega; cc, nm, readelf, sha256sum and `tests/cabi/caller.c` are
255test-only ORACLE tools and never shipped), from the checkout root after
256`tools/build.sh`:
257
258```sh
259cat tests/cabi/proc.om tests/cabi/gate.om | "$OMEGA_SEEDED_OMC" > build/cabi-gate
260chmod +x build/cabi-gate
261OMEGA_SEEDED_OMC=/path/to/omc build/cabi-gate
262```
263
264It checks deterministic generation and golden bytes, exactly 8 exports and the
265soname, a 57-check caller (null and out-parameters, handles, forged handles, stable
266strings, 8 threads x 2000 calls with no lost update), cc refusing an import
267declaration that disagrees with the external header, 18 refusal cases (errors 40-50), eight
268direct `build/bridge` provenance cases, and four mutants the caller must catch
269(null-out commit, publication, lock removal and a ulong import span moved from
270element 3 to element 2). It prints `OMEGA-BRIDGE CABI GATE PASS`, exits 77 when
271unconfigured and 1 on any failure. Evidence: `evidence/cabi-1/`.
272
273## Portable import-free scalar and checked borrowed-view profiles
274
275`tools/bridge-freest c|h SOURCE.om` selects one of two fail-closed import-free
276profiles before body conversion. Borrowed-view signatures select the checked
277profile in `src/toc.om`; units without borrowed signatures select the original
278scalar parser/emitter in `src/freest.om`. A view-bearing unit never retries the
279scalar profile after a refusal. This does not replace the hosted
280`tools/bridge-seeded c|python|h` roots or change their ABI.
281The shell entrypoint only snapshots, checks compiler fingerprints, validates
282with the seeded frontend, compiles the Omega converter and publishes its output
283after success. It implements no source parser.
284
285Use the same `OMEGA_SEED` baseline fingerprint and `OMEGA_SEEDED_OMC` frontend
286fingerprint documented above. The wrapper validates and converts the identical
287snapshot. No native x86 Omega compiler is required: portable C is compiled by the
288consumer's C compiler. Both `c` and `h` traverse the complete source before
289publishing bytes, including every unused helper. Headers cannot bypass profile
290refusal. The input bounds and scalar type/name limits remain those of the
291seeded frontend and converter tables.
292
293The original scalar subset remains integer-only, stateless and nontrapping: scalar
294signatures, literal constants, scalar locals, `if`/`else`, `ret`, and acyclic
295function calls. Unsigned non-bool addition, subtraction, multiplication and
296negation wrap at the declared width. Integer comparisons and bitwise operations
297are supported, as are identity and same-signedness widening conversions
298(including bool to a wider unsigned type). Signed arithmetic, division,
299remainder, every shift, narrowing and signedness-changing conversions are
300refused conservatively, even when a particular constant or path could be safe.
301Loops, arrays, mutable globals, text, I/O, host words, `main`, recursion, floats,
302explicit traps, contracts and OM-2 are outside this profile. Refusal applies to
303the complete unit, not merely the exported root or reachable helpers. No
304function-name whitelist is used.
305Spell scalar types as `bool`, `uchar`, `ushort`, `uint`, `ulong`, `byte`,
306`short`, `int` or `long`; short type aliases are outside this profile.
307
308The final function is exported as `uint32_t omega_NAME(uint64_t *result, ...)`.
309The result pointer is first. Arguments and results use canonical uint64_t
310integer bits, including sign extension for signed values. Status 0 stores the
311result; status 32 refuses null, misaligned or wrapping result addresses and
312noncanonical scalar arguments before any store. As with other native pointer
313ABIs, callers remain responsible for supplying valid writable storage; the
314profile does not probe mapped-memory permissions. There are no runtime traps,
315reentry state, TLS, setjmp/longjmp, libc calls or host imports in generated code.
316The output includes only the standard integer type header and pure local
317helpers; it is not a call into AArch64 machine code.
318
319The checked borrowed-view subset accepts the hosted view element kinds
320(`uchar`, `ushort`, `uint`, `ulong`, `f32`). Units without an `om2` header retain
321the default hosted exact-count contract: a declared extent of 32 requires a
322caller count of 32, not 31. A seed-validated `om2` header explicitly selects
323the runtime-view contract, where numeric extents are capacities and `*` is
324unsized. This selection applies to both C and header output and needs no
325command-line flag. The subset includes local arrays, checked arithmetic/conversions, floats, bounded
326loops and internal calls accepted by the seeded C converter. It retains the
327hosted result-first ABI, scalar canonical bits/float types, capacity/count,
328NULL/zero, alignment, address-overflow and alias checks. It does not add globals,
329text, host words, I/O, `main`, `part`, ownership/out arrays or unsupported
330converter capabilities. The whole unit is checked in both `c` and `h` modes.
331Each exported call uses a stack-local status/depth context threaded through
332private functions: bounds and arithmetic refusals return the same statuses
3331–7; foreign-argument refusal is 32. Result storage changes only on success;
334earlier buffer writes remain visible after refusal. Internal calls and primitive
335checks unwind before later expressions or writes. There is no TLS, global
336reentry state, libc/POSIX call, abort, printf, setjmp/longjmp or int128 helper.
337The allowed undefined-symbol set is empty. Generated C is byte-stable and
338targets GNU C11 on the same little-endian AArch64/x86 floating environment as
339the hosted seeded converter; the caller enables FP and supplies valid storage.
340Host/compiler/header dependencies are unchanged verification/conversion tools,
341not runtime imports into the generated object.
342
343`tests/freest_views.py` copies the CUDApp attention-set/fill, fixed launch-record
344and runtime-copy source shapes. It compares hosted and freestanding output on
345deterministic randomized and boundary inputs, checks partial-write/refusal
346behavior, exact-count and capacity/unsized views, pointer/result aliases and
347unchanged storage on admission refusal. It compiles O0/O2 objects with an empty
348`nm -u` set and no TLS, and kills seven mutations in the new Omega emitter
349path, including removal of the fixed-extent check. It also checks a seeded-valid unsupported `part`
350unit refuses without output. Run on the host after `tools/build.sh` with
351`OMEGA_SEED` and `OMEGA_SEEDED_OMC` configured; ctypes is test infrastructure,
352not an emitted-code dependency.
353
354
355For independent integration, dispatch a future `bridge-seeded freest|freest-h`
356mode directly to `tools/bridge-freest c|h` before its hosted-mode case. Keep
357the hosted roots unchanged. `tests/freest.py` exercises both hosted and freest
358revision/epoch roots, the result-first ABI and exhausted-generation boundaries,
359arbitrary helpers, structural refusal controls and a wrong-result control.
360It inspects O0/O2 freestanding objects and a `-r -nostdlib` link with `nm -u`
361(requiring an empty set, not an import allowlist) and `readelf` (no TLS sections).
362Run it after `tools/build.sh` with both pinned compilers configured. Set
363`FREEST_CUDAPP_ROOT` to use a consumer checkout's actual revision/epoch sources
364instead of the checked-in source-shape fixtures. For x86-64 execution from an
365AArch64 host, set `CC=x86_64-linux-gnu-gcc` and
366`FREEST_RUNNER='qemu-x86_64 -L /usr/x86_64-linux-gnu'`.
367The default hosted optimization is O2; `HOSTED_OPT` selects an explicit
368comparison build and is printed in the result. These are targeted host checks,
369not device qualification.