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 / evidence / runtime-views / REPORT.md

141 lines · 9051 bytes Raw Blame History Rendered
1# Runtime-extent hosted typed views
2
3IMPLEMENTED and CPU-EXERCISED on `feat/typed-views-runtime-extent`, stacked on
4`feat/portable-typed-views` at `758d74aadf465ed5d4b3c80d798615c8ed4e18f8` (#71).
5The parent PR was freshly checked OPEN/DRAFT at that exact head before publishing.
6`git fetch origin main feat/portable-typed-views` returned0. No rebase, merge,
7deployment, native compiler repin or GPU access was performed.
8
9## Boundary policy and exact source pins
10
11- `src/toc.om`: `d84fd6ebd258170a023ed5235880cd3e1ca8664703a2542542a7f8d103120538`.
12- `tools/bridge-seeded`: `a3a455bd77381e132215924295763e8728889d7d578278ae376de78324be8629`.
13- `tests/seeded_runtime_views.py`: `e1ddb4d725e89ca2a1bbba8d1b5f6044f6ca0b9c600022f345964e06da9ee1ac`.
14- Unchanged `tests/seeded_views.py`: `e7682d4820888c0df2a22600c34641b4d50b2e0ef64f15713439bbea51831058`.
15- Unchanged input validator: omega-mv `e5b32567a7aff3ce594e3254a622a846a6cd190b`,
16 compiler `2c82480596bbdc50cda9626866209ef662d5834f278f839ff4ce0250c495029f`,
17 source `seed/omc/omc.om` `7703da00055fc0c7a91fcae43071df76a3f277dbe867cb284a3bdff3bedb7e1b`.
18
19Use `tools/bridge-seeded --runtime-views c|h unit.om`. Numeric OM1 view lengths
20are capacities. The explicit profile also supports the existing seeded bare
21`om2` header plus unsized `view T *` / `edit T *`; this does not add arbitrary
22OM2 features. Both modes use caller pointer/count pairs, live `len/get/put`,
23byte-size/address overflow checks, empty-null admission and actual-range alias
24checks. The result pointer remains exact and nonnull. The original fixed profile
25and the #71 fixed-width load/store helpers are unchanged.
26
27The exact seed source at lines214-218 and6539-6608 distinguishes physical slots:
28numeric views take one slot, unsized views two, with six slots total. Five bounded
29views have been exercised without narrowing their live counts to declared sizes.
30The seed still validates the original snapshot before conversion. Its unchanged
31iteration guard remains a separate limit from buffer admission.
32
33The ABI was sent to BwMatmulRealize, ApiViewsAttn and ApiViewsElem before freeze.
34Their required uint/ushort/f32/uchar/ulong cases, bounded windows, large unsized
35extents, empty nulls, adjacent buffers and readonly alias policy are covered.
36`docs/NATIVE-ABI.md` adds a disjoint final hosted section with BridgeHost's explicit
37permission; existing native sections and implementation were not changed.
38Guide update requested in https://github.com/aien-dev/omega-harness/issues/194,
39because this assignment permits omega-bridge edits only.
40
41## Tests and controls
42
43Every executed test/binary/mutant is contained in:
44
45```sh
46bwrap --dev-bind / / --dev /dev --proc /proc -- taskset -c 10-14 nice -n 10 COMMAND
47```
48
49`commands.json` records argv, environment, rc and final lines. Adjacent logs replace
50only the home-directory prefix with `~`. The final oracle log identifies QEMU10.0.14
51and native/cross GCC13.3.0. The first seeded/float run used the system QEMU8.2.2;
52they were rerun with the required QEMU10 directory first on PATH. Typed views and
53runtime views use the explicit QEMU10 path from `QEMU_X86_64`. No historical receipt
54was edited to turn a prior result into a PASS.
55
56| Command after wrapper | rc | Final line | Log |
57|---|---|---|---|
58| `sh tools/test.sh` | 0 | `ALL SUITES RC=0` | baseline.log |
59| `python3 tests/seeded.py` | 0 | `SEEDED CONVERTER differential C/Python/native/x86 and pin/arithmetic/ABI controls PASS; device NOT_RUN` | seeded-oracle10.log |
60| `python3 tests/seeded_float.py` | 0 | `PASS seeded binary32/binary64 byte differential (native/C/x86, 132 constants vs exact oracle, one-ulp mutant detected); baseline/Python/f64-array/converter refusals` | float-oracle10.log |
61| `python3 tests/seeded_views.py` | 0 | `SEEDED-VIEWS PASS` | views.log |
62| `python3 tests/seeded_runtime_views.py` | 0 | `SEEDED-RUNTIME-VIEWS PASS` | runtime-final.log |
63| `python3 tests/seeded_next.py` | 0 | `SEEDED-NEXT PASS` | next.log |
64| `python3 tests/freest.py` (host) | 0 | `PASS direct structural converter refusals independently of frontend, including recursive call graph` | freest.log |
65| `env CC=x86_64-linux-gnu-gcc FREEST_RUNNER='.../qemu-x86_64 -L /usr/x86_64-linux-gnu' python3 tests/freest.py` | 0 | same final line | freest-x86.log |
66
67Plain `env OMEGA_SEED=~/work/cudastack/omega-bridge/build/bootstrap/omc sh tools/build.sh`
68returned0 with no output (run before acceptance). The converter remains seeded Omega;
69Python and C in this test are verification oracles, not a production implementation.
70`crumb compile . && crumb verify .` under the same device-free wrapper returned0,
71final line `crumb verify: OK: 4 crumbs current`.
72
73The new independent checked C reference covers all five element types, bounded
74and unsized, on host and emulated x86. It exercises n=0/1/capacity, all counts0..256,
75literal and dynamic accesses, actual read/write bounds with the other bound valid,
76maximum nonwrapping synthetic address ranges without dereferencing them, overflow,
77empty/misaligned/null pointers, result overlap, writable overlap and adjacency.
78A no-op copy cannot pass: input and output bytes begin different. Helper forwarding,
79readonly aliases, fixed-profile exact counts and five-view declarations have
80additional executable controls. Header and C output both refuse unsupported syntax,
81unsized-to-fixed calls, readonly-to-edit calls and over-slot signatures without output.
82
83Six independently killed mutants are in the final log:
84
851. read bounds removed;
862. write bounds removed;
873. actual overlap range replaced by declared capacity;
884. nonempty null check removed;
895. count-times-width overflow check removed;
906. #71 byte-loop load regression restored and caught by GCC AArch64 instruction shape.
91
92The unchanged #71 wide-load/store assembly check and original mutants still pass
93in `views.log`. Existing native-only generators/suites were not changed or rerun.
94The historical #71 native-v2 FAIL1 is not silently reclassified as green here.
95This report's regression PASS scope is the complete portable converter suite that
96#71's final storage amendment exercised, plus the new runtime suite and x86 freest.
97Physical x86, GPU/chip qualification, MERGED and DEPLOYED are NOT_RUN.
98
99## Development failures retained as observations
100
101Before final acceptance, an initial new fixture exposed GCC `-Wclobbered` for a
102live runtime-count parameter. Runtime wrapper count definitions now use volatile,
103matching existing scalar setjmp handling without changing the public ABI. A
104synthetic max-range fixture originally overlapped real result storage and was
105correctly refused; it now starts after that result storage. A bounds mutant
106initially survived when both bounds were identical; independent short-read and
107short-write fixtures now kill each check separately. Those exploratory commands
108returned1 and were not claimed as PASS. The final logs above are the post-repair
109runs; no refusal gate was weakened.
110
111The overflow constants and quotient boundary table in the new test were obtained
112with WolframLanguageEvaluator:
113`{2^64-1,Table[{z,Quotient[2^64-1,z],Quotient[2^64-1,z]+1},{z,{1,2,4,8}}]}`
114returned `{18446744073709551615,{{1,18446744073709551615,18446744073709551616},{2,9223372036854775807,9223372036854775808},{4,4611686018427387903,4611686018427387904},{8,2305843009213693951,2305843009213693952}}}`.
115
116## Additional bounded NUL-path acceptance
117
118Main requested a borrowed-byte case for FreestLeftovers. The exact `pathlen`
119example is appended to NATIVE-ABI: it scans `uchar *` only within caller `a_n`,
120returns the first NUL index or `a_n` if absent, and accepts NULL only when empty.
121The final suite compares it to `memchr` for every count0..256 and each terminator
122position, including a terminator at (outside) the count. Host and QEMU10 x86 both
123returned0 and printed
124`PASS bounded NUL scan reference, including absent/outside-bound terminators`.
125The complete suite command still returned0, final line `SEEDED-RUNTIME-VIEWS PASS`;
126the immutable post-addition receipt is `runtime-nul-final.log` with matching
127`commands.json` row. Earlier logs describe earlier test fixtures, not this addition.
128The converter and wrapper hashes above remain unchanged.
129
130This is the hosted checked converter profile, not an implementation of borrowed
131views for `tools/native --freestanding` or an import-free runtime. Those consumers
132must choose that boundary explicitly. CUDApp's path traversal is not ported by this
133omega-bridge-only contribution.
134
135BwMatmulRealize clarified one unresolved consumer signature: three unsized matrix
136views plus independent runtime m/k/n metadata require more than the six physical
137slots available in the frozen seed. This change admits large extents but does not
138claim to solve that general signature. No output capacity restriction, descriptor
139suffix requirement, source-validation bypass or C-chunk shim was substituted.
140That case needs a concrete, qualified compiler slot/descriptor extension; Main
141was notified and BwMatmulRealize retains Main's verification-only C oracle exception.