Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-bridge/blob/main/evidence/typed-views.md # omega-bridge Omega-first language interoperability: checked conversion backends and native language bindings Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-bridge / evidence / typed-views.md` 231 lines · 15279 bytes Raw Blame History Source # Typed views and explicit float profiles ## Revision and scope IMPLEMENTED and EXERCISED on branch `feat/portable-typed-views` in `~/work/cudastack/lanes/BridgeViews`. A fresh `git fetch origin main` still reported base `3d01b49be9503d967a9f891c747222aff0aaf67d` before publication. The accompanying commit fixes the exact sources below: Source SHA-256 `src/toc.om` `b6abf22d1bd26da164e6b3a883806511ba3f63cfa633d832b735f4583ff3b09e` `tools/bridge-seeded` `65778db0d82c994f8606f6b868645f7b89c0a5062a1f23d1eccc65690f1b55d0` `src/native.om` `62e606762de623d611d05dd8764a35d343eb82e4b625bb65643a22debdcc9913` `tools/native` `8ee0fc4668f2a4438a4d3f09c63da4a9993aebb054edaa3b01cec9e95c1fa873` `tests/seeded_next_literals.want` `069ce343ddb4b88e076b26368b6bcaccec473402b0b7b860f7fd2d9b4b89c8b0` Native generator/tool/documentation edits were coordinated with BridgeHost. Their default compiler pins, existing `sp[7]` zero-initialization, and freestanding OM-2/array lane were not replaced. Public native floats require explicit profiles; they are not admitted through the default or freestanding generator. ## Source semantics checked before lowering The frozen reference is omega-mv `e5b32567a7aff3ce594e3254a622a846a6cd190b`: `seed/omc/omc.om` SHA-256 `7703da00055fc0c7a91fcae43071df76a3f277dbe867cb284a3bdff3bedb7e1b`, compiler SHA-256 `2c82480596bbdc50cda9626866209ef662d5834f278f839ff4ce0250c495029f`. The source checks covered `twid`/`tlog`, `ldop`/`stop`, `elemtype`, and `fintr` (`omc.om` lines 2130, 2156, 2225, 2259, 2684 and 3142 at that revision), plus OMEGESE.md's unsigned/view and floating contracts (lines 429–474 and 548–578). MCP keyword lookup/run evidence was used alongside the source. - `ushort`/`uint` arithmetic wraps at its declared unsigned width. Storage is little-endian. The emitter uses `uint16_t`/`uint32_t` backing storage and explicit byte assembly/disassembly, not incompatible typed-pointer aliasing. - `f32` array storage is raw `uint32_t` IEEE bits. Loads/stores preserve NaN payloads, subnormals and signed zero. Arithmetic retains the existing seeded AArch64 rounding, NaN and conversion rules. Unsupported endian/FP environments fail at C compilation; no approximate substitute is emitted. - The seeded function ABI transports f32/f64 scalars as raw integer-slot bits. Public C `float`/`double` adapters therefore bit-copy, rather than pass hardware float registers directly to the Omega entry. Result size/alignment/store and overlap checks use 4 or 8 bytes, respectively. Only success stores a result. - `fsqrt` already exists in e5. Portable lowering uses AArch64 FSQRT or x86 SSE scalar sqrt with the established AArch64 NaN handling, without libm. - `fma` does not exist in e5. It is never silently enabled there. The draft-next profile uses the separately qualified compiler candidate below. - e5's decimal conversion is not generally correctly rounded (#1024). Its two recorded misroundings remain deliberately reproducible in the frozen profile. Correct rounding belongs only to the explicit candidate profile. - Global arrays work in standalone programs. The e5 function-mode compiler itself refuses its global pool with error 9; this is not bypassed by conversion. The portable extension is `bridge-seeded`, the path used by GemmEx. The separate `bridge-freest` stateless, nontrapping, import-free integer-scalar profile remains unchanged; it did not previously support array views. Native OM-2 floats and freestanding floats are not claimed by this change. `f64` arrays still refuse 24. ## Explicit candidate and compiler contribution Draft compiler PR: https://github.com/aien-dev/omega-mv/pull/1049 - Branch `feat/seeded-fma-exact-literals`, base `5287336a50b4b75a357bfc330f599cc604209e40`, head `7e93ca8e29b3fe81314a88c9f1cb70666fca27f5`. - Compiler source SHA-256 `0a0f4bbc361e555de223d93e774ed5c8d96da401ab574983897ecc82539e0549`; executable SHA-256 `d89bdc08ca21ea9726f1117adc791f683287d3698ea112a9db5519df2e79aeec`. - `fma a b c` requires equal explicit f32/f64 operands. AArch64 emits one FMADD; x86linux/x86efi refuse 9 instead of substituting an unfused sequence. The C emitter preserves left-to-right operand evaluation before its single FMADD. - #1024 is in scope: this compiler contribution reuses the exact-literal core from draft #1027, revision `681d6f487ac3c237e0b8d73c287e0a8f232b1434`, rather than inventing a competing converter. The bridge ports that bounded Omega core into a separately selected literal path. - Select portable C/header with `tools/bridge-seeded --float-next c|h SOURCE.om` and `OMEGA_SEEDED_NEXT_OMC`. Select native bindings with `tools/native --float-next OUTDIR unit.om...` and `OMEGA_NATIVE_FLOAT_NEXT_OMC`. Both check the exact candidate digest. - e5 native public floats use `--float` and `OMEGA_NATIVE_FLOAT_OMC`; the existing `OMEGA_NATIVE_OMC` still builds the generator at its unchanged baseline pin. Direct framed-input users must select `float` or `fhost`. Unprofiled public float signatures refuse 110 without stdout in every binding mode. Compiler worker evidence is filed at `~/work/cudastack/lanes/OmcFloat/evidence/SEED-0/fma-exact-literals/REPORT.md` and in #1049. Its recorded commands, all under `taskset -c 10-14 nice -n 10`, were: Command rc Observed result `sh seed/omega-from-seed.sh` 0 all three bootstrap/fixpoint stages identical `make -j3 build/omegese/omegese build/omega_emit/omega_emit build/checker2/checker2` 0 existing oracle tools built `sh seed/host/check.sh` 0 `PASS native-host qualification; seeded build, C tools are comparison oracles only` That receipt also records 48 FMA cases, 512 exact literals, wrong-opcode, unfused, remainder and ties-down mutants killed, 300 gate-17 programs identical, and 163 gate-18 keyword packs. These are worker-filed CPU receipts, not an independent chip qualification. They predate Main's device-namespace instruction; they are not retroactively described as namespace-isolated. At the publication check, both #1049 and shared-core #1027 were OPEN/DRAFT and CONFLICTING against current main. No merge or default-pin refresh was performed. Integrating the common source into current main requires a fresh fixpoint/host receipt and explicit pin refresh under Main's integration decision, preserving BridgeHost's integrated-pin priority. The immutable candidate above is what the bridge tests actually executed. ## Bridge execution evidence `typed-views-commands.json` records exact argv, environment, start time, rc, final line and final-source digests. All new logs replace the home directory prefix with `~`; source and result bytes are not altered. Historical rows and logs are retained rather than edited into successful runs. The final runs below use Main's device-free wrapper literally: ``` bwrap --dev-bind / / --dev /dev --proc /proc -- taskset -c 10-14 nice -n 10 ``` The JSON records the complete expanded argv for each command. Environment pins are the frozen bridge bootstrap (`191b776e...`), e5 frontend (`2c824805...`), native generator compiler (`734f0a39...`), OM-2 compiler (`c000ec02...`), and the explicit candidate (`d89bdc08...`). It records executable paths for Rust, Zig 0.13.0, Go 1.27.3 and the x86 QEMU/Python oracles. No GPU gate was opened. Command after the wrapper rc Final line / result Log suffix after `typed-views-` `sh tools/test.sh` 0 `ALL SUITES RC=0` `baseline-device-free.log` `python3 tests/seeded.py` 0 `SEEDED CONVERTER differential C/Python/native/x86 and pin/arithmetic/ABI controls PASS; device NOT_RUN` `seeded-device-free.log` `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-sqrt-final.log` `python3 tests/seeded_views.py` 0 `SEEDED-VIEWS PASS` `views-device-free.log` `python3 tests/seeded_next.py` 0 `SEEDED-NEXT PASS` `next-device-free.log` `python3 tests/freest.py` 0 `PASS direct structural converter refusals independently of frontend, including recursive call graph` `freest-device-free.log` `python3 tests/native/float.py` (e5) 0 `NATIVE-FLOAT PASS (see per-language NOT_RUN lines)`; all five languages actually PASS `native-float-e5-mixed-final.log` `env OMEGA_NATIVE_FLOAT_PROFILE=next python3 tests/native/float.py` 0 same final line; all five languages actually PASS `native-float-next-mixed-final.log` `sh tests/native/test_build_failures.sh` 0 `PASS native callers: Zig and Go built and executed; no missing languages` `native-build-controls-profile.log` `sh tests/native/kinds.sh` 0 `NATIVE-KINDS PASS` `native-kinds-profile.log` `sh tests/native/v2/run.sh` 1 `NATIVE-V2 FAIL 1` — unchanged, permitted baseline `native-v2-profile.log` `sh tests/native/x86/run.sh` 0 `NATIVE-X86 EMULATED PASS (six languages built and run; native x86 NOT_RUN)` `native-x86-device-free.log` `python3 tests/native/x86/test_build_failures.py` 0 `NATIVE-X86 CONTROLS PASS (EMULATED; native x86 NOT_RUN)` `native-x86-controls-device-free.log` The v2 failure is exactly the frozen OM-2 compiler not hoisting: 0 writes of x20–x26 and 3 of d8–d15. Its 72 unit/output ABI-v1 parity cases and the rest of that gate still pass. No baseline, refusal, parity comparison or gate was weakened. The controls mutation-site update follows the changed bytewise helper text; it still deletes the same bounds check, and all seven controls are killed. ### Differential coverage and negative controls - `seeded_views.py`: exhaustive 65,536 u16 values; 15 explicit u32/f32 bit edges; exactly 1,048,576 deterministic random u32/f32 patterns, plus zero padding to the fixed array shape. Both host C and x86-emulated C match the e5 program's complete output. Operations include ushort/uint increment with wrap, f32 raw copies, add-one and fsqrt, and explicit little-endian serialization. - Each new type has error-21 compile-time out-of-range fixtures, standalone global-array parity, runtime bounds/count/null/alignment/pointer-wrap/alias/ overlap/recovery checks, and a killed storage mutant. Both portable public float widths have typed-scalar and ABI-mutant controls. - `seeded_float.py` adds fsqrt32/fsqrt64 edge differentials on host and x86 C, with a killed identity-instead-of-sqrt mutant for each width. Existing decimal oracle and refusal controls remain present. - `seeded_next.py`: edge triples and exactly 1,048,576 random triples per float width against candidate machine code; one wrong-FMA-opcode mutant per width; all 512 f32/f64 literal patterns against both native bits and the filed exact oracle, including both #1024 counterexamples; literal-emitter mutant killed; candidate digest refused by the frozen profile. - `native/float.py`: the same f32/f64 identity units called by C, Python ctypes, Rust, Zig and Go with NaN payloads, signed zero, denormals and infinities; every language passed under both e5 and candidate profiles. No missing-language NOT_RUN was hidden. C additionally executes mixed f32 scalar/view/edit slots, count and alias refusals, null-result checks and explicit `--host` marshalling. Unsupported targets/freestanding combinations refuse before output, and every unprofiled direct binding mode refuses 110 without stdout. Per-width result marshalling mutants are killed. - The pre-existing import-free freest gate still has empty `nm -u` after O0/O2 object and `-r -nostdlib` links, no TLS, 28 whole-unit refusals and empty stdout. An intermediate final-profile attempt failed with `omc: line 472: error 3` because its new global flag was declared after its first use. The flag was moved before use; the failed source digest/log remain in the JSON and `typed-views-native-float-e5-final.log`. Subsequent profile and mixed-unit runs pass. Earlier development attempts also exposed, then corrected, a test that incorrectly used a global pool in function mode and a freest invocation missing `OMEGA_SEED`; neither was suppressed or reclassified as a passing invocation. Wolfram receipts used by the test sizing and exact-literal oracle: - `WolframLanguageEvaluator: {2^16,2^20,2^32-1,FromDigits[Reverse[ToCharacterCode["fsqrt"]],256],FromDigits[Reverse[ToCharacterCode["fma"]],256]} -> {65536,1048576,4294967295,500136244070,6384998}`. - `WolframLanguageEvaluator: {Table[{w,3*w/8*256,w/8*256,3*w/8,w/8},{w,{32,64}}],2^20} -> {{{32,3072,1024,12,4},{64,6144,2048,24,8}},1048576}` (byte sizes). - The 512-row literal fixture is copied byte-for-byte from #1049's `seed/omc/tests/float/lit_round.want`. Its `oracle.wl` query and recorded Wolfram result `{512,0,{}}` are filed beside the compiler receipt: 512 checked, zero mismatches. This is an independent exact-literal oracle, not a C-libm answer. ## Required omega-harness guide text The matching guide is `skills/omega-encoding/SKILL.md`, including the observed limits in harness draft #183. This lane does not own that repository or #183. The exact updates needed are: - Keep the frozen CUDApp consumer's `bc11b30b`/`69d629df` refusal observation as historical evidence; add the separately pinned bridge draft's `ushort`, `uint`, `f32` views/local arrays and standalone globals, fixed-width LE storage, wrap, counts/alias/alignment checks and status-preserving ABI. - Distinguish portable C public float/double scalars from the native `--float`/`--float-next` profiles. Document the native raw integer-slot ABI, 4/8-byte result contracts, all five language bindings and direct-generator profile requirement. Do not imply OM-2/freestanding floats or f64 arrays work. - State that `fsqrt` already exists in e5; compatibility C uses AArch64/x86 instructions without libm. Do not call sqrt a new compiler keyword. - State that `fma` is absent in e5 and only available through the exact #1049 candidate above. Record single rounding and left-to-right evaluation; x86 compiler targets refuse 9 and the portable candidate profile is AArch64-only. - Retain #1024's e5 limitation. Describe correct rounding only under the candidate's explicit source/executable pins, with shared #1027 provenance, fixpoint/host/mutant evidence, current merge conflicts and no automatic reseed. - Keep #183's unrelated bool-to-integer function-mode error-9 witness unchanged. Cite the current CUDApp #295 consumer when adding these new typed-view results. - Label these results CPU/EMULATED and EXERCISED, not chip QUALIFIED, MERGED or DEPLOYED. Keep BridgeHost's separate freestanding OM-2/array work distinct. ## Deliberate non-claims PASS means only the exercised source/profile combinations above. The native-v2 aggregate remains FAIL 1 at its known baseline. Physical x86 execution, GPU/chip qualification, deployment and merge are NOT_RUN. The external Wycheproof corpus is NOT_RUN (not vendored), as stated in the compiler receipt. Both contributions remain draft and require Drake's approval to merge.