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 Source

Runtime-extent hosted typed views

IMPLEMENTED and CPU-EXERCISED on feat/typed-views-runtime-extent, stacked on feat/portable-typed-views at 758d74aadf465ed5d4b3c80d798615c8ed4e18f8 (#71). The parent PR was freshly checked OPEN/DRAFT at that exact head before publishing. git fetch origin main feat/portable-typed-views returned0. No rebase, merge, deployment, native compiler repin or GPU access was performed.

Boundary policy and exact source pins

Use tools/bridge-seeded --runtime-views c|h unit.om. Numeric OM1 view lengths are capacities. The explicit profile also supports the existing seeded bare om2 header plus unsized view T * / edit T *; this does not add arbitrary OM2 features. Both modes use caller pointer/count pairs, live len/get/put, byte-size/address overflow checks, empty-null admission and actual-range alias checks. The result pointer remains exact and nonnull. The original fixed profile and the #71 fixed-width load/store helpers are unchanged.

The exact seed source at lines214-218 and6539-6608 distinguishes physical slots: numeric views take one slot, unsized views two, with six slots total. Five bounded views have been exercised without narrowing their live counts to declared sizes. The seed still validates the original snapshot before conversion. Its unchanged iteration guard remains a separate limit from buffer admission.

The ABI was sent to BwMatmulRealize, ApiViewsAttn and ApiViewsElem before freeze. Their required uint/ushort/f32/uchar/ulong cases, bounded windows, large unsized extents, empty nulls, adjacent buffers and readonly alias policy are covered. docs/NATIVE-ABI.md adds a disjoint final hosted section with BridgeHost's explicit permission; existing native sections and implementation were not changed. Guide update requested in https://github.com/aien-dev/omega-harness/issues/194, because this assignment permits omega-bridge edits only.

Tests and controls

Every executed test/binary/mutant is contained in:

bwrap --dev-bind / / --dev /dev --proc /proc -- taskset -c 10-14 nice -n 10 COMMAND

commands.json records argv, environment, rc and final lines. Adjacent logs replace only the home-directory prefix with ~. The final oracle log identifies QEMU10.0.14 and native/cross GCC13.3.0. The first seeded/float run used the system QEMU8.2.2; they were rerun with the required QEMU10 directory first on PATH. Typed views and runtime views use the explicit QEMU10 path from QEMU_X86_64. No historical receipt was edited to turn a prior result into a PASS.

Command after wrapperrcFinal lineLog
sh tools/test.sh0ALL SUITES RC=0baseline.log
python3 tests/seeded.py0SEEDED CONVERTER differential C/Python/native/x86 and pin/arithmetic/ABI controls PASS; device NOT_RUNseeded-oracle10.log
python3 tests/seeded_float.py0PASS seeded binary32/binary64 byte differential (native/C/x86, 132 constants vs exact oracle, one-ulp mutant detected); baseline/Python/f64-array/converter refusalsfloat-oracle10.log
python3 tests/seeded_views.py0SEEDED-VIEWS PASSviews.log
python3 tests/seeded_runtime_views.py0SEEDED-RUNTIME-VIEWS PASSruntime-final.log
python3 tests/seeded_next.py0SEEDED-NEXT PASSnext.log
python3 tests/freest.py (host)0PASS direct structural converter refusals independently of frontend, including recursive call graphfreest.log
env CC=x86_64-linux-gnu-gcc FREEST_RUNNER='.../qemu-x86_64 -L /usr/x86_64-linux-gnu' python3 tests/freest.py0same final linefreest-x86.log

Plain env OMEGA_SEED=~/work/cudastack/omega-bridge/build/bootstrap/omc sh tools/build.sh returned0 with no output (run before acceptance). The converter remains seeded Omega; Python and C in this test are verification oracles, not a production implementation. crumb compile . && crumb verify . under the same device-free wrapper returned0, final line crumb verify: OK: 4 crumbs current.

The new independent checked C reference covers all five element types, bounded and unsized, on host and emulated x86. It exercises n=0/1/capacity, all counts0..256, literal and dynamic accesses, actual read/write bounds with the other bound valid, maximum nonwrapping synthetic address ranges without dereferencing them, overflow, empty/misaligned/null pointers, result overlap, writable overlap and adjacency. A no-op copy cannot pass: input and output bytes begin different. Helper forwarding, readonly aliases, fixed-profile exact counts and five-view declarations have additional executable controls. Header and C output both refuse unsupported syntax, unsized-to-fixed calls, readonly-to-edit calls and over-slot signatures without output.

Six independently killed mutants are in the final log:

  1. read bounds removed;
  2. write bounds removed;
  3. actual overlap range replaced by declared capacity;
  4. nonempty null check removed;
  5. count-times-width overflow check removed;
  6. #71 byte-loop load regression restored and caught by GCC AArch64 instruction shape.

The unchanged #71 wide-load/store assembly check and original mutants still pass in views.log. Existing native-only generators/suites were not changed or rerun. The historical #71 native-v2 FAIL1 is not silently reclassified as green here. This report's regression PASS scope is the complete portable converter suite that #71's final storage amendment exercised, plus the new runtime suite and x86 freest. Physical x86, GPU/chip qualification, MERGED and DEPLOYED are NOT_RUN.

Development failures retained as observations

Before final acceptance, an initial new fixture exposed GCC -Wclobbered for a live runtime-count parameter. Runtime wrapper count definitions now use volatile, matching existing scalar setjmp handling without changing the public ABI. A synthetic max-range fixture originally overlapped real result storage and was correctly refused; it now starts after that result storage. A bounds mutant initially survived when both bounds were identical; independent short-read and short-write fixtures now kill each check separately. Those exploratory commands returned1 and were not claimed as PASS. The final logs above are the post-repair runs; no refusal gate was weakened.

The overflow constants and quotient boundary table in the new test were obtained with WolframLanguageEvaluator: {2^64-1,Table[{z,Quotient[2^64-1,z],Quotient[2^64-1,z]+1},{z,{1,2,4,8}}]} returned {18446744073709551615,{{1,18446744073709551615,18446744073709551616},{2,9223372036854775807,9223372036854775808},{4,4611686018427387903,4611686018427387904},{8,2305843009213693951,2305843009213693952}}}.

Additional bounded NUL-path acceptance

Main requested a borrowed-byte case for FreestLeftovers. The exact pathlen example is appended to NATIVE-ABI: it scans uchar * only within caller a_n, returns the first NUL index or a_n if absent, and accepts NULL only when empty. The final suite compares it to memchr for every count0..256 and each terminator position, including a terminator at (outside) the count. Host and QEMU10 x86 both returned0 and printed PASS bounded NUL scan reference, including absent/outside-bound terminators. The complete suite command still returned0, final line SEEDED-RUNTIME-VIEWS PASS; the immutable post-addition receipt is runtime-nul-final.log with matching commands.json row. Earlier logs describe earlier test fixtures, not this addition. The converter and wrapper hashes above remain unchanged.

This is the hosted checked converter profile, not an implementation of borrowed views for tools/native --freestanding or an import-free runtime. Those consumers must choose that boundary explicitly. CUDApp's path traversal is not ported by this omega-bridge-only contribution.

BwMatmulRealize clarified one unresolved consumer signature: three unsized matrix views plus independent runtime m/k/n metadata require more than the six physical slots available in the frozen seed. This change admits large extents but does not claim to solve that general signature. No output capacity restriction, descriptor suffix requirement, source-validation bypass or C-chunk shim was substituted. That case needs a concrete, qualified compiler slot/descriptor extension; Main was notified and BwMatmulRealize retains Main's verification-only C oracle exception.